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.
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.
| Name | Version |
|---|---|
| azurerm | ~>4 |
| 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 |
| 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 |
| 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({ |
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({ |
{} |
no |
| 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 |