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-932] Created common plan and new subnets for cgn functions #53

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

michaeldisaro
Copy link
Contributor

List of Changes

  • changed functions module to accept a shared plan and pre-created subnets
  • added a new common service plan to host functions
  • added a new common subnet
  • added a dedicate subnet for search func

Motivation and Context

We are grouping some azure functions under a shared service plan to reduce costs.

How Has This Been Tested?

tf plan

Types of changes

  • Chore (nothing changes by a user perspective)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@michaeldisaro michaeldisaro requested a review from a team as a code owner February 5, 2025 16:18
Copy link
Contributor

github-actions bot commented Feb 5, 2025

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

Terraform Plan
module.functions_cgn_card.module.function_cgn_card_autoscaler.data.azurerm_linux_function_app.this[0]: 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:

  # azurerm_subnet.cgn_common_subnet_01 will be created
  + resource "azurerm_subnet" "cgn_common_subnet_01" {
      + address_prefixes                               = [
          + "10.20.28.0/26",
        ]
      + default_outbound_access_enabled                = true
      + enforce_private_link_endpoint_network_policies = (known after apply)
      + enforce_private_link_service_network_policies  = (known after apply)
      + id                                             = (known after apply)
      + name                                           = "io-p-itn-cgn-common-snet-01"
      + private_endpoint_network_policies              = (known after apply)
      + private_endpoint_network_policies_enabled      = (known after apply)
      + private_link_service_network_policies_enabled  = (known after apply)
      + resource_group_name                            = "io-p-itn-common-rg-01"
      + service_endpoints                              = [
          + "Microsoft.CosmosDB",
          + "Microsoft.Storage",
          + "Microsoft.Web",
        ]
      + virtual_network_name                           = "io-p-itn-common-vnet-01"

      + delegation {
          + name = "default"

          + service_delegation {
              + actions = [
                  + "Microsoft.Network/virtualNetworks/subnets/action",
                ]
              + name    = "Microsoft.Web/serverFarms"
            }
        }
    }

  # azurerm_subnet.cgn_func_search_subnet_01 will be created
  + resource "azurerm_subnet" "cgn_func_search_subnet_01" {
      + address_prefixes                               = [
          + "10.20.28.64/26",
        ]
      + default_outbound_access_enabled                = true
      + enforce_private_link_endpoint_network_policies = (known after apply)
      + enforce_private_link_service_network_policies  = (known after apply)
      + id                                             = (known after apply)
      + name                                           = "io-p-itn-cgn-func-search-snet-01"
      + private_endpoint_network_policies              = (known after apply)
      + private_endpoint_network_policies_enabled      = (known after apply)
      + private_link_service_network_policies_enabled  = (known after apply)
      + resource_group_name                            = "io-p-itn-common-rg-01"
      + service_endpoints                              = [
          + "Microsoft.CosmosDB",
          + "Microsoft.Storage",
          + "Microsoft.Web",
        ]
      + virtual_network_name                           = "io-p-itn-common-vnet-01"

      + delegation {
          + name = "default"

          + service_delegation {
              + actions = [
                  + "Microsoft.Network/virtualNetworks/subnets/action",
                ]
              + name    = "Microsoft.Web/serverFarms"
            }
        }
    }

  # module.functions_cgn_search.module.function_app_cgn_search.azurerm_linux_function_app_slot.this[0] will be updated in-place
  ~ resource "azurerm_linux_function_app_slot" "this" {
        id                                             = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-cgn-rg-01/providers/Microsoft.Web/sites/io-p-itn-cgn-search-func-01/slots/staging"
        name                                           = "staging"
        tags                                           = {
            "CostCenter"                                     = "TS310 - PAGAMENTI & SERVIZI"
            "CreatedBy"                                      = "Terraform"
            "Environment"                                    = "Prod"
            "ManagementTeam"                                 = "IO CGN"
            "Owner"                                          = "IO"
            "Source"                                         = "https://github.com/pagopa/io-cgn/blob/main/infra/resources/prod"
        }
        # (30 unchanged attributes hidden)

      ~ site_config {
          ~ health_check_eviction_time_in_min             = 0 -> 2
            # (33 unchanged attributes hidden)

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

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

Warning: Argument is deprecated

  with module.redis_cgn.azurerm_redis_cache.this,
  on .terraform/modules/redis_cgn/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 one more similar warning 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.

@michaeldisaro michaeldisaro merged commit 2bfe027 into main Feb 5, 2025
5 checks passed
@michaeldisaro michaeldisaro deleted the pe-932 branch February 5, 2025 16:22
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.

1 participant