Skip to content

Commit

Permalink
Added storage account connection string secret.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGHippo committed Jul 26, 2024
1 parent bd3c27b commit 7a4c74f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module "storage" {

location = var.azure_region
resource_group = azurerm_resource_group.rg.name
kv_id = module.network.kv_id
tags = local.common_tags
}

Expand Down
7 changes: 7 additions & 0 deletions terraform/modules/azure-storage/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ resource "azurerm_storage_container" "data_protection" {

#checkov:skip=CKV2_AZURE_21:Logging not required
}

resource "azurerm_key_vault_secret" "storage_connection_string" {
name = "Storage--ConnectionString"
value = azurerm_storage_account.sa.primary_connection_string
key_vault_id = var.kv_id
}

7 changes: 6 additions & 1 deletion terraform/modules/azure-storage/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ variable "resource_group" {
type = string
}

variable "kv_id" {
description = "The ID of the Key Vault"
type = string
}

variable "tags" {
description = "Resource tags"
type = map(string)
}
}

0 comments on commit 7a4c74f

Please sign in to comment.