From c5616e6b71a867ce8826e561ad9d72813c186af7 Mon Sep 17 00:00:00 2001 From: Manuel Rafeli Date: Thu, 11 Apr 2024 17:11:30 +0200 Subject: [PATCH] chore: Migration uat using terraform ca module with suffix (#290) --- helm/pnpg/values-uat.yaml | 2 +- helm/values-uat.yaml | 2 +- infra/container_apps/README.md | 1 + .../env/uat-pnpg/terraform.tfvars | 28 +++++++++---------- infra/container_apps/env/uat/terraform.tfvars | 24 ++++++++-------- infra/container_apps/locals.tf | 1 + infra/container_apps/main.tf | 1 + infra/container_apps/variables.tf | 6 ++++ 8 files changed, 37 insertions(+), 28 deletions(-) diff --git a/helm/pnpg/values-uat.yaml b/helm/pnpg/values-uat.yaml index 1f182eb0..bb831e87 100644 --- a/helm/pnpg/values-uat.yaml +++ b/helm/pnpg/values-uat.yaml @@ -29,4 +29,4 @@ configEnvSpecific: APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL: "OFF" B4F_ONBOARDING_LOG_LEVEL: "DEBUG" REST_CLIENT_LOGGER_LEVEL: "FULL" - MS_ONBOARDING_URL: "https://selc-u-pnpg-onboarding-ms-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" \ No newline at end of file + MS_ONBOARDING_URL: "https://selc-u-pnpg-onboarding-ms-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" \ No newline at end of file diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index d87bc6d2..62b2a5e0 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -40,5 +40,5 @@ configEnvSpecific: APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL: "OFF" B4F_ONBOARDING_LOG_LEVEL: "DEBUG" REST_CLIENT_LOGGER_LEVEL: "FULL" - MS_ONBOARDING_URL: "https://selc-u-onboarding-ms-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" + MS_ONBOARDING_URL: "https://selc-u-onboarding-ms-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io" ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS: "{'prod-interop':{'*'},'prod-pn':{'*'},'prod-io':{'*'},'prod-io-premium':{'*'},'prod-pagopa':{'*'},'prod-pn-coll':{'*'},'prod-fd':{'*'},'prod-fd-garantito':{'*'},'prod-io-sign':{'*'},'prod-pn-dev':{'*'},'prod-sendino':{'*'}}" diff --git a/infra/container_apps/README.md b/infra/container_apps/README.md index beb984a6..e2aa4111 100644 --- a/infra/container_apps/README.md +++ b/infra/container_apps/README.md @@ -44,6 +44,7 @@ Deploy container on a Container App instance. | [is\_pnpg](#input\_is\_pnpg) | (Optional) True if you want to apply changes to PNPG environment | `bool` | `false` | no | | [private\_dns\_name](#input\_private\_dns\_name) | Container Apps private DNS record | `string` | n/a | yes | | [secrets\_names](#input\_secrets\_names) | KeyVault secrets to get values from | `map(string)` | n/a | yes | +| [suffix\_increment](#input\_suffix\_increment) | Suffix increment Container App Environment name | `string` | `""` | no | | [tags](#input\_tags) | n/a | `map(any)` | n/a | yes | | [workload\_profile\_name](#input\_workload\_profile\_name) | Workload Profile name to use | `string` | `null` | no | diff --git a/infra/container_apps/env/uat-pnpg/terraform.tfvars b/infra/container_apps/env/uat-pnpg/terraform.tfvars index 29cae149..f405f8aa 100644 --- a/infra/container_apps/env/uat-pnpg/terraform.tfvars +++ b/infra/container_apps/env/uat-pnpg/terraform.tfvars @@ -1,11 +1,11 @@ -is_pnpg = true -env_short = "u" -private_dns_name = "selc-u-pnpg-onboardingbackend-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" -dns_zone_prefix = "imprese.uat.notifichedigitali" -api_dns_zone_prefix = "api-pnpg.uat.selfcare" -external_domain = "it" -cae_name = "cae" -workload_profile_name = "Consumption" +is_pnpg = true +env_short = "u" +private_dns_name = "selc-u-pnpg-onboardingbackend-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" +dns_zone_prefix = "imprese.uat.notifichedigitali" +api_dns_zone_prefix = "api-pnpg.uat.selfcare" +external_domain = "it" +suffix_increment = "-001" +cae_name = "cae-001" tags = { CreatedBy = "Terraform" @@ -46,7 +46,7 @@ app_settings = [ }, { name = "MS_ONBOARDING_URL" - value = "https://selc-u-pnpg-onboarding-ms-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io", + value = "https://selc-u-pnpg-onboarding-ms-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io", }, { name = "ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS" @@ -54,23 +54,23 @@ app_settings = [ }, { name = "MS_CORE_URL" - value = "https://selc-u-pnpg-ms-core-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" + value = "https://selc-u-pnpg-ms-core-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" }, { name = "MS_EXTERNAL_INTERCEPTOR_URL" - value = "https://selc-u-pnpg-ext-interceptor-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" + value = "https://selc-u-pnpg-ext-interceptor-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" }, { name = "USERVICE_PARTY_PROCESS_URL" - value = "https://selc-u-pnpg-ms-core-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" + value = "https://selc-u-pnpg-ms-core-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" }, { name = "USERVICE_PARTY_REGISTRY_PROXY_URL" - value = "https://selc-u-pnpg-party-reg-proxy-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" + value = "https://selc-u-pnpg-party-reg-proxy-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" }, { name = "MS_PRODUCT_URL" - value = "https://selc-u-pnpg-product-ca.calmforest-ffe47bf1.westeurope.azurecontainerapps.io" + value = "https://selc-u-pnpg-product-ca.orangeground-0bd2d4dc.westeurope.azurecontainerapps.io" }, { name = "USERVICE_USER_REGISTRY_URL" diff --git a/infra/container_apps/env/uat/terraform.tfvars b/infra/container_apps/env/uat/terraform.tfvars index ea97a271..17ae577d 100644 --- a/infra/container_apps/env/uat/terraform.tfvars +++ b/infra/container_apps/env/uat/terraform.tfvars @@ -1,9 +1,9 @@ -env_short = "u" -private_dns_name = "selc-u-onboardingbackend-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" -dns_zone_prefix = "uat.selfcare" -api_dns_zone_prefix = "api.uat.selfcare" -cae_name = "cae" -workload_profile_name = "Consumption" +env_short = "u" +private_dns_name = "selc-u-onboardingbackend-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io" +dns_zone_prefix = "uat.selfcare" +api_dns_zone_prefix = "api.uat.selfcare" +suffix_increment = "-001" +cae_name = "cae-001" tags = { CreatedBy = "Terraform" @@ -44,7 +44,7 @@ app_settings = [ }, { name = "MS_ONBOARDING_URL" - value = "https://selc-u-onboarding-ms-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io", + value = "https://selc-u-onboarding-ms-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io", }, { name = "ONBOARDING_ALLOWED_INSTITUTIONS_PRODUCTS" @@ -52,23 +52,23 @@ app_settings = [ }, { name = "MS_CORE_URL" - value = "https://selc-u-ms-core-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" + value = "https://selc-u-ms-core-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io" }, { name = "MS_EXTERNAL_INTERCEPTOR_URL" - value = "https://selc-u-ext-interceptor-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" + value = "http://selc.internal.uat.selfcare.pagopa.it/ms-external-interceptor/v1" }, { name = "USERVICE_PARTY_PROCESS_URL" - value = "https://selc-u-ms-core-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" + value = "https://selc-u-ms-core-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io" }, { name = "USERVICE_PARTY_REGISTRY_PROXY_URL" - value = "https://selc-u-party-reg-proxy-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" + value = "https://selc-u-party-reg-proxy-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io" }, { name = "MS_PRODUCT_URL" - value = "https://selc-u-product-ca.agreeablesky-f71e6306.westeurope.azurecontainerapps.io" + value = "https://selc-u-product-ca.proudglacier-20652b81.westeurope.azurecontainerapps.io" }, { name = "USERVICE_USER_REGISTRY_URL" diff --git a/infra/container_apps/locals.tf b/infra/container_apps/locals.tf index 919eaef8..167de2c5 100644 --- a/infra/container_apps/locals.tf +++ b/infra/container_apps/locals.tf @@ -3,4 +3,5 @@ locals { project = "selc-${var.env_short}" container_app_environment_name = "${local.project}${local.pnpg_suffix}-${var.cae_name}" + ca_resource_group_name = "${local.project}-container-app${var.suffix_increment}-rg" } \ No newline at end of file diff --git a/infra/container_apps/main.tf b/infra/container_apps/main.tf index 03370b73..bf485b75 100644 --- a/infra/container_apps/main.tf +++ b/infra/container_apps/main.tf @@ -14,6 +14,7 @@ module "container_app_onboarding_backend" { is_pnpg = var.is_pnpg env_short = var.env_short + resource_group_name = local.ca_resource_group_name container_app = var.container_app container_app_name = "onboardingbackend" container_app_environment_name = local.container_app_environment_name diff --git a/infra/container_apps/variables.tf b/infra/container_apps/variables.tf index 14c94d61..977b7e63 100644 --- a/infra/container_apps/variables.tf +++ b/infra/container_apps/variables.tf @@ -89,3 +89,9 @@ variable "cae_name" { description = "Container App Environment name" default = "cae-cp" } + +variable "suffix_increment" { + type = string + description = "Suffix increment Container App Environment name" + default = "" +}