Skip to content

Commit

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

Updated code to create DNS Zone and azure front door
  • Loading branch information
VenkataChalla554 authored Dec 11, 2023
2 parents d8e6029 + 70218fc commit 53acccf
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,16 @@ build:

check-links: build
bundle exec ruby -rhtml-proofer -e "HTMLProofer.check_directory('./build',{:hydra => { :max_concurrency => 1 }}).run"
domains-infra-init: domains composed-variables set-azure-account
./bin/terrafile -p terraform/domains/infrastructure/vendor/modules -f terraform/domains/infrastructure/config/zones_Terrafile

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

domains-infra-plan: domains composed-variables domains-infra-init
terraform -chdir=terraform/domains/infrastructure plan -var-file config/zones.tfvars.json

domains-infra-apply: domains composed-variables domains-infra-init
terraform -chdir=terraform/domains/infrastructure apply -var-file config/zones.tfvars.json ${AUTO_APPROVE}
4 changes: 4 additions & 0 deletions global_config/domains.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AZURE_SUBSCRIPTION=s189-teacher-services-cloud-production
AZURE_RESOURCE_PREFIX=s189p01
CONFIG_SHORT=dom
DISABLE_KEYVAULTS=true
22 changes: 22 additions & 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.

11 changes: 11 additions & 0 deletions terraform/domains/infrastructure/config/zones.tfvars.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"hosted_zone": {
"technical-guidance.education.gov.uk": {
"caa_records": {},
"txt_records": {},
"resource_group_name": "s189p01-techg-dom-rg",
"front_door_name": "s189p01-techg-dom-fd"
}
},
"deploy_default_records": false
}
3 changes: 3 additions & 0 deletions terraform/domains/infrastructure/config/zones_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: "stable"
5 changes: 5 additions & 0 deletions terraform/domains/infrastructure/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module "domains_infrastructure" {
source = "./vendor/modules/domains//domains/infrastructure"
hosted_zone = var.hosted_zone
deploy_default_records = var.deploy_default_records
}
19 changes: 19 additions & 0 deletions terraform/domains/infrastructure/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
}
7 changes: 7 additions & 0 deletions terraform/domains/infrastructure/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
variable "hosted_zone" {
type = map(any)
}

variable "deploy_default_records" {
default = true
}

0 comments on commit 53acccf

Please sign in to comment.