-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3566 from DFE-Digital/deploy-aks-review-app
Add AKS review app terraform
- Loading branch information
Showing
12 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
locals { | ||
environment = "${var.environment}${var.pr_number}" | ||
} | ||
|
||
module "application_configuration" { | ||
source = "./vendor/modules/aks//aks/application_configuration" | ||
|
||
namespace = var.namespace | ||
environment = local.environment | ||
azure_resource_prefix = var.azure_resource_prefix | ||
service_short = var.service_short | ||
config_short = var.config_short | ||
secret_key_vault_short = "app" | ||
|
||
# Delete for non rails apps | ||
is_rails_application = true | ||
|
||
config_variables = { | ||
PGSSLMODE = local.postgres_ssl_mode | ||
} | ||
secret_variables = { | ||
DATABASE_URL = module.postgres.url | ||
REDIS_URL = module.redis-cache.url | ||
# below added from paas config | ||
HTTPAUTH_PASSWORD = module.infrastructure_secrets.map.HTTP-PASSWORD, | ||
HTTPAUTH_USERNAME = module.infrastructure_secrets.map.HTTP-USERNAME, | ||
BASIC_AUTH = var.basic_auth, | ||
APP_URL = length(var.paas_asset_hostnames) == 0 ? "" : "https://${var.paas_internet_hostnames[0]}.education.gov.uk", | ||
# keeping here as a reminder, but went be set in aks and need to confirm impact | ||
APP_ASSETS_URL = length(var.paas_asset_hostnames) == 0 ? "" : "https://${var.paas_asset_hostnames[0]}.education.gov.uk" | ||
} | ||
} | ||
|
||
module "web_application" { | ||
source = "./vendor/modules/aks//aks/application" | ||
|
||
is_web = true | ||
|
||
namespace = var.namespace | ||
environment = local.environment | ||
service_name = var.service_name | ||
probe_path = "/check" | ||
command = var.command | ||
|
||
cluster_configuration_map = module.cluster_data.configuration_map | ||
kubernetes_config_map_name = module.application_configuration.kubernetes_config_map_name | ||
kubernetes_secret_name = module.application_configuration.kubernetes_secret_name | ||
|
||
docker_image = var.docker_image | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module "postgres" { | ||
source = "./vendor/modules/aks//aks/postgres" | ||
|
||
namespace = var.namespace | ||
environment = local.environment | ||
azure_resource_prefix = var.azure_resource_prefix | ||
service_name = var.service_name | ||
service_short = var.service_short | ||
config_short = var.config_short | ||
cluster_configuration_map = module.cluster_data.configuration_map | ||
use_azure = var.deploy_azure_backing_services | ||
azure_enable_monitoring = var.enable_monitoring | ||
azure_enable_backup_storage = var.enable_postgres_backup_storage | ||
server_version = "14" | ||
} | ||
|
||
|
||
module "redis-cache" { | ||
source = "./vendor/modules/aks//aks/redis" | ||
|
||
namespace = var.namespace | ||
environment = local.environment | ||
azure_resource_prefix = var.azure_resource_prefix | ||
service_short = var.service_short | ||
config_short = var.config_short | ||
service_name = var.service_name | ||
cluster_configuration_map = module.cluster_data.configuration_map | ||
use_azure = var.deploy_azure_backing_services | ||
azure_enable_monitoring = var.enable_monitoring | ||
azure_patch_schedule = [{ "day_of_week" : "Sunday", "start_hour_utc" : 01 }] | ||
server_version = "6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "url" { | ||
value = module.web_application.url | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module "infrastructure_secrets" { | ||
source = "./vendor/modules/aks//aks/secrets" | ||
|
||
azure_resource_prefix = var.azure_resource_prefix | ||
service_short = var.service_short | ||
config_short = var.config_short | ||
key_vault_short = "inf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module "statuscake" { | ||
count = var.enable_monitoring ? 1 : 0 | ||
|
||
source = "./vendor/modules/aks//monitoring/statuscake" | ||
|
||
uptime_urls = compact([module.web_application.probe_url, var.external_url]) | ||
ssl_urls = compact([var.external_url]) | ||
|
||
contact_groups = var.statuscake_contact_groups | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters