Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1707 new trs domains #1295

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ domains-infra-init: bin/terrafile set-azure-pd-subscription ## make [domain|aks_
domains-infra-plan: domains-infra-init ## terraform plan for dns core resources
terraform -chdir=terraform/domains/infrastructure plan -var-file config/trs.tfvars.json

domains-infra-apply: domains-infra-init ## terraform apply for dns core resources
terraform -chdir=terraform/domains/infrastructure apply -var-file config/trs.tfvars.json

domain-azure-resources: set-azure-account # make [domain|aks_domain] domain-azure-resources CONFIRM_DEPLOY=1, creates core DNA/AKS
$(if $(CONFIRM_DEPLOY), , $(error can only run with CONFIRM_DEPLOY))
az deployment sub create -l "UK South" --template-uri "https://raw.githubusercontent.com/DFE-Digital/tra-shared-services/main/azure/resourcedeploy.json" --parameters "resourceGroupName=${RESOURCE_NAME_PREFIX}-trsdomains-rg" 'tags=${RG_TAGS}' "tfStorageAccountName=${RESOURCE_NAME_PREFIX}trsdomainstf" "tfStorageContainerName=trsdomains-tf" "keyVaultName=${RESOURCE_NAME_PREFIX}-trsdomain-kv"
Expand Down
33 changes: 29 additions & 4 deletions terraform/domains/environment_domains/config/dev.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
{
"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"
],
"environment_short": "dv",
"origin_hostname": "trs-dev-api.test.teacherservices.cloud"
},
"authorise-access-to-a-teaching-record.education.gov.uk": {
"front_door_name": "s189p01-trsdomains1-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"dev"
],
"environment_short": "dv",
"origin_hostname": "trs-dev-authz.test.teacherservices.cloud"
},
"teaching-record-system.education.gov.uk": {
"front_door_name": "s189p01-trsdomains2-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"dev"
],
"environment_short": "dv",
"origin_hostname": "trs-dev-ui.test.teacherservices.cloud"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
{
"domains": ["preprod"],
"environment_short": "pp",
"environment_tag": "pre-prod",
"origin_hostname": "trs-pre-production-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": [
"preprod"
],
"environment_short": "pp",
"origin_hostname": "trs-pre-production-api.test.teacherservices.cloud"
},
"authorise-access-to-a-teaching-record.education.gov.uk": {
"front_door_name": "s189p01-trsdomains1-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"preprod"
],
"environment_short": "pp",
"origin_hostname": "trs-pre-production-authz.test.teacherservices.cloud"
},
"teaching-record-system.education.gov.uk": {
"front_door_name": "s189p01-trsdomains2-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"preprod"
],
"environment_short": "pp",
"origin_hostname": "trs-pre-production-ui.test.teacherservices.cloud"
}
}
}
34 changes: 24 additions & 10 deletions terraform/domains/environment_domains/config/production.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
{
"domains": ["apex"],
"environment_short": "pd",
"environment_tag": "Prod",
"origin_hostname": "trs-production-api.teacherservices.cloud",
"hosted_zone": {
"teacher-qualifications-api.education.gov.uk": {
"front_door_name": "s189p01-trsdomains-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"cnames": {
"_e61158082e6141e3ddafd7ec187d748b": {
"target": "_9d03d335ceca11fa14a00b153bb52ae2.bgpjyrktby.acm-validations.aws",
"ttl": 86400
}
}
"domains": [
"apex"
],
"environment_short": "pd",
"origin_hostname": "trs-production-api.teacherservices.cloud"
},
"authorise-access-to-a-teaching-record.education.gov.uk": {
"front_door_name": "s189p01-trsdomains1-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"apex"
],
"environment_short": "pd",
"origin_hostname": "trs-production-authz.teacherservices.cloud"
},
"teaching-record-system.education.gov.uk": {
"front_door_name": "s189p01-trsdomains2-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"apex"
],
"environment_short": "pd",
"origin_hostname": "trs-production-ui.teacherservices.cloud"
}
}
}
33 changes: 29 additions & 4 deletions terraform/domains/environment_domains/config/test.tfvars.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
{
"domains": ["test"],
"environment_short": "ts",
"environment_tag": "test",
"origin_hostname": "trs-test-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": [
"test"
],
"environment_short": "ts",
"origin_hostname": "trs-test-api.test.teacherservices.cloud"
},
"authorise-access-to-a-teaching-record.education.gov.uk": {
"front_door_name": "s189p01-trsdomains1-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"test"
],
"environment_short": "ts",
"origin_hostname": "trs-test-authz.test.teacherservices.cloud"
},
"teaching-record-system.education.gov.uk": {
"front_door_name": "s189p01-trsdomains2-fd",
"resource_group_name": "s189p01-trsdomains-rg",
"domains": [
"test"
],
"environment_short": "ts",
"origin_hostname": "trs-test-ui.test.teacherservices.cloud"
}
}
}
21 changes: 8 additions & 13 deletions terraform/domains/environment_domains/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
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

for_each = var.hosted_zone
source = "./vendor/modules/domains//domains/environment_domains"
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
}
47 changes: 0 additions & 47 deletions terraform/domains/environment_domains/variables.tf
Original file line number Diff line number Diff line change
@@ -1,51 +1,4 @@
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}"
}
1 change: 1 addition & 0 deletions terraform/domains/infrastructure/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions terraform/domains/infrastructure/config/trs.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@
"value": "v=DMARC1;p=quarantine;sp=quarantine;pct=100;fo=1;rua=mailto:[email protected],mailto:[email protected];ruf=mailto:[email protected]"
}
}
},
"authorise-access-to-a-teaching-record.education.gov.uk": {
"resource_group_name": "s189p01-trsdomains-rg",
"front_door_name": "s189p01-trsdomains1-fd",
"caa_records": {},
"txt_records": {}
},
"teaching-record-system.education.gov.uk": {
"resource_group_name": "s189p01-trsdomains-rg",
"front_door_name": "s189p01-trsdomains2-fd",
"caa_records": {},
"txt_records": {}
}
},
"tags": {
Expand Down
Loading