-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
112 additions
and
59 deletions.
There are no files selected for viewing
43 changes: 39 additions & 4 deletions
43
terraform/domains/environment_domains/config/dev.tfvars.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,41 @@ | ||
{ | ||
"domains": ["dev"], | ||
"environment_short": "dv", | ||
"environment_tag": "dev", | ||
"origin_hostname": "trs-dev-api.test.teacherservices.cloud" | ||
"hosted_zone": { | ||
"teacher-qualifications-api.education.gov.uk": { | ||
"front_door_name": "s189p01-trsdomains-fd", | ||
"resource_group_name": "s189p01-trsdomains-rg", | ||
"domains": [ | ||
"dev" | ||
], | ||
"cached_paths": [ | ||
"/assets/*" | ||
], | ||
"environment_short": "dv", | ||
"origin_hostname": "trs-dev-api.test.teacherservices.cloud" | ||
}, | ||
"authorise-access-to-a-teaching-record.education.gov.uk": { | ||
"front_door_name": "s189p01-trsdomains-fd", | ||
"resource_group_name": "s189p01-trsdomains-rg", | ||
"domains": [ | ||
"dev" | ||
], | ||
"cached_paths": [ | ||
"/assets/*" | ||
], | ||
"environment_short": "dv", | ||
"origin_hostname": "trs-dev-authz.test.teacherservices.cloud" | ||
}, | ||
"teaching-record-system.education.gov.uk": { | ||
"front_door_name": "s189p01-trsdomains-fd", | ||
"resource_group_name": "s189p01-trsdomains-rg", | ||
"domains": [ | ||
"dev" | ||
], | ||
"cached_paths": [ | ||
"/assets/*" | ||
], | ||
"environment_short": "dv", | ||
"origin_hostname": "trs-dev-ui.test.teacherservices.cloud" | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
# module "domains" { | ||
# source = "./vendor/modules/domains//domains/environment_domains" | ||
# zone = var.zone | ||
# front_door_name = var.front_door_name | ||
# resource_group_name = var.resource_group_name | ||
# domains = var.domains | ||
# environment = var.environment_short | ||
# host_name = var.origin_hostname | ||
# null_host_header = var.null_host_header | ||
# } | ||
# module "records" { | ||
# source = "./vendor/modules/domains//dns/records" | ||
# hosted_zone = var.hosted_zone | ||
|
||
# } | ||
|
||
module "domains" { | ||
source = "./vendor/modules/domains//domains/environment_domains" | ||
zone = var.zone | ||
front_door_name = var.front_door_name | ||
resource_group_name = var.resource_group_name | ||
domains = var.domains | ||
environment = var.environment_short | ||
host_name = var.origin_hostname | ||
null_host_header = var.null_host_header | ||
for_each = var.hosted_zone | ||
source = "git::https://github.com/DFE-Digital/terraform-modules.git//domains/environment_domains?ref=stable" | ||
zone = each.key | ||
front_door_name = each.value.front_door_name | ||
resource_group_name = each.value.resource_group_name | ||
domains = each.value.domains | ||
environment = each.value.environment_short | ||
host_name = each.value.origin_hostname | ||
null_host_header = try(each.value.null_host_header, false) | ||
cached_paths = try(each.value.cached_paths, []) | ||
} | ||
module "records" { | ||
|
||
module "dns_records" { | ||
source = "./vendor/modules/domains//dns/records" | ||
hosted_zone = var.hosted_zone | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
variable "zone" { | ||
type = string | ||
description = "Name of DNS zone" | ||
default = "teacher-qualifications-api.education.gov.uk" | ||
} | ||
|
||
variable "front_door_name" { | ||
type = string | ||
description = "Name of Azure Front Door" | ||
default = "s189p01-trsdomains-fd" | ||
} | ||
|
||
variable "resource_group_name" { | ||
type = string | ||
description = "Name of resouce group name" | ||
default = "s189p01-trsdomains-rg" | ||
} | ||
|
||
variable "domains" { | ||
description = "List of domains record names" | ||
} | ||
|
||
variable "environment_tag" { | ||
type = string | ||
description = "Environment" | ||
} | ||
|
||
variable "environment_short" { | ||
type = string | ||
description = "Short name for environment" | ||
} | ||
|
||
variable "origin_hostname" { | ||
type = string | ||
description = "Origin endpoint url" | ||
} | ||
|
||
variable "null_host_header" { | ||
type = bool | ||
description = "origin_host_header for the azurerm_cdn_frontdoor_origin" | ||
default = false | ||
} | ||
# variable "zone" { | ||
# type = string | ||
# description = "Name of DNS zone" | ||
# default = "teacher-qualifications-api.education.gov.uk" | ||
# } | ||
|
||
# variable "front_door_name" { | ||
# type = string | ||
# description = "Name of Azure Front Door" | ||
# default = "s189p01-trsdomains-fd" | ||
# } | ||
|
||
# variable "resource_group_name" { | ||
# type = string | ||
# description = "Name of resouce group name" | ||
# default = "s189p01-trsdomains-rg" | ||
# } | ||
|
||
# variable "domains" { | ||
# description = "List of domains record names" | ||
# } | ||
|
||
# variable "environment_tag" { | ||
# type = string | ||
# description = "Environment" | ||
# } | ||
|
||
# variable "environment_short" { | ||
# type = string | ||
# description = "Short name for environment" | ||
# } | ||
|
||
# variable "origin_hostname" { | ||
# type = string | ||
# description = "Origin endpoint url" | ||
# } | ||
|
||
# variable "null_host_header" { | ||
# type = bool | ||
# description = "origin_host_header for the azurerm_cdn_frontdoor_origin" | ||
# default = false | ||
#} | ||
|
||
variable "hosted_zone" { | ||
type = map(any) | ||
default = {} | ||
} | ||
|
||
locals { | ||
hostname = "${var.domains[0]}.${var.zone}" | ||
} | ||
# locals { | ||
# hostname = "${var.domains[0]}.${var.zone}" | ||
# } |