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

[PE-703] Private Endpoint Common module and CGN configuration #1211

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

mamu0
Copy link
Contributor

@mamu0 mamu0 commented Sep 30, 2024

List of changes

Added private_endpoint module into common folder.
Configured CGN PROD pep for postgres in itn.

Motivation and context

To configure the CGN pep it was necessary also to add a general module that create al private endpoint when necessary.

Type of changes

  • Add new resources
  • Update configuration to existing resources
  • Remove existing resources

Env to apply

  • DEV
  • UAT
  • PROD

Does this introduce a change to production resources with possible user impact?

  • Yes, users may be impacted applying this change
  • No

Does this introduce an unwanted change on infrastructure? Check terraform plan execution result

  • Yes
  • No

Other information


If PR is partially applied, why? (reserved to mantainers)

How to apply

After PR is approved

  1. run deploy pipeline from Azure DevOps io-platform-iac-projects
  2. select PR branch
  3. wait for approval

src/common/_modules/private_endpoint/outputs.tf Outdated Show resolved Hide resolved
src/common/prod/data.tf Outdated Show resolved Hide resolved
src/common/prod/italynorth.tf Outdated Show resolved Hide resolved
src/common/_modules/private_endpoint/locals.tf Outdated Show resolved Hide resolved
src/common/_modules/private_endpoint/data.tf Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 1, 2024

@mamu0 mamu0 marked this pull request as ready for review October 1, 2024 10:40
@mamu0 mamu0 requested a review from a team as a code owner October 1, 2024 10:40
Copy link

github-actions bot commented Oct 1, 2024

📖 Terraform Plan ('src/common/prod') - success

Terraform Plan
data.azurerm_linux_function_app.function_cgn: Still reading... [10s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.fims_op_app: Still reading... [10s elapsed]
data.azurerm_linux_function_app.function_app[0]: Still reading... [10s elapsed]
data.azurerm_linux_function_app.function_app[1]: Still reading... [10s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.session_manager: Still reading... [10s elapsed]
data.azurerm_linux_function_app.lollipop_function: Still reading... [10s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.appservice_continua: Still reading... [10s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.appservice_devportal_be: Still reading... [10s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.cms_backoffice_app_itn: Still reading... [10s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.appservice_selfcare_be: Still reading... [10s elapsed]
data.azurerm_linux_function_app.lollipop_function: Still reading... [20s elapsed]
module.application_gateway_weu.data.azurerm_linux_web_app.cms_backoffice_app_itn: Still reading... [20s elapsed]
data.azurerm_linux_function_app.io_sign_user: Still reading... [10s elapsed]
data.azurerm_linux_function_app.wallet_user: Still reading... [10s elapsed]
data.azurerm_linux_function_app.function_assets_cdn: Still reading... [10s elapsed]
data.azurerm_linux_function_app.eucovidcert: Still reading... [10s elapsed]
data.azurerm_linux_function_app.services_app_backend_function_app: Still reading... [10s elapsed]
data.azurerm_linux_web_app.firmaconio_selfcare_web_app: Still reading... [10s elapsed]

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.application_gateway_weu.azurerm_web_application_firewall_policy.api_app will be updated in-place
  ~ resource "azurerm_web_application_firewall_policy" "api_app" {
        id                  = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/io-p-waf-appgateway-api-app-policy"
        name                = "io-p-waf-appgateway-api-app-policy"
        tags                = {
            "CostCenter"  = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"   = "Terraform"
            "Environment" = "Prod"
            "Owner"       = "IO"
            "Source"      = "https://github.com/pagopa/io-infra"
        }
        # (4 unchanged attributes hidden)

      ~ policy_settings {
          ~ request_body_inspect_limit_in_kb          = 0 -> 128
            # (6 unchanged attributes hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.private_endpoints.azurerm_private_endpoint.this["cgn-psql-pep-01"] will be created
  + resource "azurerm_private_endpoint" "this" {
      + custom_dns_configs       = (known after apply)
      + id                       = (known after apply)
      + location                 = "italynorth"
      + name                     = "io-p-itn-cgn-psql-pep-01"
      + network_interface        = (known after apply)
      + private_dns_zone_configs = (known after apply)
      + resource_group_name      = "io-p-itn-common-rg-01"
      + 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"
          + "Owner"       = "IO"
          + "Source"      = "https://github.com/pagopa/io-infra/blob/main/src/common/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.postgres.database.azure.com",
            ]
        }

      + private_service_connection {
          + is_manual_connection           = false
          + name                           = "io-p-itn-cgn-psql-pep-01-pep-01"
          + private_connection_resource_id = "/subscriptions/74da48a3-b0e7-489d-8172-da79801086ed/resourceGroups/cgnonboardingportal-p-db-rg/providers/Microsoft.DBforPostgreSQL/servers/cgnonboardingportal-p-db-postgresql"
          + private_ip_address             = (known after apply)
          + subresource_names              = [
              + "postgresqlServer",
            ]
        }
    }

  # module.app_backend_li_weu.module.appservice_app_backend.azurerm_linux_web_app.this will be updated in-place
  ~ resource "azurerm_linux_web_app" "this" {
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-linux/providers/Microsoft.Web/sites/io-p-app-appbackendli"
        name                                           = "io-p-app-appbackendli"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-infra/blob/main/src/common/prod"
        }
        # (22 unchanged attributes hidden)

      ~ site_config {
          ~ health_check_eviction_time_in_min       = 3 -> 2
            # (24 unchanged attributes hidden)

            # (21 unchanged blocks hidden)
        }

        # (1 unchanged block hidden)
    }

Plan: 1 to add, 2 to change, 0 to destroy.

Warning: Argument is deprecated

  with module.application_gateway_weu.azurerm_web_application_firewall_policy.api_app,
  on ../_modules/application_gateway/firewall.tf line 62, in resource "azurerm_web_application_firewall_policy" "api_app":
  62:         disabled_rules = [
  63:           "942100",
  64:           "942120",
  65:           "942190",
  66:           "942200",
  67:           "942210",
  68:           "942240",
  69:           "942250",
  70:           "942260",
  71:           "942330",
  72:           "942340",
  73:           "942370",
  74:           "942380",
  75:           "942430",
  76:           "942440",
  77:           "942450",
  78:         ]

`disabled_rules` will be removed in favour of the `rule` property in version
4.0 of the AzureRM Provider.

(and 50 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.

@mamu0 mamu0 merged commit 1a8508e into main Oct 1, 2024
8 checks passed
@mamu0 mamu0 deleted the private-endpoint-common-configuration branch October 1, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants