Skip to main content

Required Resource Tags

All cloud resources created with Terraform must be tagged according to the DX conventions.

The complete list of available tags and their allowed values is available in the tagging strategy documentation.

Mandatory Tags​

TagDescription
CostCenterBudget tracking identifier
EnvironmentDeployment environment
OwnerTeam owning the resource
SourceLink to the Terraform source code

Optional Tags​

DX also suggests the following optional tags:

TagDescription
BusinessUnitBusiness unit the resource belongs to
ManagementTeamTeam managing the resource

Implementation​

Define tags in locals.tf and apply them to all resources:

locals.tf
locals {
tags = {
CostCenter = "<cost-center>"
Environment = "<environment>"
Owner = "<owner>"
Source = "https://github.com/pagopa/<repository>/blob/main/infra/resources/<environment>"
}
}
main.tf
resource "azurerm_resource_group" "example" {
name = "example-rg"
location = "italynorth"

tags = local.tags
}
Consistent Tagging

Always pass local.tags to resources and modules. Never hardcode tags directly in resources.

Source Tag Format​

The Source tag must point to the exact location of the Terraform code in the GitHub repository:

https://github.com/pagopa/<repository>/blob/main/infra/resources/<environment>
Examples
  • https://github.com/pagopa/io-infra/blob/main/infra/resources/prod
  • https://github.com/pagopa/cgn-onboarding-portal/blob/main/infra/resources/dev