Skip to content

Commit

Permalink
[CES-718] Removed provider definition inside Storage Account module (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mamu0 authored Feb 3, 2025
1 parent daee5d6 commit 4eb8f9f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-masks-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"azure_storage_account": patch
---

Removed provider definition and test updated
4 changes: 0 additions & 4 deletions infra/modules/azure_storage_account/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ terraform {
}
}

provider "azurerm" {
features {}
}

module "naming_convention" {
source = "pagopa/dx-azure-naming-convention/azurerm"
version = "~> 0"
Expand Down
1 change: 1 addition & 0 deletions infra/modules/azure_storage_account/tests/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_environment"></a> [environment](#input\_environment) | n/a | <pre>object({<br/> prefix = string<br/> env_short = string<br/> location = string<br/> domain = optional(string)<br/> app_name = string<br/> instance_number = string<br/> })</pre> | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Resources tags | `map(any)` | n/a | yes |

## Outputs

Expand Down
4 changes: 4 additions & 0 deletions infra/modules/azure_storage_account/tests/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ resource "azurerm_user_assigned_identity" "user" {
name = "${module.naming_convention.prefix}-user-sa-${module.naming_convention.suffix}"
resource_group_name = azurerm_resource_group.rg.name
location = var.environment.location

tags = var.tags
}


Expand All @@ -43,6 +45,8 @@ data "azurerm_subnet" "pep" {
resource "azurerm_resource_group" "rg" {
name = "${module.naming_convention.prefix}-rg-sa-${module.naming_convention.suffix}"
location = var.environment.location

tags = var.tags
}

output "pep_id" {
Expand Down
5 changes: 5 additions & 0 deletions infra/modules/azure_storage_account/tests/setup/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ variable "environment" {
app_name = string
instance_number = string
})
}

variable "tags" {
type = map(any)
description = "Resources tags"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ run "setup_tests" {
app_name = "test"
instance_number = "01"
}

tags = {
CostCenter = "TS000 - Tecnologia e Servizi"
CreatedBy = "Terraform"
Environment = "Dev"
BusinessUnit = "DevEx"
ManagementTeam = "Developer Experience"
Source = "https://github.com/pagopa/dx/blob/main/infra/modules/azure_storage_account/tests"
Test = "true"
TestName ="Create Storage Account for test"
}
}
}

Expand All @@ -39,13 +50,14 @@ run "storage_account_is_correct_plan" {
}

tags = {
CostCenter = "TS700 - ENGINEERING"
CreatedBy = "Terraform"
Environment = "Dev"
Owner = "DevEx"
CostCenter = "TS000 - Tecnologia e Servizi"
CreatedBy = "Terraform"
Environment = "Dev"
BusinessUnit = "DevEx"
ManagementTeam = "Developer Experience"
Source = "https://github.com/pagopa/dx/blob/main/infra/modules/azure_storage_account/tests"
Test = "true"
TestName = "Create Storage Account for test"
TestName ="Create Storage Account for test"
}

resource_group_name = run.setup_tests.resource_group_name
Expand Down

0 comments on commit 4eb8f9f

Please sign in to comment.