Skip to content

chore: switched db connection from managed identity to connection string#635

Merged
silvicir merged 1 commit intomasterfrom
move-to-cosmos-account-connection-string
Jan 5, 2026
Merged

chore: switched db connection from managed identity to connection string#635
silvicir merged 1 commit intomasterfrom
move-to-cosmos-account-connection-string

Conversation

@silvicir
Copy link
Contributor

@silvicir silvicir commented Jan 5, 2026

No description provided.

@silvicir silvicir requested review from a team as code owners January 5, 2026 11:19
@silvicir silvicir requested review from LazyAfternoons and hevelius and removed request for a team January 5, 2026 11:19
@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

Tip

✅ All Terraform module locks are up to date

No module changes detected - everything is in sync!

📋 Pre-commit Output Log
[INFO] Initializing environment for https://github.com/pagopa/dx.
[INFO] Initializing environment for https://github.com/antonbabenko/pre-commit-terraform.
Lock Terraform Registry modules..........................................Passed

Generated on Mon Jan 5 11:20:35 UTC 2026
Run lock_modules on folder: infra/resources/prod/

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2026

📖 Terraform Plan (infra/resources/prod) - success

Show Plan
  # azurerm_api_management_api_policy.wallet_support will be updated in-place
  ~ resource "azurerm_api_management_api_policy" "wallet_support" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/apis/wallet-support-api-v1"
      ~ xml_content         = <<-EOT
          - <policies>
          - 	<inbound>
          - 		<include-fragment fragment-id="io-wallet-app-session-fragment" />
          - 		<base />
          - 		<rewrite-uri template="@("/api/wallet/v1/" + context.Request.Url.Path)" />
          - 		<set-backend-service backend-id="psn-backend-01" />
          - 	</inbound>
          - 	<backend>
          - 		<base />
          - 	</backend>
          - 	<outbound>
          - 		<base />
          - 	</outbound>
          - 	<on-error>
          - 		<base />
          - 	</on-error>
          + <policies>
          +   <inbound>
          +       <base />
          +       <rewrite-uri template="@("/api/wallet/support/v1/" + context.Request.Url.Path)" />
          +       <set-backend-service backend-id="psn-backend-01" />
          +   </inbound>
            </policies>
        EOT
        # (3 unchanged attributes hidden)
    }

  # azurerm_api_management_api_policy.wallet_support_legacy will be updated in-place
  ~ resource "azurerm_api_management_api_policy" "wallet_support_legacy" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/apis/wallet-support-api-legacy"
      ~ xml_content         = <<-EOT
          - <policies>
          - 	<inbound>
          - 		<include-fragment fragment-id="io-wallet-app-session-fragment" />
          - 		<base />
          - 		<rewrite-uri template="@("/api/wallet/support/v1/" + context.Request.Url.Path)" />
          - 		<set-backend-service backend-id="psn-backend-01" />
          - 	</inbound>
          - 	<backend>
          - 		<base />
          - 	</backend>
          - 	<outbound>
          - 		<base />
          - 	</outbound>
          - 	<on-error>
          - 		<base />
          - 	</on-error>
          + <policies>
          +   <inbound>
          +       <base />
          +       <rewrite-uri template="@("/api/wallet/support/v1/" + context.Request.Url.Path)" />
          +       <set-backend-service backend-id="psn-backend-01" />
          +   </inbound>
            </policies>
        EOT
        # (3 unchanged attributes hidden)
    }

  # azurerm_api_management_api_policy.wallet_user will be updated in-place
  ~ resource "azurerm_api_management_api_policy" "wallet_user" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/apis/wallet-user-api-v1"
      ~ xml_content         = <<-EOT
          - <policies>
          - 	<inbound>
          - 		<include-fragment fragment-id="io-wallet-app-session-fragment" />
          - 		<base />
          - 		<rewrite-uri template="@("/api/wallet/v1/" + context.Request.Url.Path)" />
          - 		<set-backend-service backend-id="psn-backend-01" />
          - 	</inbound>
          - 	<backend>
          - 		<base />
          - 	</backend>
          - 	<outbound>
          - 		<base />
          - 	</outbound>
          - 	<on-error>
          - 		<base />
          - 	</on-error>
          + <policies>
          +   <inbound>
          +       <include-fragment fragment-id="io-wallet-app-session-fragment" />
          +       <base />
          +       <rewrite-uri template="@("/api/wallet/v1/" + context.Request.Url.Path)" />
          +       <set-backend-service backend-id="psn-backend-01" />
          +   </inbound>
            </policies>
        EOT
        # (3 unchanged attributes hidden)
    }

  # azurerm_api_management_api_policy.wallet_user_legacy will be updated in-place
  ~ resource "azurerm_api_management_api_policy" "wallet_user_legacy" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/apis/wallet-user-api-legacy"
      ~ xml_content         = <<-EOT
          - <policies>
          - 	<inbound>
          - 		<include-fragment fragment-id="io-wallet-app-session-fragment" />
          - 		<base />
          - 		<rewrite-uri template="@("/api/wallet/v1/" + context.Request.Url.Path)" />
          - 		<set-backend-service backend-id="psn-backend-01" />
          - 	</inbound>
          - 	<backend>
          - 		<base />
          - 	</backend>
          - 	<outbound>
          - 		<base />
          - 	</outbound>
          - 	<on-error>
          - 		<base />
          - 	</on-error>
          + <policies>
          +   <inbound>
          +       <include-fragment fragment-id="io-wallet-app-session-fragment" />
          +       <base />
          +       <rewrite-uri template="@("/api/wallet/v1/" + context.Request.Url.Path)" />
          +       <set-backend-service backend-id="psn-backend-01" />
          +   </inbound>
            </policies>
        EOT
        # (3 unchanged attributes hidden)
    }

  # azurerm_api_management_api_policy.wallet_user_uat will be updated in-place
  ~ resource "azurerm_api_management_api_policy" "wallet_user_uat" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/apis/wallet-user-api-uat"
      ~ xml_content         = <<-EOT
          - <!--
          -     - Policies are applied in the order they appear.
          -     - Position <base/> inside a section to inherit policies from the outer scope.
          -     - Comments within policies are not preserved.
          - -->
          - <!-- Add policies as children to the <inbound>, <outbound>, <backend>, and <on-error> elements -->
          - <policies>
          - 	<!-- Throttle, authorize, validate, cache, or transform the requests -->
          - 	<inbound>
          - 		<include-fragment fragment-id="io-wallet-app-session-fragment" />
          - 		<base />
          - 		<rewrite-uri template="@("/api/wallet/uat/" + context.Request.Url.Path)" />
          - 		<set-backend-service backend-id="psn-backend-01" />
          - 	</inbound>
          - 	<!-- Control if and how the requests are forwarded to services  -->
          - 	<backend>
          - 		<base />
          - 	</backend>
          - 	<!-- Customize the responses -->
          - 	<outbound>
          - 		<base />
          - 	</outbound>
          - 	<!-- Handle exceptions and customize error responses  -->
          - 	<on-error>
          - 		<base />
          - 	</on-error>
          + <policies>
          +   <inbound>
          +       <include-fragment fragment-id="io-wallet-app-session-fragment" />
          +       <base />
          +       <rewrite-uri template="@("/api/wallet/uat/" + context.Request.Url.Path)" />
          +       <set-backend-service backend-id="psn-backend-01" />
          +   </inbound>
            </policies>
        EOT
        # (3 unchanged attributes hidden)
    }

  # azurerm_api_management_api_policy.wallet_user_uat_legacy will be updated in-place
  ~ resource "azurerm_api_management_api_policy" "wallet_user_uat_legacy" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/apis/wallet-user-uat-api-legacy"
      ~ xml_content         = <<-EOT
          - <!--
          -     - Policies are applied in the order they appear.
          -     - Position <base/> inside a section to inherit policies from the outer scope.
          -     - Comments within policies are not preserved.
          - -->
          - <!-- Add policies as children to the <inbound>, <outbound>, <backend>, and <on-error> elements -->
          - <policies>
          - 	<!-- Throttle, authorize, validate, cache, or transform the requests -->
          - 	<inbound>
          - 		<include-fragment fragment-id="io-wallet-app-session-fragment" />
          - 		<base />
          - 		<rewrite-uri template="@("/api/wallet/uat/" + context.Request.Url.Path)" />
          - 		<set-backend-service backend-id="psn-backend-01" />
          - 	</inbound>
          - 	<!-- Control if and how the requests are forwarded to services  -->
          - 	<backend>
          - 		<base />
          - 	</backend>
          - 	<!-- Customize the responses -->
          - 	<outbound>
          - 		<base />
          - 	</outbound>
          - 	<!-- Handle exceptions and customize error responses  -->
          - 	<on-error>
          - 		<base />
          - 	</on-error>
          + <policies>
          +   <inbound>
          +       <include-fragment fragment-id="io-wallet-app-session-fragment" />
          +       <base />
          +       <rewrite-uri template="@("/api/wallet/uat/" + context.Request.Url.Path)" />
          +       <set-backend-service backend-id="psn-backend-01" />
          +   </inbound>
            </policies>
        EOT
        # (3 unchanged attributes hidden)
    }

  # azurerm_api_management_backend.psn will be updated in-place
  ~ resource "azurerm_api_management_backend" "psn" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.ApiManagement/service/io-p-itn-platform-api-gateway-apim-01/backends/psn-backend-01"
        name                = "psn-backend-01"
        # (7 unchanged attributes hidden)

      - credentials {
          - certificate = [] -> null
          - header      = {} -> null
          - query       = {} -> null
        }

      - tls {
          - validate_certificate_chain = false -> null
          - validate_certificate_name  = false -> null
        }
    }

  # azurerm_private_dns_a_record.api_internal_wallet_io_pagopa_it will be updated in-place
  ~ resource "azurerm_private_dns_a_record" "api_internal_wallet_io_pagopa_it" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Network/privateDnsZones/internal.wallet.io.pagopa.it/A/api"
        name                = "api"
      ~ tags                = {
          - "BusinessUnit"   = "IT Wallet" -> null
          - "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI" -> null
          - "CreatedBy"      = "Terraform" -> null
          - "Environment"    = "Prod" -> null
          - "ManagementTeam" = "IO Wallet" -> null
          - "Source"         = "https://github.com/pagopa/io-wallet/blob/main/infra/core/pagopa/prod" -> null
        }
      ~ ttl                 = 3600 -> 10
        # (4 unchanged attributes hidden)
    }

  # module.storage_accounts.azurerm_storage_container.cosmos_01_backup will be destroyed
  # (because azurerm_storage_container.cosmos_01_backup is not in configuration)
  - resource "azurerm_storage_container" "cosmos_01_backup" {
      - container_access_type             = "private" -> null
      - default_encryption_scope          = "$account-encryption-key" -> null
      - encryption_scope_override_enabled = true -> null
      - has_immutability_policy           = false -> null
      - has_legal_hold                    = false -> null
      - id                                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01/blobServices/default/containers/cosmos-01-backup" -> null
      - metadata                          = {} -> null
      - name                              = "cosmos-01-backup" -> null
      - resource_manager_id               = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01/blobServices/default/containers/cosmos-01-backup" -> null
      - storage_account_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01" -> null
        # (1 unchanged attribute hidden)
    }

  # module.storage_accounts.azurerm_storage_container.input will be destroyed
  # (because azurerm_storage_container.input is not in configuration)
  - resource "azurerm_storage_container" "input" {
      - container_access_type             = "private" -> null
      - default_encryption_scope          = "$account-encryption-key" -> null
      - encryption_scope_override_enabled = true -> null
      - has_immutability_policy           = false -> null
      - has_legal_hold                    = false -> null
      - id                                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01/blobServices/default/containers/input" -> null
      - metadata                          = {} -> null
      - name                              = "input" -> null
      - resource_manager_id               = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01/blobServices/default/containers/input" -> null
      - storage_account_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01" -> null
        # (1 unchanged attribute hidden)
    }

  # module.storage_accounts.azurerm_storage_container.output will be destroyed
  # (because azurerm_storage_container.output is not in configuration)
  - resource "azurerm_storage_container" "output" {
      - container_access_type             = "private" -> null
      - default_encryption_scope          = "$account-encryption-key" -> null
      - encryption_scope_override_enabled = true -> null
      - has_immutability_policy           = false -> null
      - has_legal_hold                    = false -> null
      - id                                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01/blobServices/default/containers/output" -> null
      - metadata                          = {} -> null
      - name                              = "output" -> null
      - resource_manager_id               = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01/blobServices/default/containers/output" -> null
      - storage_account_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Storage/storageAccounts/iopitnwalletst01" -> null
        # (1 unchanged attribute hidden)
    }

  # module.function_apps.module.function_app_user.azurerm_linux_function_app.this will be updated in-place
  ~ resource "azurerm_linux_function_app" "this" {
      ~ app_settings                                   = {
          + "CosmosAccountConnectionString"                                                                    = "CosmosAccountConnectionString"
            # (75 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Web/sites/io-p-itn-wallet-user-func-02"
        name                                           = "io-p-itn-wallet-user-func-02"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO Wallet"
            "ModuleName"                                     = "azure_function_app"
            "ModuleSource"                                   = "DX"
            "ModuleVersion"                                  = "4.1.1"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-wallet/blob/main/infra/resources/prod"
            "hidden-link: /app-insights-conn-string"         = "[REDACTED]"
            "hidden-link: /app-insights-instrumentation-key" = "[REDACTED]"
            "hidden-link: /app-insights-resource-id"         = "[REDACTED]"
        }
        # (33 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.function_apps.module.function_app_user.azurerm_linux_function_app_slot.this[0] will be updated in-place
  ~ resource "azurerm_linux_function_app_slot" "this" {
      ~ app_settings                                   = {
          + "CosmosAccountConnectionString"                                                                    = "CosmosAccountConnectionString"
            # (76 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Web/sites/io-p-itn-wallet-user-func-02/slots/staging"
        name                                           = "staging"
        tags                                           = {
            "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"      = "Terraform"
            "Environment"    = "Prod"
            "ManagementTeam" = "IO Wallet"
            "ModuleName"     = "azure_function_app"
            "ModuleSource"   = "DX"
            "ModuleVersion"  = "4.1.1"
            "Owner"          = "IO"
            "Source"         = "https://github.com/pagopa/io-wallet/blob/main/infra/resources/prod"
        }
        # (31 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # module.function_apps.module.function_app_user_uat.azurerm_linux_function_app.this will be updated in-place
  ~ resource "azurerm_linux_function_app" "this" {
      ~ app_settings                                   = {
          + "CosmosAccountConnectionString"                                                                    = "foo"
            # (75 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Web/sites/io-u-itn-wallet-user-func-01"
        name                                           = "io-u-itn-wallet-user-func-01"
        tags                                           = {
            "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"      = "Terraform"
            "Environment"    = "Prod"
            "ManagementTeam" = "IO Wallet"
            "ModuleName"     = "azure_function_app"
            "ModuleSource"   = "DX"
            "ModuleVersion"  = "4.1.1"
            "Owner"          = "IO"
            "Source"         = "https://github.com/pagopa/io-wallet/blob/main/infra/resources/prod"
        }
        # (33 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # module.function_apps.module.function_app_user_uat.azurerm_linux_function_app_slot.this[0] will be updated in-place
  ~ resource "azurerm_linux_function_app_slot" "this" {
      ~ app_settings                                   = {
          + "CosmosAccountConnectionString"                                                                    = "foo"
            # (76 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-wallet-rg-01/providers/Microsoft.Web/sites/io-u-itn-wallet-user-func-01/slots/staging"
        name                                           = "staging"
        tags                                           = {
            "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"      = "Terraform"
            "Environment"    = "Prod"
            "ManagementTeam" = "IO Wallet"
            "ModuleName"     = "azure_function_app"
            "ModuleSource"   = "DX"
            "ModuleVersion"  = "4.1.1"
            "Owner"          = "IO"
            "Source"         = "https://github.com/pagopa/io-wallet/blob/main/infra/resources/prod"
        }
        # (31 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

Plan: 0 to add, 12 to change, 3 to destroy.

Warning: Argument is deprecated

  with module.storage_accounts.azurerm_storage_queue.wallet-instance-creation-email-queue-01,
  on ../_modules/storage_accounts/storage_queue.tf line 3, in resource "azurerm_storage_queue" "wallet-instance-creation-email-queue-01":
   3:   storage_account_name = azurerm_storage_account.common.name

the `storage_account_name` property has been deprecated in favour of
`storage_account_id` and will be removed in version 5.0 of the Provider.

(and 3 more similar warnings elsewhere)

@silvicir silvicir merged commit 744c896 into master Jan 5, 2026
10 checks passed
@silvicir silvicir deleted the move-to-cosmos-account-connection-string branch January 5, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants