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

[EC-318] Allowed GitHub Runner subnet for io-subscription-migration and io-developer-portal-service-data #1157

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

mamu0
Copy link
Contributor

@mamu0 mamu0 commented Sep 10, 2024

List of changes

Added runner subnet as allowed for functions

  • io-subscription-migration
  • io-developer-portal-service-data

Motivation and context

The functions need a selfhosted runner.

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

@mamu0 mamu0 requested a review from a team as a code owner September 10, 2024 11:31
Copy link

Copy link

Terraform Plan ('src/domains/selfcare/prod/westeurope') 📖

Terraform Plan
module.app_services.data.azurerm_linux_function_app.itn_webapp_functions_app: Still reading... [10s elapsed]
module.app_services.data.azurerm_linux_function_app.itn_webapp_functions_app: Still reading... [20s elapsed]

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

Terraform will perform the following actions:

  # module.app_services.module.function_devportalservicedata.azurerm_linux_function_app.this will be updated in-place
  ~ resource "azurerm_linux_function_app" "this" {
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-selfcare-be-rg/providers/Microsoft.Web/sites/io-p-devportalsrvdata-fn"
        name                                           = "io-p-devportalsrvdata-fn"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO Enti & Servizi"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-infra/blob/main/src/domains/selfcare/prod/westeurope"
        }
        # (28 unchanged attributes hidden)

      ~ site_config {
          ~ health_check_eviction_time_in_min       = 0 -> 10
            # (24 unchanged attributes hidden)

          ~ ip_restriction {
                name                      = "rule"
              ~ virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-selfcare-be-common-snet" -> "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              - ip_address                = "51.144.56.96/28" -> null
                name                      = "rule"
              + virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-selfcare-be-common-snet"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.112/28" -> "51.144.56.96/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.128/28" -> "51.144.56.112/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.144/28" -> "51.144.56.128/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.160/28" -> "51.144.56.144/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.176/28" -> "51.144.56.160/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              + ip_address                = "51.144.56.176/28"
                name                      = "rule"
              - virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet" -> null
                # (3 unchanged attributes hidden)
            }

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.app_services.module.function_devportalservicedata_staging_slot.azurerm_linux_function_app_slot.this will be updated in-place
  ~ resource "azurerm_linux_function_app_slot" "this" {
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-selfcare-be-rg/providers/Microsoft.Web/sites/io-p-devportalsrvdata-fn/slots/staging"
        name                                           = "staging"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO Enti & Servizi"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-infra/blob/main/src/domains/selfcare/prod/westeurope"
        }
        # (24 unchanged attributes hidden)

      ~ site_config {
          ~ health_check_eviction_time_in_min       = 0 -> 10
            # (24 unchanged attributes hidden)

          ~ ip_restriction {
                name                      = "rule"
              ~ virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/azure-devops" -> "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
                name                      = "rule"
              ~ virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet" -> "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/azure-devops"
                # (3 unchanged attributes hidden)
            }

            # (1 unchanged block hidden)
        }
    }

  # module.app_services.module.function_subscriptionmigrations.azurerm_linux_function_app.this will be updated in-place
  ~ resource "azurerm_linux_function_app" "this" {
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-selfcare-be-rg/providers/Microsoft.Web/sites/io-p-subsmigrations-fn"
        name                                           = "io-p-subsmigrations-fn"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO Enti & Servizi"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-infra/blob/main/src/domains/selfcare/prod/westeurope"
        }
        # (28 unchanged attributes hidden)

      ~ site_config {
            # (25 unchanged attributes hidden)

          ~ ip_restriction {
                name                      = "rule"
              ~ virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-selfcare-be-common-snet" -> "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
                name                      = "rule"
              ~ virtual_network_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-svc-bo-app-snet-01" -> "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-selfcare-be-common-snet"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              - ip_address                = "51.144.56.96/28" -> null
                name                      = "rule"
              + virtual_network_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-svc-bo-app-snet-01"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.112/28" -> "51.144.56.96/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.128/28" -> "51.144.56.112/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.144/28" -> "51.144.56.128/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.160/28" -> "51.144.56.144/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              ~ ip_address = "51.144.56.176/28" -> "51.144.56.160/28"
                name       = "rule"
                # (3 unchanged attributes hidden)
            }
          ~ ip_restriction {
              + ip_address                = "51.144.56.176/28"
              ~ name                      = "io-p-github-runner-snet" -> "rule"
              - virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet" -> null
                # (3 unchanged attributes hidden)
            }

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

  # module.app_services.module.function_subscriptionmigrations_staging_slot.azurerm_linux_function_app_slot.this will be updated in-place
  ~ resource "azurerm_linux_function_app_slot" "this" {
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-selfcare-be-rg/providers/Microsoft.Web/sites/io-p-subsmigrations-fn/slots/staging"
        name                                           = "staging"
        tags                                           = {
            "CostCenter"     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"      = "Terraform"
            "Environment"    = "Prod"
            "ManagementTeam" = "IO Enti & Servizi"
            "Owner"          = "IO"
            "Source"         = "https://github.com/pagopa/io-infra/blob/main/src/domains/selfcare/prod/westeurope"
        }
        # (24 unchanged attributes hidden)

      ~ site_config {
            # (25 unchanged attributes hidden)

          ~ ip_restriction {
                name                      = "rule"
              ~ virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/azure-devops" -> "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/io-p-github-runner-snet"
                # (3 unchanged attributes hidden)
            }
          + ip_restriction {
              + action                    = "Allow"
              + name                      = "rule"
              + priority                  = 65000
              + virtual_network_subnet_id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/azure-devops"
            }

            # (1 unchanged block hidden)
        }
    }

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

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

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 00fc528 into main Sep 10, 2024
6 checks passed
@mamu0 mamu0 deleted the add-runner-functions branch September 10, 2024 13:42
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.

2 participants