-
Notifications
You must be signed in to change notification settings - Fork 5
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-21] Refactoring resource groups in Core configuration #1179
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Krusty93
force-pushed
the
CES-21-migrazione-resource-groups-core
branch
from
September 27, 2024 16:27
3676721
to
6016958
Compare
Krusty93
changed the title
[CES-21] Refactoring resource groups
[CES-21] Refactoring resource groups in Core configuration
Sep 27, 2024
10 tasks
Krusty93
force-pushed
the
CES-21-migrazione-resource-groups-core
branch
from
September 27, 2024 16:36
6016958
to
56463a1
Compare
Quality Gate passedIssues Measures |
📖 Terraform Plan ('src/core/prod') - successTerraform Planazurerm_resource_group.external_weu: Preparing import... [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external]
azurerm_resource_group.common_weu: Preparing import... [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common]
azurerm_resource_group.internal_weu: Preparing import... [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-internal]
azurerm_resource_group.linux_weu: Preparing import... [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-linux]
azurerm_resource_group.assets_cdn_weu: Preparing import... [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-assets-cdn-rg]
azurerm_resource_group.sec_weu: Preparing import... [id=/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg]
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_resource_group.acr_weu will be updated in-place
# (moved from module.container_registry.azurerm_resource_group.container_registry)
~ resource "azurerm_resource_group" "acr_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-container-registry-rg"
name = "io-p-container-registry-rg"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
# (1 unchanged attribute hidden)
}
# azurerm_resource_group.assets_cdn_weu will be updated in-place
# (imported from "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-assets-cdn-rg")
~ resource "azurerm_resource_group" "assets_cdn_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-assets-cdn-rg"
location = "westeurope"
name = "io-p-assets-cdn-rg"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra/blob/main/src/common/prod" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.vnet has moved to azurerm_resource_group.common_itn
resource "azurerm_resource_group" "common_itn" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-itn-common-rg-01"
name = "io-p-itn-common-rg-01"
tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
"Source" = "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
# (1 unchanged attribute hidden)
}
# azurerm_resource_group.common_weu will be updated in-place
# (imported from "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common")
~ resource "azurerm_resource_group" "common_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common"
location = "westeurope"
name = "io-p-rg-common"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.dashboards_itn will be created
+ resource "azurerm_resource_group" "dashboards_itn" {
+ id = (known after apply)
+ location = "italynorth"
+ name = "io-p-itn-common-dashboards-rg-01"
+ tags = {
+ "CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
+ "CreatedBy" = "Terraform"
+ "Environment" = "Prod"
+ "Owner" = "IO"
+ "Source" = "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.external_weu will be updated in-place
# (imported from "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external")
~ resource "azurerm_resource_group" "external_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-external"
location = "westeurope"
name = "io-p-rg-external"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.github_managed_identity_itn will be created
+ resource "azurerm_resource_group" "github_managed_identity_itn" {
+ id = (known after apply)
+ location = "italynorth"
+ name = "io-p-itn-github-id-rg-01"
+ tags = {
+ "CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
+ "CreatedBy" = "Terraform"
+ "Environment" = "Prod"
+ "Owner" = "IO"
+ "Source" = "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.internal_weu will be updated in-place
# (imported from "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-internal")
~ resource "azurerm_resource_group" "internal_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-internal"
location = "westeurope"
name = "io-p-rg-internal"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.linux_weu will be updated in-place
# (imported from "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-linux")
~ resource "azurerm_resource_group" "linux_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-linux"
location = "westeurope"
name = "io-p-rg-linux"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra/blob/main/src/common/prod" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.role_assignment_itn will be created
+ resource "azurerm_resource_group" "role_assignment_itn" {
+ id = (known after apply)
+ location = "italynorth"
+ name = "default-roleassignment-rg"
+ tags = {
+ "CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
+ "CreatedBy" = "Terraform"
+ "Environment" = "Prod"
+ "Owner" = "IO"
+ "Source" = "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# azurerm_resource_group.sec_weu will be imported
resource "azurerm_resource_group" "sec_weu" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg"
location = "westeurope"
name = "io-p-sec-rg"
tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
"Source" = "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
}
# module.container_registry.azurerm_container_registry.this will be updated in-place
~ resource "azurerm_container_registry" "this" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-container-registry-rg/providers/Microsoft.ContainerRegistry/registries/iopcommonacr"
name = "iopcommonacr"
~ tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
~ "Source" = "https://github.com/pagopa/io-infra" -> "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
# (16 unchanged attributes hidden)
}
# module.key_vault_weu.azurerm_resource_group.sec will no longer be managed by Terraform, but will not be destroyed
# (destroy = false is set in the configuration)
. resource "azurerm_resource_group" "sec" {
id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-sec-rg"
name = "io-p-sec-rg"
tags = {
"CostCenter" = "TS310 - PAGAMENTI & SERVIZI"
"CreatedBy" = "Terraform"
"Environment" = "Prod"
"Owner" = "IO"
"Source" = "https://github.com/pagopa/io-infra/blob/main/src/core/prod"
}
# (1 unchanged attribute hidden)
}
Plan: 6 to import, 3 to add, 7 to change, 0 to destroy.
Changes to Outputs:
- azure_devops_agent = {
- itn = null
- weu = {
- snet = {
- address_prefixes = [
- "10.0.250.0/24",
]
- id = "/subscriptions/ec285037-c673-4f58-b594-d7c480da4e8b/resourceGroups/io-p-rg-common/providers/Microsoft.Network/virtualNetworks/io-p-vnet-common/subnets/azure-devops"
- name = "azure-devops"
}
}
} -> null
+ resource_groups = {
+ italynorth = {
+ common = "io-p-itn-common-rg-01"
+ dashboards = "io-p-itn-common-dashboards-rg-01"
+ github_id = "io-p-itn-github-id-rg-01"
+ location_short = "itn"
}
+ westeurope = {
+ acr = "io-p-container-registry-rg"
+ assets_cdn = "io-p-assets-cdn-rg"
+ common = "io-p-rg-common"
+ external = "io-p-rg-external"
+ internal = "io-p-rg-internal"
+ linux = "io-p-rg-linux"
+ location_short = "weu"
+ sec = "io-p-sec-rg"
}
}
Warning: Some objects will no longer be managed by Terraform
If you apply this plan, Terraform will discard its tracking information for
the following objects, but it will not delete them:
- module.key_vault_weu.azurerm_resource_group.sec
After applying this plan, Terraform will no longer manage these objects. You
will need to import them into Terraform to manage them again.
Warning: Deprecated attribute
on ../_modules/vpn/main.tf line 27, in module "vpn":
27: aad_audience = data.azuread_application.vpn_app.application_id
The attribute "application_id" is deprecated. Refer to the provider
documentation for details.
(and one more similar warning elsewhere)
Warning: Argument is deprecated
with module.azdoa_weu.module.azdoa_snet.azurerm_subnet.this,
on .terraform/modules/azdoa_weu.azdoa_snet/subnet/main.tf line 23, in resource "azurerm_subnet" "this":
23: private_endpoint_network_policies_enabled = var.private_endpoint_network_policies_enabled
`private_endpoint_network_policies_enabled` will be removed in favour of the
property `private_endpoint_network_policies` in version 4.0 of the AzureRM
Provider
(and 14 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. |
christian-calabrese
approved these changes
Sep 30, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
List of changes
All resource groups shared among domains are defined in core and set as output of it.
Motivation and context
Grouping shared resource groups in core configuration
Type of changes
Env to apply
Does this introduce a change to production resources with possible user impact?
Does this introduce an unwanted change on infrastructure? Check terraform plan execution result
Other information
If PR is partially applied, why? (reserved to mantainers)
How to apply
After PR is approved