Skip to content

Commit a580376

Browse files
DSakura207shibayan
andauthored
Enhancement for better resource life cycle (#38)
* Ignore tag changes for resources * Ignore tags and manual added auth Co-authored-by: Tatsuro Shibamura <[email protected]>
1 parent 2332e31 commit a580376

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

main.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ resource "azurerm_storage_account" "storage" {
88
enable_https_traffic_only = true
99
allow_nested_items_to_be_public = false
1010
min_tls_version = "TLS1_2"
11+
lifecycle {
12+
ignore_changes = [
13+
tags
14+
]
15+
}
1116
}
1217

1318
resource "azurerm_service_plan" "serverfarm" {
@@ -17,6 +22,11 @@ resource "azurerm_service_plan" "serverfarm" {
1722

1823
os_type = "Windows"
1924
sku_name = "Y1"
25+
lifecycle {
26+
ignore_changes = [
27+
tags
28+
]
29+
}
2030
}
2131

2232
resource "azurerm_log_analytics_workspace" "workspace" {
@@ -25,6 +35,11 @@ resource "azurerm_log_analytics_workspace" "workspace" {
2535
location = var.location
2636
sku = "PerGB2018"
2737
retention_in_days = 30
38+
lifecycle {
39+
ignore_changes = [
40+
tags
41+
]
42+
}
2843
}
2944

3045
resource "azurerm_application_insights" "insights" {
@@ -33,6 +48,11 @@ resource "azurerm_application_insights" "insights" {
3348
location = var.location
3449
application_type = "web"
3550
workspace_id = azurerm_log_analytics_workspace.workspace.id
51+
lifecycle {
52+
ignore_changes = [
53+
tags
54+
]
55+
}
3656
}
3757

3858
resource "azurerm_windows_function_app" "function" {
@@ -85,4 +105,12 @@ resource "azurerm_windows_function_app" "function" {
85105
}
86106
}
87107
}
108+
109+
lifecycle {
110+
ignore_changes = [
111+
tags,
112+
app_settings["MICROSOFT_PROVIDER_AUTHENTICATION_SECRET"],
113+
sticky_settings["app_setting_names"]
114+
]
115+
}
88116
}

0 commit comments

Comments
 (0)