Skip to content
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-208] - Create iopcgnlegalbackupstorage replica in itn #1263

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -37,3 +37,23 @@ resource "azurerm_private_endpoint" "private_endpoint_storage_account_legal_back
private_dns_zone_ids = [data.azurerm_private_dns_zone.privatelink_blob_core.id]
}
}

### ITN
module "azure_storage_account" {
source = "github.com/pagopa/dx//infra/modules/azure_storage_account?ref=main"
environment = merge(var.environment, { app_name = "legalbackupstorage" })
christian-calabrese marked this conversation as resolved.
Show resolved Hide resolved

tier = "l"
resource_group_name = var.resource_group_name

subnet_pep_id = var.subnet_pendpoints_id
private_dns_zone_resource_group_name = var.resource_group_common

force_public_network_access_enabled = true

subservices_enabled = {
blob = true
}

tags = var.tags
}
17 changes: 17 additions & 0 deletions src/domains/cgn/_modules/storage_accounts/variables.tf
Original file line number Diff line number Diff line change
@@ -22,3 +22,20 @@ variable "subnet_pendpoints_id" {
type = string
description = "Id of the subnet which holds private endpoints"
}

variable "environment" {
type = object({
prefix = string
env_short = string
location = string
domain = optional(string)
instance_number = string
})

description = "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."
}

variable "resource_group_common" {
type = string
description = "Name of the common resource group"
}
1 change: 1 addition & 0 deletions src/domains/cgn/prod/README.md
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ No providers.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_apim"></a> [apim](#module\_apim) | ../_modules/apim | n/a |
| <a name="module_common_values"></a> [common\_values](#module\_common\_values) | ../../_modules/common_values | n/a |
| <a name="module_cosmos"></a> [cosmos](#module\_cosmos) | ../_modules/cosmos | n/a |
| <a name="module_functions"></a> [functions](#module\_functions) | ../_modules/functions_apps | n/a |
| <a name="module_networking"></a> [networking](#module\_networking) | ../_modules/networking | n/a |
8 changes: 8 additions & 0 deletions src/domains/cgn/prod/locals.tf
Original file line number Diff line number Diff line change
@@ -6,6 +6,14 @@ locals {
location = "westeurope"
secondary_location = "italynorth"

itn_environment = {
prefix = local.prefix
env_short = local.env_short
location = local.secondary_location
domain = "cgn"
instance_number = "01"
}

tags = {
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
CreatedBy = "Terraform"
4 changes: 4 additions & 0 deletions src/domains/cgn/prod/main.tf
Original file line number Diff line number Diff line change
@@ -18,3 +18,7 @@ terraform {
provider "azurerm" {
features {}
}

module "common_values" {
source = "../../../_modules/common_values"
}
3 changes: 3 additions & 0 deletions src/domains/cgn/prod/storage_accounts.tf
Original file line number Diff line number Diff line change
@@ -7,5 +7,8 @@ module "storage_accounts" {

subnet_pendpoints_id = module.networking.subnet_pendpoints.id

environment = local.itn_environment
resource_group_common = module.common_values.resource_groups.weu.common

tags = local.tags
}