Skip to content

Commit

Permalink
Adding targets for RSM migration
Browse files Browse the repository at this point in the history
  • Loading branch information
shaheislamdfe committed Nov 26, 2024
1 parent 1c590d4 commit feb3877
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ tags
fetch_config.rb
bin/terrafile
terraform/application/vendor
terraform/domains/infrastructure/vendor
terraform/domains/environment_domains/vendor

app/assets/builds/*
!app/assets/builds/.keep
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ postgres 13.5
redis 7.0.11
ruby 3.3.0
yarn 1.22.19
terraform 1.6.4
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ domain:
$(eval ENV_SHORT=pd)
$(eval ENV_TAG=prod)

domains:
$(eval include global_config/domains.sh)

ci: ## Run in automation environment
$(eval DISABLE_PASSCODE=true)
$(eval AUTO_APPROVE=-auto-approve)
Expand Down Expand Up @@ -266,6 +269,12 @@ aks-terraform-apply: aks-terraform-init
aks-terraform-destroy: aks-terraform-init
terraform -chdir=terraform/application destroy -var-file "config/${CONFIG}.tfvars.json" ${AUTO_APPROVE}

aks-domain-azure-resources: set-azure-account set-azure-template-tag set-azure-resource-group-tags# make domain domain-azure-resources AUTO_APPROVE=1
$(if $(AUTO_APPROVE), , $(error can only run with AUTO_APPROVE))
az deployment sub create -l "West Europe" --template-uri "https://raw.githubusercontent.com/DFE-Digital/tra-shared-services/${ARM_TEMPLATE_TAG}/azure/resourcedeploy.json" \
--parameters "resourceGroupName=${RESOURCE_NAME_PREFIX}-rsmdomains-rg" 'tags=${RG_TAGS}' "environment=${DEPLOY_ENV}" \
"tfStorageAccountName=${RESOURCE_NAME_PREFIX}rsmdomainstf" "tfStorageContainerName=rsmdomains-tf" "keyVaultName=${RESOURCE_NAME_PREFIX}-rsmdomains-kv"

domains-infra-init: bin/terrafile domains composed-variables set-azure-account
./bin/terrafile -p terraform/domains/infrastructure/vendor/modules -f terraform/domains/infrastructure/config/zones_Terrafile

Expand Down
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/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
Expand Up @@ -5,7 +5,7 @@
"resource_group_name": "s189p01-rsm-dom-rg",
"domains": ["preprod"],
"environment_short": "pp",
"origin_hostname": "refer-serious-misconduct-preprod.test.teacherservices.cloud"
"origin_hostname": "s165t01-rsm-preprod-app.azurewebsites.net"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"to-domain": "refer-serious-misconduct.education.gov.uk"
}
],
"origin_hostname": "refer-serious-misconduct-production.teacherservices.cloud"
"origin_hostname": "s165p01-rsm-production-app.azurewebsites.net"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"resource_group_name": "s189p01-rsm-dom-rg",
"domains": ["test"],
"environment_short": "test",
"origin_hostname": "refer-serious-misconduct-test.test.teacherservices.cloud"
"origin_hostname": "s165t01-rsm-test-app.azurewebsites.net"
}
}
}
2 changes: 0 additions & 2 deletions terraform/domains/environment_domains/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ module "domains" {
domains = each.value.domains
environment = each.value.environment_short
host_name = each.value.origin_hostname
null_host_header = try(each.value.null_host_header, false)
cached_paths = try(each.value.cached_paths, [])
redirect_rules = try(each.value.redirect_rules, [])
}
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.

0 comments on commit feb3877

Please sign in to comment.