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

Move audit storage to Italy North #84

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lucacavallaro
Copy link
Member

List of changes

  1. Move fimsauditst01 to italynorth
  2. Change resource group from weu-fims-rg-01 to itn-fims-rg-01

Copy link

github-actions bot commented Dec 3, 2024

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

Terraform Plan
module.web_apps.data.azurerm_storage_account.audit: Still reading... [10s elapsed]
module.web_apps_itn.data.azurerm_storage_account.audit: Still reading... [10s elapsed]
module.web_apps.data.azurerm_storage_account.audit: Still reading... [20s elapsed]
module.web_apps_itn.data.azurerm_storage_account.audit: Still reading... [20s elapsed]
module.web_apps.data.azurerm_storage_account.audit: Still reading... [30s elapsed]
module.web_apps_itn.data.azurerm_storage_account.audit: Still reading... [30s elapsed]
module.web_apps.data.azurerm_storage_account.audit: Still reading... [40s elapsed]
module.web_apps_itn.data.azurerm_storage_account.audit: Still reading... [40s elapsed]

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement

Terraform planned the following actions, but then encountered a problem:

  # module.storage.azurerm_storage_container.events must be replaced
-/+ resource "azurerm_storage_container" "events" {
      ~ default_encryption_scope          = "$account-encryption-key" -> (known after apply)
      ~ has_immutability_policy           = false -> (known after apply)
      ~ has_legal_hold                    = false -> (known after apply)
      ~ id                                = "https://iopweufimsauditst01.blob.core.windows.net/events" -> (known after apply)
      ~ metadata                          = {} -> (known after apply)
        name                              = "events"
      ~ resource_manager_id               = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01/blobServices/default/containers/events" -> (known after apply)
      ~ storage_account_name              = "iopweufimsauditst01" -> "iopitnfimsauditst01" # forces replacement
        # (2 unchanged attributes hidden)
    }

  # module.storage.module.audit_st.azurerm_monitor_metric_alert.storage_account_health_check[0] must be replaced
-/+ resource "azurerm_monitor_metric_alert" "storage_account_health_check" {
      ~ id                       = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Insights/metricAlerts/[iopweufimsauditst01] Low Availability" -> (known after apply)
      ~ name                     = "[iopweufimsauditst01] Low Availability" -> "[iopitnfimsauditst01] Low Availability" # forces replacement
      ~ resource_group_name      = "io-p-fims-rg" -> "io-p-itn-fims-rg-01" # forces replacement
      ~ scopes                   = [
          - "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01",
        ] -> (known after apply)
        tags                     = {
            "CostCenter"  = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"   = "Terraform"
            "Environment" = "Prod"
            "Owner"       = "IO Comunicazione"
            "Source"      = "https://github.com/pagopa/io-fims/blob/main/infra/prod/westeurope"
        }
      + target_resource_location = (known after apply)
      + target_resource_type     = (known after apply)
        # (6 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

  # module.storage.module.audit_st.azurerm_private_endpoint.this["blob"] must be replaced
-/+ resource "azurerm_private_endpoint" "this" {
      ~ custom_dns_configs       = [] -> (known after apply)
      ~ id                       = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/privateEndpoints/io-p-weu-fims-audit-blob-pep-01" -> (known after apply)
      ~ location                 = "westeurope" -> "italynorth" # forces replacement
      ~ name                     = "io-p-weu-fims-audit-blob-pep-01" -> "io-p-itn-fims-audit-blob-pep-01" # forces replacement
      ~ network_interface        = [
          - {
              - id   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/networkInterfaces/io-p-weu-fims-audit-blob-pep-01.nic.2123ba0f-6105-49a9-b5e8-cbeb73d98f7c"
              - name = "io-p-weu-fims-audit-blob-pep-01.nic.2123ba0f-6105-49a9-b5e8-cbeb73d98f7c"
            },
        ] -> (known after apply)
      ~ private_dns_zone_configs = [
          - {
              - id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/privateEndpoints/io-p-weu-fims-audit-blob-pep-01/privateDnsZoneGroups/private-dns-zone-group/privateDnsZoneConfigs/privatelink.blob.core.windows.net"
              - name                = "privatelink.blob.core.windows.net"
              - private_dns_zone_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/privateDnsZones/privatelink.blob.core.windows.net"
              - record_sets         = [
                  - {
                      - fqdn         = "iopweufimsauditst01.privatelink.blob.core.windows.net"
                      - ip_addresses = [
                          - "10.0.240.58",
                        ]
                      - name         = "iopweufimsauditst01"
                      - ttl          = 10
                      - type         = "A"
                    },
                ]
            },
        ] -> (known after apply)
      ~ resource_group_name      = "io-p-fims-rg" -> "io-p-itn-fims-rg-01" # forces replacement
        tags                     = {
            "CostCenter"  = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"   = "Terraform"
            "Environment" = "Prod"
            "Owner"       = "IO Comunicazione"
            "Source"      = "https://github.com/pagopa/io-fims/blob/main/infra/prod/westeurope"
        }
        # (1 unchanged attribute hidden)

      ~ private_dns_zone_group {
          ~ id                   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/privateEndpoints/io-p-weu-fims-audit-blob-pep-01/privateDnsZoneGroups/private-dns-zone-group" -> (known after apply)
            name                 = "private-dns-zone-group"
            # (1 unchanged attribute hidden)
        }

      ~ private_service_connection {
          ~ name                           = "io-p-weu-fims-audit-blob-pep-01" -> "io-p-itn-fims-audit-blob-pep-01" # forces replacement
          ~ private_connection_resource_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" # forces replacement -> (known after apply) # forces replacement
          ~ private_ip_address             = "10.0.240.58" -> (known after apply)
            # (2 unchanged attributes hidden)
        }
    }

  # module.storage.module.audit_st.azurerm_private_endpoint.this["queue"] must be replaced
-/+ resource "azurerm_private_endpoint" "this" {
      ~ custom_dns_configs       = [] -> (known after apply)
      ~ id                       = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/privateEndpoints/io-p-weu-fims-audit-queue-pep-01" -> (known after apply)
      ~ location                 = "westeurope" -> "italynorth" # forces replacement
      ~ name                     = "io-p-weu-fims-audit-queue-pep-01" -> "io-p-itn-fims-audit-queue-pep-01" # forces replacement
      ~ network_interface        = [
          - {
              - id   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/networkInterfaces/io-p-weu-fims-audit-queue-pep-01.nic.4196255c-ee04-4038-b6d5-a0fb6b16c5d7"
              - name = "io-p-weu-fims-audit-queue-pep-01.nic.4196255c-ee04-4038-b6d5-a0fb6b16c5d7"
            },
        ] -> (known after apply)
      ~ private_dns_zone_configs = [
          - {
              - id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/privateEndpoints/io-p-weu-fims-audit-queue-pep-01/privateDnsZoneGroups/private-dns-zone-group/privateDnsZoneConfigs/privatelink.queue.core.windows.net"
              - name                = "privatelink.queue.core.windows.net"
              - private_dns_zone_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/privateDnsZones/privatelink.queue.core.windows.net"
              - record_sets         = [
                  - {
                      - fqdn         = "iopweufimsauditst01.privatelink.queue.core.windows.net"
                      - ip_addresses = [
                          - "10.0.240.37",
                        ]
                      - name         = "iopweufimsauditst01"
                      - ttl          = 10
                      - type         = "A"
                    },
                ]
            },
        ] -> (known after apply)
      ~ resource_group_name      = "io-p-fims-rg" -> "io-p-itn-fims-rg-01" # forces replacement
        tags                     = {
            "CostCenter"  = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"   = "Terraform"
            "Environment" = "Prod"
            "Owner"       = "IO Comunicazione"
            "Source"      = "https://github.com/pagopa/io-fims/blob/main/infra/prod/westeurope"
        }
        # (1 unchanged attribute hidden)

      ~ private_dns_zone_group {
          ~ id                   = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Network/privateEndpoints/io-p-weu-fims-audit-queue-pep-01/privateDnsZoneGroups/private-dns-zone-group" -> (known after apply)
            name                 = "private-dns-zone-group"
            # (1 unchanged attribute hidden)
        }

      ~ private_service_connection {
          ~ name                           = "io-p-weu-fims-audit-queue-pep-01" -> "io-p-itn-fims-audit-queue-pep-01" # forces replacement
          ~ private_connection_resource_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" # forces replacement -> (known after apply) # forces replacement
          ~ private_ip_address             = "10.0.240.37" -> (known after apply)
            # (2 unchanged attributes hidden)
        }
    }

  # module.storage.module.audit_st.azurerm_security_center_storage_defender.this[0] must be replaced
-/+ resource "azurerm_security_center_storage_defender" "this" {
      ~ id                                          = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" -> (known after apply)
      ~ storage_account_id                          = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" # forces replacement -> (known after apply) # forces replacement
        # (4 unchanged attributes hidden)
    }

  # module.storage.module.audit_st.azurerm_storage_account.this must be replaced
-/+ resource "azurerm_storage_account" "this" {
      ~ id                                 = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" -> (known after apply)
      + large_file_share_enabled           = (known after apply)
      ~ location                           = "westeurope" -> "italynorth" # forces replacement
      ~ name                               = "iopweufimsauditst01" -> "iopitnfimsauditst01" # forces replacement
      ~ primary_access_key                 = (sensitive value)
      ~ primary_blob_connection_string     = (sensitive value)
      ~ primary_blob_endpoint              = "https://iopweufimsauditst01.blob.core.windows.net/" -> (known after apply)
      ~ primary_blob_host                  = "iopweufimsauditst01.blob.core.windows.net" -> (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               = "https://iopweufimsauditst01.dfs.core.windows.net/" -> (known after apply)
      ~ primary_dfs_host                   = "iopweufimsauditst01.dfs.core.windows.net" -> (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              = "https://iopweufimsauditst01.file.core.windows.net/" -> (known after apply)
      ~ primary_file_host                  = "iopweufimsauditst01.file.core.windows.net" -> (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                   = "westeurope" -> (known after apply)
      ~ primary_queue_endpoint             = "https://iopweufimsauditst01.queue.core.windows.net/" -> (known after apply)
      ~ primary_queue_host                 = "iopweufimsauditst01.queue.core.windows.net" -> (known after apply)
      + primary_queue_microsoft_endpoint   = (known after apply)
      + primary_queue_microsoft_host       = (known after apply)
      ~ primary_table_endpoint             = "https://iopweufimsauditst01.table.core.windows.net/" -> (known after apply)
      ~ primary_table_host                 = "iopweufimsauditst01.table.core.windows.net" -> (known after apply)
      + primary_table_microsoft_endpoint   = (known after apply)
      + primary_table_microsoft_host       = (known after apply)
      ~ primary_web_endpoint               = "https://iopweufimsauditst01.z6.web.core.windows.net/" -> (known after apply)
      ~ primary_web_host                   = "iopweufimsauditst01.z6.web.core.windows.net" -> (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)
      ~ resource_group_name                = "io-p-fims-rg" -> "io-p-itn-fims-rg-01" # forces replacement
      ~ 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)
        tags                               = {
            "CostCenter"  = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"   = "Terraform"
            "Environment" = "Prod"
            "Owner"       = "IO Comunicazione"
            "Source"      = "https://github.com/pagopa/io-fims/blob/main/infra/prod/westeurope"
        }
        # (19 unchanged attributes hidden)

      ~ blob_properties {
          - change_feed_retention_in_days = 0 -> null
          + default_service_version       = (known after apply)
            # (3 unchanged attributes hidden)
        }

      ~ identity {
          - identity_ids = [] -> null
          ~ principal_id = "7410a693-
Error: Storage Account (Subscription: "ec285037-c673-4f58-b594-d7c480da4e8b"
Resource Group Name: "io-p-itn-fims-rg-01"
Storage Account Name: "iopitnfimsauditst01") was not found

  with module.web_apps.data.azurerm_storage_account.audit,
  on ../_modules/web_apps/data.tf line 35, in data "azurerm_storage_account" "audit":
  35: data "azurerm_storage_account" "audit" {


Error: Storage Account (Subscription: "ec285037-c673-4f58-b594-d7c480da4e8b"
Resource Group Name: "io-p-itn-fims-rg-01"
Storage Account Name: "iopitnfimsauditst01") was not found

  with module.web_apps_itn.data.azurerm_storage_account.audit,
  on ../_modules/web_apps_itn/data.tf line 25, in data "azurerm_storage_account" "audit":
  25: data "azurerm_storage_account" "audit" {

603d-41d3-81ac-cdf03d31950b" -> (known after apply)
          ~ tenant_id    = "7788edaf-0346-4068-9d79-c868aed15b3d" -> (known after apply)
            # (1 unchanged attribute hidden)
        }

      - network_rules {
          - bypass                     = [
              - "AzureServices",
              - "Logging",
              - "Metrics",
            ] -> null
          - default_action             = "Deny" -> null
          - ip_rules                   = [] -> null
          - virtual_network_subnet_ids = [] -> null
        }

      - queue_properties {
          - hour_metrics {
              - enabled               = true -> null
              - include_apis          = true -> null
              - retention_policy_days = 7 -> null
              - version               = "1.0" -> null
            }
          - logging {
              - delete                = false -> null
              - read                  = false -> null
              - retention_policy_days = 0 -> null
              - version               = "1.0" -> null
              - write                 = false -> null
            }
          - minute_metrics {
              - enabled               = false -> null
              - include_apis          = false -> null
              - retention_policy_days = 0 -> null
              - version               = "1.0" -> null
            }
        }

      - share_properties {
          - retention_policy {
              - days = 7 -> null
            }
        }

        # (1 unchanged block hidden)
    }

  # module.storage.module.audit_st.azurerm_storage_account_network_rules.network_rules must be replaced
-/+ resource "azurerm_storage_account_network_rules" "network_rules" {
      ~ id                         = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" -> (known after apply)
      ~ ip_rules                   = [] -> (known after apply)
      ~ storage_account_id         = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-fims-rg/providers/Microsoft.Storage/storageAccounts/iopweufimsauditst01" # forces replacement -> (known after apply) # forces replacement
      ~ virtual_network_subnet_ids = [] -> (known after apply)
        # (2 unchanged attributes hidden)
    }

Plan: 7 to add, 0 to change, 7 to destroy.

Warning: Argument is deprecated

  with module.cosmos.module.comsosdb_sql_container_op_access_tokens.azurerm_cosmosdb_sql_container.this,
  on .terraform/modules/cosmos.comsosdb_sql_container_op_access_tokens/cosmosdb_sql_container/main.tf line 7, in resource "azurerm_cosmosdb_sql_container" "this":
   7:   partition_key_path = var.partition_key_path

`partition_key_path` will be removed in favour of the property
`partition_key_paths` in version 4.0 of the AzureRM Provider.

(and 14 more similar warnings elsewhere)

Warning: Deprecated attribute

  on .terraform/modules/cosmos.cosmosdb_account_fims/cosmosdb_account/output.tf line 54, in output "connection_strings":
  54:   value     = azurerm_cosmosdb_account.this.connection_strings

The attribute "connection_strings" is deprecated. Refer to the provider
documentation for details.

(and one more similar warning elsewhere)
::error::Terraform exited with code 1.

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.

1 participant