Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Sets up the core Azure infrastructure including VNet, DNS zones, and Key Vault. Useful to bootstrap production or development environments.

Notifications You must be signed in to change notification settings

pagopa-archive/terraform-azurerm-dx-azure-core-infra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Core Infrastructure module

The module provisions all the resources required for the initial configuration of a subscription.

The module, named azure_core_infra, includes the following:

  • A virtual network (VNet) with subnets for private endpoints.
  • A VPN, if specified.
  • Resource groups for the VNet, common resources, and testing.
  • A common Key Vault with a private endpoint.
  • Private DNS zones for all resource types.

Examples

module "core" {
  source = "github.com/pagopa/dx//infra/modules/azure_core_infra?ref=main"

  test_enabled = true # set to false if you want to create all resources

  environment  = local.environment

  virtual_network_cidr = "10.50.0.0/16"
  pep_subnet_cidr      = "10.50.2.0/23"

  vpn = {
    cidr_subnet              = "10.50.133.0/24"
    dnsforwarder_cidr_subnet = "10.50.252.8/29"
  }

  tags = local.tags
}

For more specific examples check out the ./example folder. There you'll find a "complete" example that creates the core infrastructure and a "develop" example that, in addition to creating the basic infrastructure, will configure additional resources useful to bootstrap a development environment on Azure.

Requirements

Name Version
azurerm ~>4

Modules

Name Source Version
common_log_analytics ./_modules/log_analytics n/a
dns ./_modules/dns n/a
github_runner ./_modules/github_runner n/a
key_vault ./_modules/key_vault n/a
naming_convention pagopa/dx-azure-naming-convention/azurerm ~> 0
naming_convention_gh_runner pagopa/dx-azure-naming-convention/azurerm ~> 0
nat_gateway ./_modules/nat_gateway n/a
network ./_modules/networking n/a
vpn ./_modules/vpn n/a

Resources

Name Type
azurerm_resource_group.common resource
azurerm_resource_group.gh_runner resource
azurerm_resource_group.network resource
azurerm_resource_group.test resource
azurerm_client_config.current data source

Inputs

Name Description Type Default Required
environment Values which are used to generate resource names and location short names. They are all mandatory except for domain, which should not be used only in the case of a resource used by multiple domains.
object({
prefix = string
env_short = string
location = string
domain = optional(string)
app_name = string
instance_number = string
})
n/a yes
gh_runner_snet GitHub runner subnet cidr string "10.0.242.0/23" no
nat_enabled Flag to enable nat gateway creation bool false no
pep_subnet_cidr CIDR block for the private endpoint subnet string "10.0.2.0/23" no
tags Resources tags map(any) n/a yes
test_enabled Flag to enable testing resources bool false no
virtual_network_cidr CIDR block for the virtual network string "10.0.0.0/16" no
vpn VPN configuration. Both 'cidr_subnet' and 'dnsforwarder_cidr_subnet' must be specified together or not at all.
object({
cidr_subnet = optional(string, "")
dnsforwarder_cidr_subnet = optional(string, "")
})
{} no

Outputs

Name Description
common_key_vault n/a
common_nat_gateways n/a
common_pep_snet n/a
common_resource_group_name n/a
common_vnet n/a
github_runner n/a
network_resource_group_name n/a
test_resource_group_name n/a

About

Sets up the core Azure infrastructure including VNet, DNS zones, and Key Vault. Useful to bootstrap production or development environments.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 7

Languages