Skip to content

Commit

Permalink
DNS configuration for test and production domains
Browse files Browse the repository at this point in the history
  • Loading branch information
saliceti committed Jul 2, 2024
1 parent db317ae commit 3485540
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"hosted_zone": {
"claim-additional-teaching-payment.service.gov.uk": {
"front_door_name": "s189p01-capt-dom-fd",
"resource_group_name": "s189p01-capt-dom-rg",
"domains": [
"apex"
],
"environment_short": "pd",
"origin_hostname": "s118p01-app-as.azurewebsites.net"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
domains:
source: "https://github.com/DFE-Digital/terraform-modules"
version: "stable"
13 changes: 13 additions & 0 deletions terraform/domains/environment_domains/config/test.tfvars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"hosted_zone": {
"claim-additional-teaching-payment.service.gov.uk": {
"front_door_name": "s189p01-capt-dom-fd",
"resource_group_name": "s189p01-capt-dom-rg",
"domains": [
"test"
],
"environment_short": "ts",
"origin_hostname": "s118t01-app-as.azurewebsites.net"
}
}
}
3 changes: 3 additions & 0 deletions terraform/domains/environment_domains/config/test_Terrafile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
domains:
source: "https://github.com/DFE-Digital/terraform-modules"
version: "testing"
12 changes: 12 additions & 0 deletions terraform/domains/environment_domains/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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
host_name = each.value.origin_hostname
cached_paths = try(each.value.cached_paths, [])
}
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.8.4"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.104.2"
}
}
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 3485540

Please sign in to comment.