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

Enable blob versioning for storage account #962

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions infrastructure/products/azure_arm.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ resource "azurerm_storage_account" "backend" {
account_tier = "Standard"
account_replication_type = "GRS"

blob_properties {
versioning_enabled = true
}

tags = merge({

}, local.default_tags)
Expand Down Expand Up @@ -240,8 +244,8 @@ resource "azurerm_role_assignment" "product_admins_contributor" {

# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/role_assignment
resource "azurerm_role_assignment" "product_reader_storage_blob_reader_data_access" {
scope = azurerm_storage_container.container.resource_manager_id
principal_id = azuread_group.product_admins.object_id
scope = azurerm_storage_account.backend.id
principal_id = azuread_group.product_readers.object_id
role_definition_name = data.azurerm_role_definition.storage_blob_reader_data_access.name
# skip_service_principal_aad_check = true
}
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/products/entra.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ data "azuread_service_principal" "msgraph" {

# https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application
resource "azuread_application" "administrator" {
display_name = "GitHub: ${lower(local.configuration.admin.github.owner)}/${lower(local.configuration.admin.github.repository)} - Admin"
display_name = "GitHub: ${local.configuration.admin.github.owner}/${lower(local.configuration.admin.github.repository)} - Admin"
# prevent_duplicate_names = true
}

# https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/application
resource "azuread_application" "reader" {
display_name = "GitHub: ${lower(local.configuration.admin.github.owner)}/${lower(local.configuration.admin.github.repository)} - Reader"
display_name = "GitHub: ${local.configuration.admin.github.owner}/${lower(local.configuration.admin.github.repository)} - Reader"
# prevent_duplicate_names = true
}

Expand Down
2 changes: 1 addition & 1 deletion products.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
admin:
github:
owner: altinn
owner: Altinn
repository: altinn-platform

products:
Expand Down
Loading