Skip to content

Commit

Permalink
Custom domains for staging and production
Browse files Browse the repository at this point in the history
Redirect to getintoteaching
  • Loading branch information
saliceti committed Nov 2, 2023
1 parent db4d254 commit fa35054
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 0 deletions.
22 changes: 22 additions & 0 deletions terraform/domains/environment_domains/.terraform.lock.hcl

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"hosted_zone": {
"adviser-getintoteaching.education.gov.uk": {
"front_door_name": "s189p01-tta-dom-fd",
"resource_group_name": "s189p01-tta-dom-rg",
"domains": [
"apex"
],
"environment_short": "pd",
"redirect_rules": [
{
"from-domain": "apex",
"to-domain": "getintoteaching.education.gov.uk",
"to-path": "/teacher-training-adviser/sign_up/identity",
"to-query-string": "utm_source=adviser-getintoteaching.education.gov.uk&utm_medium=referral&utm_campaign=adviser_redirect"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
domains:
source: "https://github.com/DFE-Digital/terraform-modules"
version: "main"
20 changes: 20 additions & 0 deletions terraform/domains/environment_domains/config/staging.tfvars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"hosted_zone": {
"adviser-getintoteaching.education.gov.uk": {
"front_door_name": "s189p01-tta-dom-fd",
"resource_group_name": "s189p01-tta-dom-rg",
"domains": [
"staging"
],
"environment_short": "st",
"redirect_rules": [
{
"from-domain": "staging",
"to-domain": "staging.getintoteaching.education.gov.uk",
"to-path": "/teacher-training-adviser/sign_up/identity",
"to-query-string": "utm_source=staging.adviser-getintoteaching.education.gov.uk&utm_medium=referral&utm_campaign=adviser_redirect"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
domains:
source: "https://github.com/DFE-Digital/terraform-modules"
version: "main"
13 changes: 13 additions & 0 deletions terraform/domains/environment_domains/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Used to create domains to be managed by front door.
module "domains" {
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
null_host_header = try(each.value.null_host_header, false)
cached_paths = try(each.value.cached_paths, [])
redirect_rules = try(each.value.redirect_rules, [])
}
19 changes: 19 additions & 0 deletions terraform/domains/environment_domains/terraform.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
terraform {

required_version = "= 1.5.1"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.62.1"
}
}
backend "azurerm" {
container_name = "terraform-state"
}
}

provider "azurerm" {
features {}

skip_provider_registration = true
}
4 changes: 4 additions & 0 deletions terraform/domains/environment_domains/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "hosted_zone" {
type = map(any)
default = {}
}

0 comments on commit fa35054

Please sign in to comment.