diff --git a/terraform/container-app/.terraform.lock.hcl b/terraform/container-app/.terraform.lock.hcl index ab7a8ae..1c5aeb7 100644 --- a/terraform/container-app/.terraform.lock.hcl +++ b/terraform/container-app/.terraform.lock.hcl @@ -3,9 +3,10 @@ provider "registry.terraform.io/azure/azapi" { version = "1.13.1" - constraints = ">= 1.6.0" + constraints = ">= 1.6.0, >= 1.9.0" hashes = [ "h1:Q10vF78s0i71/CfRYbeoRLAWuJrat2kxIrHK9/yaEYk=", + "h1:gb4dIyLtbw3ctTjZGcb2L/weFP1tzUalf0MKLAh/Bbc=", "zh:1f2aceddd67ceeb82a75c2f15dc01e54781e9aed5968507dbc29590c165b2e2b", "zh:397f0bfbac899d48e23cecf38d362c27562150aa20b19157b5bd370b8e6801ee", "zh:652263b7d00623684e29ef7b8ff285a17c5bd7cc8ba7d22967c66d0b3a3c568a", @@ -21,10 +22,31 @@ provider "registry.terraform.io/azure/azapi" { ] } +provider "registry.terraform.io/hashicorp/azuread" { + version = "2.52.0" + constraints = ">= 2.39.0" + hashes = [ + "h1:BawLlSMcrcY439A6d092jD1+0oHLfy+Ii2EYuLsD9jA=", + "zh:0bc4c67e303164f1b85344bdef25830f093f7bed988a46331858e2e7543df077", + "zh:1c3e89cf19118fc07d7b04257251fc9897e722c16e0a0df7b07fcd261f8c12e7", + "zh:2bc2f80135077016fee0434d0bad68dea197cc1a8b14bc077bacb684fa984701", + "zh:3e1ab7959b40a64e9f481e4375f991cb8e022c82821f4eb63d0920349c9d8190", + "zh:4b26ce0fea4ede6b78c355e15a3ff434f52a032edff8ae061f48225af577373f", + "zh:4ef6581cca562f433747a71e0d2f5b1ae6ea594af9aa6bea31f082e1c24052e1", + "zh:5f34a30f7c62fbd5f9d8b50c1bd7cd8bad7a1a77a0de0a955a4ad2b8c8e9f4c0", + "zh:7cae9b5b1b0d022dbc32efbc7d2cd46b1088319c34f76ca35493887e30c3bbdc", + "zh:b1cc9c0a50d90735b68bdec9f7518441481b6abdc4b10f84a91c92d3cbc30931", + "zh:b265c073a907574c5e434461c00060073825e017b3c8523a1980d959251139af", + "zh:c1685e94fd4fea7d3fd66dd5fad29109f8a9afaa873966c7f60417444397d131", + "zh:eb2584e3300f707f6d795e8dae4f0f6ecf077f47ab9abd4c1b300ea7c55cb154", + ] +} + provider "registry.terraform.io/hashicorp/azurerm" { version = "3.107.0" - constraints = ">= 3.76.0, >= 3.82.0" + constraints = ">= 3.51.0, >= 3.76.0, >= 3.82.0" hashes = [ + "h1:r3R513+QNxWpYvRy1KVnMnXM0aJPW+d3RcOvISRnaUA=", "h1:xA73PuMnVaXxtjTkpTJHE+No2IUDgXB4ELw0iKRiDHQ=", "zh:0a5bfcdef1dad509c4f45c0ada2c8e2cc058cf9542ddec48fbee18c4097bce9e", "zh:0b56736691e4b28ea15b381a4711ff39719ff83a40ce97cd283eb21988f471f6", @@ -45,6 +67,7 @@ provider "registry.terraform.io/hashicorp/null" { version = "3.2.2" constraints = ">= 3.2.1" hashes = [ + "h1:JViWrgF7Ks2GqB6UfcLDUbusXeSfhfhFymo4c0N5e+I=", "h1:m467k2tZ9cdFFgHW7LPBK2GLPH43LC6wc3ppxr8yvoE=", "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7", "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a", @@ -66,6 +89,7 @@ provider "registry.terraform.io/hashicorp/random" { constraints = ">= 3.5.1" hashes = [ "h1:5lstwe/L8AZS/CP0lil2nPvmbbjAu8kCaU/ogSGNbxk=", + "h1:Gd3WitYIzSYo/Suo+PMxpZpIGpRPrwl0JU0+DhxycFM=", "zh:0ef01a4f81147b32c1bea3429974d4d104bbc4be2ba3cfa667031a8183ef88ec", "zh:1bcd2d8161e89e39886119965ef0f37fcce2da9c1aca34263dd3002ba05fcb53", "zh:37c75d15e9514556a5f4ed02e1548aaa95c0ecd6ff9af1119ac905144c70c114", diff --git a/terraform/container-app/key-vault.tf b/terraform/container-app/key-vault.tf index 34eaf63..5838729 100644 --- a/terraform/container-app/key-vault.tf +++ b/terraform/container-app/key-vault.tf @@ -36,73 +36,4 @@ resource "azurerm_key_vault_access_policy" "vault_access_policy_mi" { secret_permissions = ["List", "Get"] key_permissions = ["List", "Get", "WrapKey", "UnwrapKey"] -} - - -resource "azurerm_key_vault_secret" "vault_secret_contentful_deliveryapikey" { - key_vault_id = azurerm_key_vault.vault.id - name = "contentful--deliveryapikey" - value = local.contentful_deliveryapikey - - lifecycle { - ignore_changes = [ - value, - expiration_date - ] - } -} - -resource "azurerm_key_vault_secret" "vault_secret_contentful_previewapikey" { - key_vault_id = azurerm_key_vault.vault.id - name = "contentful--previewapikey" - value = local.contentful_previewapikey - - lifecycle { - ignore_changes = [ - value, - expiration_date - ] - } -} - -resource "azurerm_key_vault_secret" "vault_secret_contentful_spaceid" { - key_vault_id = azurerm_key_vault.vault.id - name = "contentful--spaceid" - value = local.contentful_spaceid - - lifecycle { - ignore_changes = [ - value, - expiration_date - ] - } -} - -resource "azurerm_key_vault_secret" "vault_secret_contentful_environment" { - key_vault_id = azurerm_key_vault.vault.id - name = "contentful--environment" - value = local.contentful_environment - - lifecycle { - ignore_changes = [ - value, - expiration_date - ] - } -} - - -resource "azurerm_key_vault_key" "data_protection_key" { - name = "dataprotection" - key_vault_id = azurerm_key_vault.vault.id - - key_type = var.key_type - key_size = var.key_size - key_opts = var.key_ops - - tags = local.tags - - lifecycle { - ignore_changes = all - } } \ No newline at end of file diff --git a/terraform/container-app/locals.tf b/terraform/container-app/locals.tf index dcd4eab..6915394 100644 --- a/terraform/container-app/locals.tf +++ b/terraform/container-app/locals.tf @@ -8,9 +8,6 @@ locals { azure_location = var.azure_location resource_prefix = "${local.environment}${local.project_name}" resource_group_name = module.main_hosting.azurerm_resource_group_default.name - registry_server = var.registry_server - registry_username = var.registry_username - registry_password = var.registry_password tags = { @@ -31,16 +28,11 @@ locals { #################### user_identity_name = "${local.resource_prefix}-mi" - - ################## # Azure KeyVault # ################## kv_name = "${local.environment}cands-kv" - contentful_deliveryapikey = var.contentful_deliveryapikey - contentful_previewapikey = var.contentful_previewapikey - contentful_spaceid = var.contentful_spaceid - contentful_environment = var.contentful_environment + ################## # CDN/Front Door # ################## diff --git a/terraform/container-app/main-hosting.tf b/terraform/container-app/main-hosting.tf index 0818991..94b72e3 100644 --- a/terraform/container-app/main-hosting.tf +++ b/terraform/container-app/main-hosting.tf @@ -36,11 +36,4 @@ module "main_hosting" { ############## container_apps_infra_subnet_service_endpoints = ["Microsoft.KeyVault"] - ############################# - # Github Container Registry # - ############################# - registry_server = local.registry_server - registry_username = local.registry_username - registry_password = local.registry_password - } diff --git a/terraform/container-app/variables.tf b/terraform/container-app/variables.tf index c7904a0..e9b51df 100644 --- a/terraform/container-app/variables.tf +++ b/terraform/container-app/variables.tf @@ -62,31 +62,6 @@ variable "key_size" { default = 2048 } - -variable "contentful_deliveryapikey" { - description = "Contentful delivery key" - type = string -} - -variable "contentful_previewapikey" { - description = "Contentful preview key" - type = string -} - -variable "contentful_environment" { - description = "Contentful environment" - type = string -} - -variable "contentful_spaceid" { - description = "Contentful space id" - type = string -} - - - - - ####################### # Azure App Container # ####################### @@ -109,29 +84,4 @@ variable "cdn_create_custom_domain" { description = "A flag to create the A and TXT records for the container app as part of setting up the cdn" type = bool default = false -} - - -################### -# Github Registry # -################### - -variable "registry_server" { - description = "Container registry server" - type = string - default = "ghcr.io" -} - -variable "registry_username" { - description = "Container registry username" - type = string - default = "" -} - -variable "registry_password" { - description = "Container registry password" - type = string - default = "" -} - - +} \ No newline at end of file