Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CES-484] Added new storage account iopstapi for ITN migration #57

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

cfcuffari120400
Copy link

@cfcuffari120400 cfcuffari120400 commented Nov 7, 2024

Motivation and Context

Storage accounts must be replicated to italy north in view of the infrastructure migration

Major Changes

Create replication of iopstapi in italy north

Dependencies

Testing

Documentation

Other Considerations

@cfcuffari120400 cfcuffari120400 changed the title CES-484-migrate-iopstapi new code [CES-484] Added new storage account iopstapi for ITN migration Nov 8, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

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

Terraform Plan
Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create
  ~ update in-place

Terraform will perform the following actions:

  # module.storage_api_weu.azurerm_storage_container.cached_itn will be created
  + resource "azurerm_storage_container" "cached_itn" {
      + container_access_type             = "private"
      + default_encryption_scope          = (known after apply)
      + encryption_scope_override_enabled = true
      + has_immutability_policy           = (known after apply)
      + has_legal_hold                    = (known after apply)
      + id                                = (known after apply)
      + metadata                          = (known after apply)
      + name                              = "cached"
      + resource_manager_id               = (known after apply)
      + storage_account_name              = "iopweuapist01"
    }

  # module.storage_api_weu.azurerm_storage_container.message_content_itn will be created
  + resource "azurerm_storage_container" "message_content_itn" {
      + container_access_type             = "private"
      + default_encryption_scope          = (known after apply)
      + encryption_scope_override_enabled = true
      + has_immutability_policy           = (known after apply)
      + has_legal_hold                    = (known after apply)
      + id                                = (known after apply)
      + metadata                          = (known after apply)
      + name                              = "message-content"
      + resource_manager_id               = (known after apply)
      + storage_account_name              = "iopweuapist01"
    }

  # module.storage_api_weu.azurerm_storage_table.faileduserdataprocessing_itn will be created
  + resource "azurerm_storage_table" "faileduserdataprocessing_itn" {
      + id                   = (known after apply)
      + name                 = "FailedUserDataProcessing"
      + storage_account_name = "iopweuapist01"
    }

  # module.storage_api_weu.azurerm_storage_table.subscriptionsfeedbyday_itn will be created
  + resource "azurerm_storage_table" "subscriptionsfeedbyday_itn" {
      + id                   = (known after apply)
      + name                 = "SubscriptionsFeedByDay"
      + storage_account_name = "iopweuapist01"
    }

  # module.storage_api_weu.azurerm_storage_table.validationtokens_itn will be created
  + resource "azurerm_storage_table" "validationtokens_itn" {
      + id                   = (known after apply)
      + name                 = "ValidationTokens"
      + storage_account_name = "iopweuapist01"
    }

  # module.web_apps.azurerm_role_assignment.key_vault_etl_func_secrets_user will be created
  + resource "azurerm_role_assignment" "key_vault_etl_func_secrets_user" {
      + id                               = (known after apply)
      + name                             = (known after apply)
      + principal_id                     = "42a26240-ee65-4929-889d-f5fd6cafbe85"
      + principal_type                   = (known after apply)
      + role_definition_id               = (known after apply)
      + role_definition_name             = "Key Vault Secrets User"
      + scope                            = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.KeyVault/vaults/io-p-kv-common"
      + skip_service_principal_aad_check = (known after apply)
    }

  # module.functions_messages_sending.module.function_app_messages_sending.azurerm_linux_function_app.this will be updated in-place
  ~ resource "azurerm_linux_function_app" "this" {
      ~ app_settings                                   = {
          + "APPINSIGHTS_INSTRUMENTATIONKEY"                  = "ab45103a-cb4f-474b-933f-d802ed1082d5"
            # (31 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-msgs-rg-01/providers/Microsoft.Web/sites/io-p-itn-msgs-sending-func-01"
        name                                           = "io-p-itn-msgs-sending-func-01"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO Comunicazione"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }
        # (26 unchanged attributes hidden)

      ~ site_config {
          - application_insights_key                = (sensitive value) -> null
            # (26 unchanged attributes hidden)

            # (1 unchanged block hidden)
        }

        # (2 unchanged blocks hidden)
    }

  # module.functions_messages_sending.module.function_app_messages_sending.azurerm_linux_function_app_slot.this[0] will be updated in-place
  ~ resource "azurerm_linux_function_app_slot" "this" {
      ~ app_settings                                   = {
          + "APPINSIGHTS_INSTRUMENTATIONKEY"                  = "ab45103a-cb4f-474b-933f-d802ed1082d5"
            # (32 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-msgs-rg-01/providers/Microsoft.Web/sites/io-p-itn-msgs-sending-func-01/slots/staging"
        name                                           = "staging"
        tags                                           = {
            "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"      = "Terraform"
            "Environment"    = "Prod"
            "ManagementTeam" = "IO Comunicazione"
            "Owner"          = "IO"
            "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }
        # (22 unchanged attributes hidden)

      ~ site_config {
          - application_insights_key                = (sensitive value) -> null
          ~ health_check_eviction_time_in_min       = 0 -> 2
            # (25 unchanged attributes hidden)

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_monitor_metric_alert.storage_account_health_check[0] will be created
  + resource "azurerm_monitor_metric_alert" "storage_account_health_check" {
      + auto_mitigate            = false
      + description              = "The average availability is less than 99.8%. Runbook: not needed."
      + enabled                  = true
      + frequency                = "PT5M"
      + id                       = (known after apply)
      + name                     = "[iopweuapist01] Low Availability"
      + resource_group_name      = "io-p-rg-internal"
      + scopes                   = (known after apply)
      + severity                 = 0
      + tags                     = {
          + "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"      = "Terraform"
          + "Environment"    = "Prod"
          + "ManagementTeam" = "IO Comunicazione"
          + "Owner"          = "IO"
          + "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
      + window_size              = "PT5M"

      + action {
          + action_group_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-msgs-rg-01/providers/Microsoft.Insights/actionGroups/io-p-com-error-ag-01"
        }

      + criteria {
          + aggregation            = "Average"
          + metric_name            = "Availability"
          + metric_namespace       = "Microsoft.Storage/storageAccounts"
          + operator               = "LessThan"
          + skip_metric_validation = false
          + threshold              = 99.8
        }
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_private_endpoint.this["blob"] will be created
  + resource "azurerm_private_endpoint" "this" {
      + custom_dns_configs       = (known after apply)
      + id                       = (known after apply)
      + location                 = "westeurope"
      + name                     = "io-p-weu-api-blob-pep-01"
      + network_interface        = (known after apply)
      + private_dns_zone_configs = (known after apply)
      + resource_group_name      = "io-p-rg-internal"
      + subnet_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/virtualNetworks/io-p-itn-common-vnet-01/subnets/io-p-itn-pep-snet-01"
      + tags                     = {
          + "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"      = "Terraform"
          + "Environment"    = "Prod"
          + "ManagementTeam" = "IO Comunicazione"
          + "Owner"          = "IO"
          + "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }

      + private_dns_zone_group {
          + id                   = (known after apply)
          + name                 = "private-dns-zone-group"
          + private_dns_zone_ids = [
              + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net",
            ]
        }

      + private_service_connection {
          + is_manual_connection           = false
          + name                           = "io-p-weu-api-blob-pep-01"
          + private_connection_resource_id = (known after apply)
          + private_ip_address             = (known after apply)
          + subresource_names              = [
              + "blob",
            ]
        }
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_private_endpoint.this["file"] will be created
  + resource "azurerm_private_endpoint" "this" {
      + custom_dns_configs       = (known after apply)
      + id                       = (known after apply)
      + location                 = "westeurope"
      + name                     = "io-p-weu-api-file-pep-01"
      + network_interface        = (known after apply)
      + private_dns_zone_configs = (known after apply)
      + resource_group_name      = "io-p-rg-internal"
      + subnet_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/virtualNetworks/io-p-itn-common-vnet-01/subnets/io-p-itn-pep-snet-01"
      + tags                     = {
          + "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"      = "Terraform"
          + "Environment"    = "Prod"
          + "ManagementTeam" = "IO Comunicazione"
          + "Owner"          = "IO"
          + "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }

      + private_dns_zone_group {
          + id                   = (known after apply)
          + name                 = "private-dns-zone-group"
          + private_dns_zone_ids = [
              + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/privateDnsZones/privatelink.file.core.windows.net",
            ]
        }

      + private_service_connection {
          + is_manual_connection           = false
          + name                           = "io-p-weu-api-file-pep-01"
          + private_connection_resource_id = (known after apply)
          + private_ip_address             = (known after apply)
          + subresource_names              = [
              + "file",
            ]
        }
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_private_endpoint.this["queue"] will be created
  + resource "azurerm_private_endpoint" "this" {
      + custom_dns_configs       = (known after apply)
      + id                       = (known after apply)
      + location                 = "westeurope"
      + name                     = "io-p-weu-api-queue-pep-01"
      + network_interface        = (known after apply)
      + private_dns_zone_configs = (known after apply)
      + resource_group_name      = "io-p-rg-internal"
      + subnet_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/virtualNetworks/io-p-itn-common-vnet-01/subnets/io-p-itn-pep-snet-01"
      + tags                     = {
          + "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"      = "Terraform"
          + "Environment"    = "Prod"
          + "ManagementTeam" = "IO Comunicazione"
          + "Owner"          = "IO"
          + "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }

      + private_dns_zone_group {
          + id                   = (known after apply)
          + name                 = "private-dns-zone-group"
          + private_dns_zone_ids = [
              + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/privateDnsZones/privatelink.queue.core.windows.net",
            ]
        }

      + private_service_connection {
          + is_manual_connection           = false
          + name                           = "io-p-weu-api-queue-pep-01"
          + private_connection_resource_id = (known after apply)
          + private_ip_address             = (known after apply)
          + subresource_names              = [
              + "queue",
            ]
        }
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_private_endpoint.this["table"] will be created
  + resource "azurerm_private_endpoint" "this" {
      + custom_dns_configs       = (known after apply)
      + id                       = (known after apply)
      + location                 = "westeurope"
      + name                     = "io-p-weu-api-table-pep-01"
      + network_interface        = (known after apply)
      + private_dns_zone_configs = (known after apply)
      + resource_group_name      = "io-p-rg-internal"
      + subnet_id                = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01/providers/Microsoft.Network/virtualNetworks/io-p-itn-common-vnet-01/subnets/io-p-itn-pep-snet-01"
      + tags                     = {
          + "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"      = "Terraform"
          + "Environment"    = "Prod"
          + "ManagementTeam" = "IO Comunicazione"
          + "Owner"          = "IO"
          + "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }

      + private_dns_zone_group {
          + id                   = (known after apply)
          + name                 = "private-dns-zone-group"
          + private_dns_zone_ids = [
              + "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/privateDnsZones/privatelink.table.core.windows.net",
            ]
        }

      + private_service_connection {
          + is_manual_connection           = false
          + name                           = "io-p-weu-api-table-pep-01"
          + private_connection_resource_id = (known after apply)
          + private_ip_address             = (known after apply)
          + subresource_names              = [
              + "table",
            ]
        }
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_security_center_storage_defender.this[0] will be created
  + resource "azurerm_security_center_storage_defender" "this" {
      + id                                          = (known after apply)
      + malware_scanning_on_upload_cap_gb_per_month = -1
      + malware_scanning_on_upload_enabled          = false
      + override_subscription_settings_enabled      = false
      + sensitive_data_discovery_enabled            = false
      + storage_account_id                          = (known after apply)
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_storage_account.this will be created
  + resource "azurerm_storage_account" "this" {
      + access_tier                        = "Hot"
      + account_kind                       = "StorageV2"
      + account_replication_type           = "ZRS"
      + account_tier                       = "Standard"
      + allow_nested_items_to_be_public    = true
      + cross_tenant_replication_enabled   = true
      + default_to_oauth_authentication    = false
      + dns_endpoint_type                  = "Standard"
      + enable_https_traffic_only          = (known after apply)
      + https_traffic_only_enabled         = (known after apply)
      + id                                 = (known after apply)
      + infrastructure_encryption_enabled  = false
      + is_hns_enabled                     = false
      + large_file_share_enabled           = (known after apply)
      + local_user_enabled                 = true
      + location                           = "westeurope"
      + min_tls_version                    = "TLS1_2"
      + name                               = "iopweuapist01"
      + nfsv3_enabled                      = false
      + primary_access_key                 = (sensitive value)
      + primary_blob_connection_string     = (sensitive value)
      + primary_blob_endpoint              = (known after apply)
      + primary_blob_host                  = (known after apply)
      + primary_blob_internet_endpoint     = (known after apply)
      + primary_blob_internet_host         = (known after apply)
      + primary_blob_microsoft_endpoint    = (known after apply)
      + primary_blob_microsoft_host        = (known after apply)
      + primary_connection_string          = (sensitive value)
      + primary_dfs_endpoint               = (known after apply)
      + primary_dfs_host                   = (known after apply)
      + primary_dfs_internet_endpoint      = (known after apply)
      + primary_dfs_internet_host          = (known after apply)
      + primary_dfs_microsoft_endpoint     = (known after apply)
      + primary_dfs_microsoft_host         = (known after apply)
      + primary_file_endpoint              = (known after apply)
      + primary_file_host                  = (known after apply)
      + primary_file_internet_endpoint     = (known after apply)
      + primary_file_internet_host         = (known after apply)
      + primary_file_microsoft_endpoint    = (known after apply)
      + primary_file_microsoft_host        = (known after apply)
      + primary_location                   = (known after apply)
      + primary_queue_endpoint             = (known after apply)
      + primary_queue_host                 = (known after apply)
      + primary_queue_microsoft_endpoint   = (known after apply)
      + primary_queue_microsoft_host       = (known after apply)
      + primary_table_endpoint             = (known after apply)
      + primary_table_host                 = (known after apply)
      + primary_table_microsoft_endpoint   = (known after apply)
      + primary_table_microsoft_host       = (known after apply)
      + primary_web_endpoint               = (known after apply)
      + primary_web_host                   = (known after apply)
      + primary_web_internet_endpoint      = (known after apply)
      + primary_web_internet_host          = (known after apply)
      + primary_web_microsoft_endpoint     = (known after apply)
      + primary_web_microsoft_host         = (known after apply)
      + public_network_access_enabled      = false
      + queue_encryption_key_type          = "Service"
      + resource_group_name                = "io-p-rg-internal"
      + secondary_access_key               = (sensitive value)
      + secondary_blob_connection_string   = (sensitive value)
      + secondary_blob_endpoint            = (known after apply)
      + secondary_blob_host                = (known after apply)
      + secondary_blob_internet_endpoint   = (known after apply)
      + secondary_blob_internet_host       = (known after apply)
      + secondary_blob_microsoft_endpoint  = (known after apply)
      + secondary_blob_microsoft_host      = (known after apply)
      + secondary_connection_string        = (sensitive value)
      + secondary_dfs_endpoint             = (known after apply)
      + secondary_dfs_host                 = (known after apply)
      + secondary_dfs_internet_endpoint    = (known after apply)
      + secondary_dfs_internet_host        = (known after apply)
      + secondary_dfs_microsoft_endpoint   = (known after apply)
      + secondary_dfs_microsoft_host       = (known after apply)
      + secondary_file_endpoint            = (known after apply)
      + secondary_file_host                = (known after apply)
      + secondary_file_internet_endpoint   = (known after apply)
      + secondary_file_internet_host       = (known after apply)
      + secondary_file_microsoft_endpoint  = (known after apply)
      + secondary_file_microsoft_host      = (known after apply)
      + secondary_location                 = (known after apply)
      + secondary_queue_endpoint           = (known after apply)
      + secondary_queue_host               = (known after apply)
      + secondary_queue_microsoft_endpoint = (known after apply)
      + secondary_queue_microsoft_host     = (known after apply)
      + secondary_table_endpoint           = (known after apply)
      + secondary_table_host               = (known after apply)
      + secondary_table_microsoft_endpoint = (known after apply)
      + secondary_table_microsoft_host     = (known after apply)
      + secondary_web_endpoint             = (known after apply)
      + secondary_web_host                 = (known after apply)
      + secondary_web_internet_endpoint    = (known after apply)
      + secondary_web_internet_host        = (known after apply)
      + secondary_web_microsoft_endpoint   = (known after apply)
      + secondary_web_microsoft_host       = (known after apply)
      + sftp_enabled                       = false
      + shared_access_key_enabled          = true
      + table_encryption_key_type          = "Service"
      + tags                               = {
          + "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
          + "CreatedBy"      = "Terraform"
          + "Environment"    = "Prod"
          + "ManagementTeam" = "IO Comunicazione"
          + "Owner"          = "IO"
          + "Source"         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }

      + blob_properties {
          + change_feed_enabled           = true
          + change_feed_retention_in_days = 10
          + default_service_version       = (known after apply)
          + last_access_time_enabled      = false
          + versioning_enabled            = true

          + delete_retention_policy {
              + days                     = 7
              + permanent_delete_enabled = false
            }
        }

      + identity {
          + principal_id = (known after apply)
          + tenant_id    = (known after apply)
          + type         = "SystemAssigned"
        }
    }

  # module.storage_api_weu.module.storage_api_itn.azurerm_storage_account_network_rules.network_rules will be created
  + resource "azurerm_storage_account_network_rules" "network_rules" {
      + bypass             = [
          + "AzureServices",
          + "Logging",
          + "Metrics",
        ]
      + default_action     = "Deny"
      + id                 = (known after apply)
      + storage_account_id = (known after apply)
    }

  # module.web_apps.module.etl_func.azurerm_linux_function_app.this will be updated in-place
  ~ resource "azurerm_linux_function_app" "this" {
      ~ app_settings                                   = {
          + "NODE_ENV"                                        = "production"
          - "NODE_ENVIRONMENT"                                = "production" -> null
          + "PDV_TOKENIZER_API_KEY"                           = "@Microsoft.KeyVault(VaultName=io-p-kv-common;SecretName=func-elt-PDV-TOKENIZER-API-KEY)"
            # (11 unchanged elements hidden)
        }
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-com-rg-01/providers/Microsoft.Web/sites/io-p-itn-com-etl-func-01"
        name                                           = "io-p-itn-com-etl-func-01"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO Comunicazione"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-messages/blob/main/infra/resources/prod"
        }
        # (26 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

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

Warning: Argument is deprecated

  with module.redis_messages.azurerm_redis_cache.this,
  on .terraform/modules/redis_messages/redis_cache/main.tf line 7, in resource "azurerm_redis_cache" "this":
   7:   enable_non_ssl_port           = var.enable_non_ssl_port

`enable_non_ssl_port` will be removed in favour of the property
`non_ssl_port_enabled` in version 4.0 of the AzureRM Provider.

(and 7 more similar warnings elsewhere)

─────────────────────────────────────────────────────────────────────────────

Note: You didn't use the -out option to save this plan, so Terraform can't
guarantee to take exactly these actions if you run "terraform apply" now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants