Skip to content

Commit

Permalink
Merge pull request #2 from data-platform-hq/fix-identity
Browse files Browse the repository at this point in the history
fix: identity and free tier
  • Loading branch information
kharkevich authored Jan 5, 2023
2 parents 4faf289 + 565d489 commit d2e74f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ resource "azurerm_static_site" "this" {
sku_tier = var.sku_tier
sku_size = var.sku_size
tags = var.tags
identity {
type = var.identity_ids == null ? "SystemAssigned" : "SystemAssigned, UserAssigned"
identity_ids = var.identity_ids
dynamic "identity" {
for_each = var.sku_tier == "Free" ? toset([]) : toset([1])
content {
type = var.identity_ids == null ? "SystemAssigned" : "SystemAssigned, UserAssigned"
identity_ids = var.identity_ids
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ variable "name" {

variable "identity_ids" {
type = list(string)
description = "List of user assigned identity IDs"
description = "List of user assigned identity IDs (cannot be used with Free SKU)"
default = null
# TODO: add validation after fix https://github.com/hashicorp/terraform/issues/25609
}

variable "sku_tier" {
Expand Down

0 comments on commit d2e74f3

Please sign in to comment.