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

Add a new storage container for config #232

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion operations/template/storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,25 @@ resource "azurerm_storage_account_customer_managed_key" "storage_storage_account
] //wait for the permission that allows our deployer to write the secret
}


resource "azurerm_storage_container" "sftp_container" {
name = "sftp"
storage_account_name = azurerm_storage_account.storage.name
container_access_type = "private"
}

// Used in case of event dead letter
resource "azurerm_storage_container" "sftp_container_dead_letter" {
name = "sftp-dead-letter"
storage_account_name = azurerm_storage_account.storage.name
container_access_type = "private"
}

resource "azurerm_storage_container" "config_container" {
somesylvie marked this conversation as resolved.
Show resolved Hide resolved
name = "config"
storage_account_name = azurerm_storage_account.storage.name
container_access_type = "private"
}

resource "azurerm_role_assignment" "allow_app_read_write" {
scope = azurerm_storage_account.storage.id
role_definition_name = "Storage Blob Data Contributor"
Expand All @@ -70,6 +76,9 @@ resource "azurerm_storage_management_policy" "retention_policy" {

filters {
blob_types = ["blockBlob", "appendBlob"]
// Only apply the retention policy to the SFTP containers so that we don't delete our config
// Any containers that may contain PHI **must** be included in this prefix_match list
prefix_match = ["sftp/", "sftp-dead-letter/"]
}

actions {
Expand Down