generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmain.tf
45 lines (39 loc) · 1.35 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
resource "azurerm_static_web_app" "this" {
location = coalesce(var.location)
name = var.name
resource_group_name = var.resource_group_name
app_settings = var.app_settings
configuration_file_changes_enabled = var.configuration_file_changes_enabled
preview_environments_enabled = var.preview_environments_enabled
sku_size = var.sku_size
sku_tier = var.sku_tier
tags = var.tags
dynamic "basic_auth" {
for_each = var.basic_auth_enabled ? ["basic_auth"] : []
content {
environments = var.basic_auth.environments
password = var.basic_auth.password
}
}
dynamic "identity" {
for_each = local.managed_identities.system_assigned_user_assigned
content {
type = identity.value.type
identity_ids = identity.value.user_assigned_resource_ids
}
}
}
resource "azapi_update_resource" "this" {
count = var.repository_url != null ? 1 : 0
type = "Microsoft.Web/staticSites@2022-03-01"
body = jsonencode({
properties = {
repositoryUrl = var.repository_url
branch = coalesce(var.branch, "main")
}
})
resource_id = azurerm_static_web_app.this.id
depends_on = [
azurerm_static_web_app.this
]
}