Skip to content

Commit

Permalink
Merge pull request #191 from DFE-Digital/760-technical-guidance-migra…
Browse files Browse the repository at this point in the history
…tion-environment-domains

Added changes to environment domains
  • Loading branch information
VenkataChalla554 authored Dec 12, 2023
2 parents 185c954 + 973ffc8 commit f326a40
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,20 @@ domains-infra-plan: domains composed-variables domains-infra-init

domains-infra-apply: domains composed-variables domains-infra-init
terraform -chdir=terraform/domains/infrastructure apply -var-file config/zones.tfvars.json ${AUTO_APPROVE}

domains-init: domains composed-variables set-azure-account
./bin/terrafile -p terraform/domains/environment_domains/vendor/modules -f terraform/domains/environment_domains/config/${CONFIG}_Terrafile

terraform -chdir=terraform/domains/environment_domains init -upgrade -reconfigure \
-backend-config=resource_group_name=${RESOURCE_GROUP_NAME} \
-backend-config=storage_account_name=${STORAGE_ACCOUNT_NAME} \
-backend-config=key=${ENVIRONMENT}.tfstate

domains-plan: domains-init
terraform -chdir=terraform/domains/environment_domains plan -var-file config/${CONFIG}.tfvars.json

domains-apply: domains-init
terraform -chdir=terraform/domains/environment_domains apply -var-file config/${CONFIG}.tfvars.json ${AUTO_APPROVE}

domains-destroy: domains-init
terraform -chdir=terraform/domains/environment_domains destroy -var-file config/${CONFIG}.tfvars.json ${AUTO_APPROVE}
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,13 @@
{
"hosted_zone": {
"technical-guidance.education.gov.uk": {
"front_door_name": "s189p01-techg-dom-fd",
"resource_group_name": "s189p01-techg-dom-rg",
"domains": [
"apex"
],
"environment_short": "pd",
"origin_hostname": "technical-guidance-production.teacherservices.cloud"
}
}
}
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"
11 changes: 11 additions & 0 deletions terraform/domains/environment_domains/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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
}
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.6.4"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.82.0"
}
}
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 f326a40

Please sign in to comment.