Skip to content

Commit

Permalink
Merge branch 'main' into github-repos-iac
Browse files Browse the repository at this point in the history
  • Loading branch information
tomrss authored Oct 24, 2024
2 parents 6d75bed + 02867e1 commit 5cc4332
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/20_appservice.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ resource "azurerm_linux_web_app" "app_api" {
PIPELINE_NAME_SAP = "SendJsonToSap",
SYNAPSE_SUBSCRIPTIONID = data.azurerm_client_config.current.subscription_id
SYNAPSE_RESOURCEGROUPNAME = azurerm_synapse_workspace.this.resource_group_name

STORAGE_FINANCIAL_ACCOUNTNAME = module.public_storage.name
STORAGE_FINANCIAL_ACCOUNTKEY = "@Microsoft.KeyVault(VaultName=${module.key_vault_app.name};SecretName=PublicStorageKey)"
STORAGE_FINANCIAL_CONTAINERNAME = "invoices"
}

site_config {
Expand Down
25 changes: 25 additions & 0 deletions src/core/20_storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,28 @@ resource "azurerm_private_endpoint" "rel_storage_blob" {

tags = var.tags
}

# public access storage with SAS token
module "public_storage" {
source = "./.terraform/modules/__v3__/storage_account/"
name = replace(format("%s-%s", local.project, "public"), "-", "")
resource_group_name = azurerm_resource_group.analytics.name
location = var.secondary_location
account_kind = "StorageV2"
account_tier = "Standard"
access_tier = "Hot"
account_replication_type = "ZRS"
blob_versioning_enabled = true
blob_container_delete_retention_days = var.storage_delete_retention_days
allow_nested_items_to_be_public = false
public_network_access_enabled = true
tags = var.tags
}

#tfsec:ignore:azure-keyvault-content-type-for-secret
#tfsec:ignore:azure-keyvault-ensure-secret-expiry
resource "azurerm_key_vault_secret" "public_storage_key" {
name = "PublicStorageKey"
value = module.public_storage.primary_access_key
key_vault_id = module.key_vault_app.id
}

0 comments on commit 5cc4332

Please sign in to comment.