-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Retrieve Common Values | ||
|
||
## Description | ||
|
||
This Terraform module does not require any input and provides some outputs containg common information for whole `io-infra` repository. | ||
To update the module with new information add into the outputs.tf | ||
```hcl | ||
output "some_resource_name" { | ||
description = <<EOF | ||
WHAT: short description about what this value is for | ||
HOW: short description about how this value will be used (optional) | ||
EOF | ||
value = "example_value" | ||
} | ||
``` | ||
|
||
## Usage | ||
|
||
Include the module in your Terraform configuration and access the outputs to retrieve the information. | ||
|
||
### Example Usage | ||
|
||
```hcl | ||
module "common_names" { | ||
source = "../../_modules/common_values" | ||
} | ||
output "some_resource_name" { | ||
value = module.common_names.some_resource_name | ||
} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
data "azurerm_virtual_network" "weu_beta" { | ||
name = "${local.project_weu}-beta-vnet" | ||
resource_group_name = "${local.project_weu}-beta-vnet-rg" | ||
} | ||
|
||
data "azurerm_virtual_network" "weu_prod01" { | ||
name = "${local.project_weu}-prod01-vnet" | ||
resource_group_name = "${local.project_weu}-prod01-vnet-rg" | ||
} | ||
|
||
data "terraform_remote_state" "core" { | ||
backend = "azurerm" | ||
|
||
config = { | ||
resource_group_name = "terraform-state-rg" | ||
storage_account_name = "iopitntfst001" | ||
container_name = "terraform-state" | ||
key = "io-infra.core.prod.italynorth.tfstate" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
terraform { | ||
required_providers { | ||
azurerm = { | ||
source = "hashicorp/azurerm" | ||
version = "<= 3.116.0" | ||
} | ||
} | ||
} | ||
|
||
provider "azurerm" { | ||
features {} | ||
} | ||
|
||
|
||
#-- | ||
module "common_values" { | ||
source = "../../" | ||
} | ||
|
||
output "vnets" { | ||
value = module.common_values.virtual_networks | ||
} | ||
|
||
output "pep_snet" { | ||
value = module.common_values.pep_subnets | ||
} | ||
|
||
output "resource_groups" { | ||
value = module.common_values.resource_groups | ||
} | ||
|
||
output "dns_zones" { | ||
value = module.common_values.dns_zones | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
locals { | ||
prefix = "io" | ||
env_short = "p" | ||
location_short = { | ||
westeurope = "weu", | ||
italynorth = "itn", | ||
germanywestcentral = "gwc", | ||
northeurope = "neu" | ||
} | ||
project_itn = "${local.prefix}-${local.env_short}-${local.location_short.italynorth}" | ||
project_weu = "${local.prefix}-${local.env_short}-${local.location_short.westeurope}" | ||
project_weu_legacy = "${local.prefix}-${local.env_short}" | ||
core = data.terraform_remote_state.core.outputs | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
output "scaling_gate" { | ||
description = <<EOF | ||
WHAT: Name and configuration for gates on release, to be changed at each release with the most up-to-date values | ||
HOW: These values will be used for scaling the different resources (function app, app services, etc.) | ||
EOF | ||
value = { | ||
name = "gate1" | ||
timezone = "W. Europe Standard Time" | ||
start = "2024-10-23T08:00:00.000Z" | ||
end = "2024-10-23T22:00:00.000Z" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
output "resource_groups" { | ||
description = <<EOF | ||
WHAT: All resource groups into itn and weu regions | ||
EOF | ||
value = { | ||
weu = { | ||
common = "${local.project_weu_legacy}-rg-common" | ||
internal = "${local.project_weu_legacy}-rg-internal" | ||
external = "${local.project_weu_legacy}-rg-external" | ||
event = "${local.project_weu_legacy}-evt-rg" | ||
sec = "${local.project_weu_legacy}-sec-rg" | ||
linux = "${local.project_weu_legacy}-rg-linux" | ||
}, | ||
itn = { | ||
common = "${local.project_itn}-common-rg-01" | ||
internal = "${local.project_itn}-common-rg-01" | ||
external = "${local.project_itn}-common-rg-01" | ||
event = "${local.project_itn}-common-rg-01" | ||
sec = "${local.project_itn}-sec-rg-01" | ||
linux = "${local.project_itn}-common-rg-01" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
output "virtual_networks" { | ||
description = <<EOF | ||
WHAT: All vnets into itn and weu regions | ||
EOF | ||
value = { | ||
itn = { | ||
common = local.core.networking.itn.vnet_common | ||
} | ||
weu = { | ||
common = local.core.networking.weu.vnet_common | ||
beta = { | ||
name = data.azurerm_virtual_network.weu_beta.name | ||
resource_group_name = data.azurerm_virtual_network.weu_beta.resource_group_name | ||
} | ||
prod01 = { | ||
name = data.azurerm_virtual_network.weu_prod01.name | ||
resource_group_name = data.azurerm_virtual_network.weu_prod01.resource_group_name | ||
} | ||
} | ||
} | ||
} | ||
|
||
output "pep_subnets" { | ||
description = <<EOF | ||
WHAT: Private Endpoint dedicated subnets into itn and weu regions | ||
EOF | ||
value = { | ||
itn = { | ||
id = local.core.networking.itn.pep_snet.id | ||
}, | ||
weu = { | ||
id = local.core.networking.weu.pep_snet.id | ||
} | ||
} | ||
} | ||
|
||
output "dns_zones" { | ||
description = <<EOF | ||
WHAT: All common dns zones | ||
EOF | ||
value = { | ||
io_italia = { | ||
name = "io.italia.it" | ||
resource_group_name = "${local.project_weu_legacy}-rg-external" | ||
} | ||
io_papopa = { | ||
name = "io.pagopa.it" | ||
resource_group_name = "${local.project_weu_legacy}-rg-external" | ||
} | ||
io_selfcare = { | ||
name = "io.selfcare.pagopa.it" | ||
resource_group_name = "${local.project_weu_legacy}-rg-external" | ||
} | ||
firmaconio_selfcare = { | ||
name = "firmaconio.selfcare.pagopa.it" | ||
resource_group_name = "${local.project_weu_legacy}-rg-external" | ||
} | ||
io_web = { | ||
name = "ioapp.it" | ||
resource_group_name = "${local.project_weu_legacy}-rg-external" | ||
} | ||
} | ||
} |