Skip to content

Commit

Permalink
feat: add cors rules for file share service (#221)
Browse files Browse the repository at this point in the history
* feat(cors): add cors rules for file share

* Update variables.tf

Co-authored-by: Henrik Simonsen Knutsen <[email protected]>

---------

Co-authored-by: Henrik Simonsen Knutsen <[email protected]>
  • Loading branch information
BouvetMorten and hknutsen authored Apr 8, 2024
1 parent 7801adc commit 608cc60
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
12 changes: 12 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ resource "azurerm_storage_account" "this" {
retention_policy {
days = var.share_retention_policy_days
}

dynamic "cors_rule" {
for_each = var.share_cors_rules

content {
allowed_headers = cors_rule.value["allowed_headers"]
allowed_methods = cors_rule.value["allowed_methods"]
allowed_origins = cors_rule.value["allowed_origins"]
exposed_headers = cors_rule.value["exposed_headers"]
max_age_in_seconds = cors_rule.value["max_age_in_seconds"]
}
}
}
}

Expand Down
15 changes: 15 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,21 @@ variable "share_retention_policy_days" {
}
}

variable "share_cors_rules" {
description = "A list of CORS rules to configure for this File Storage."

type = list(object({
allowed_headers = list(string)
allowed_methods = list(string)
allowed_origins = list(string)
exposed_headers = list(string)
max_age_in_seconds = number
}))

default = []
nullable = false
}

variable "system_assigned_identity_enabled" {
description = "Should the system-assigned identity be enabled for this Web App?"
type = bool
Expand Down

0 comments on commit 608cc60

Please sign in to comment.