-
Notifications
You must be signed in to change notification settings - Fork 571
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
Avoid continuous destroy and create of azapi_resource diag_settings #952
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,11 +77,12 @@ resource "azurerm_management_group" "level_6" { | |
} | ||
|
||
# This will deploy Diagnostic Settings for the Management Groups | ||
# when the input variable deploy_diagnostics_for_mg is true | ||
# when the input variable deploy_diagnostics_for_mg is true | ||
resource "azapi_resource" "diag_settings" { | ||
for_each = local.azapi_mg_diagnostics | ||
type = "Microsoft.Insights/diagnosticSettings@2021-05-01-preview" | ||
name = "toLA" | ||
location = local.diag_settings_location | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please can we use default location There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes you can use default_location |
||
parent_id = each.key | ||
body = jsonencode({ | ||
properties = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -626,6 +626,12 @@ variable "default_location" { | |
description = "Must be specified, e.g `eastus`. Will set the Azure region in which region bound resources will be deployed. Please see: https://azure.microsoft.com/en-gb/global-infrastructure/geographies/" | ||
} | ||
|
||
variable "diag_settings_location" { | ||
type = string | ||
description = "Will set the Azure region in which region azapi diagnostic settings will be deployed. Please see: https://azure.microsoft.com/en-gb/global-infrastructure/geographies/" | ||
default = null | ||
} | ||
|
||
Comment on lines
+629
to
+634
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we remove this and use default location please? |
||
variable "default_tags" { | ||
type = map(string) | ||
description = "If specified, will set the default tags for all resources deployed by this module where supported." | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again please can we use default location?