-
Notifications
You must be signed in to change notification settings - Fork 708
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #562 from aztfmod/integration/5.4.1
Integration/5.4.1
- Loading branch information
Showing
51 changed files
with
1,567 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module "consumption_budgets_resource_groups" { | ||
source = "./modules/consumption_budget/resource_group" | ||
for_each = { | ||
for key, value in local.shared_services.consumption_budgets : key => value | ||
if try(value.resource_group, null) != null | ||
} | ||
|
||
client_config = local.client_config | ||
global_settings = local.global_settings | ||
monitor_action_groups = local.combined_objects_monitor_action_groups | ||
# lz_key used in dimension to reference remote state | ||
resource_groups = local.combined_objects_resource_groups | ||
settings = each.value | ||
} | ||
|
||
module "consumption_budgets_subscriptions" { | ||
source = "./modules/consumption_budget/subscription" | ||
for_each = { | ||
for key, value in local.shared_services.consumption_budgets : key => value | ||
if try(value.subscription, null) != null | ||
} | ||
|
||
client_config = local.client_config | ||
global_settings = local.global_settings | ||
monitor_action_groups = local.combined_objects_monitor_action_groups | ||
# lz_key used in dimension to reference remote state | ||
resource_groups = local.combined_objects_resource_groups | ||
settings = each.value | ||
subscription_id = coalesce( | ||
try(each.value.subscription.id, null), | ||
try(local.combined_objects_subscriptions[try(each.value.subscription.lz_key, local.client_config.landingzone_key)][each.value.subscription.key].subscription_id, null), | ||
local.client_config.subscription_id | ||
) | ||
} | ||
|
||
output "consumption_budgets_resource_groups" { | ||
value = module.consumption_budgets_resource_groups | ||
} | ||
|
||
output "consumption_budgets_subscriptions" { | ||
value = module.consumption_budgets_subscriptions | ||
} |
112 changes: 112 additions & 0 deletions
112
examples/consumption_budget/100-consumption-budget-rg/configuration.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
global_settings = { | ||
default_region = "region1" | ||
regions = { | ||
region1 = "southeastasia" | ||
} | ||
random_length = 5 | ||
} | ||
|
||
resource_groups = { | ||
test = { | ||
name = "test" | ||
} | ||
} | ||
|
||
consumption_budgets = { | ||
test_budget = { | ||
resource_group = { | ||
# accepts either id or key to get resource group id | ||
# id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1" | ||
# lz_key = "examples" | ||
key = "test" | ||
} | ||
name = "example" | ||
amount = 1000 | ||
time_grain = "Monthly" | ||
time_period = { | ||
# uncomment to customize start_date | ||
# start_date = "2022-06-01T00:00:00Z" | ||
} | ||
notifications = { | ||
default = { | ||
enabled = true | ||
threshold = 95.0 | ||
operator = "EqualTo" | ||
contact_emails = [ | ||
"[email protected]", | ||
"[email protected]", | ||
] | ||
} | ||
contact_email = { | ||
enabled = true | ||
threshold = 90.0 | ||
operator = "EqualTo" | ||
contact_emails = [ | ||
"[email protected]", | ||
"[email protected]", | ||
] | ||
} | ||
contact_role = { | ||
enabled = true | ||
threshold = 80.0 | ||
operator = "EqualTo" | ||
contact_roles = [ | ||
"Owner", | ||
] | ||
} | ||
} | ||
filter = { | ||
dimensions = { | ||
explicit_name = { | ||
name = "ResourceGroupName" | ||
operator = "In" | ||
values = [ | ||
"example", | ||
] | ||
}, | ||
resource_group_key = { | ||
# lz_key = "examples" | ||
name = "resource_group_key" | ||
values = [ | ||
"test", | ||
] | ||
} | ||
} | ||
tags = { | ||
tag_example_default_operator = { | ||
name = "level", | ||
values = ["100"] | ||
}, | ||
tag_example_explicit_operator = { | ||
name = "mode", | ||
operator = "In" | ||
values = ["test"] | ||
} | ||
} | ||
not = { | ||
# dimension and tag block conflicts | ||
# dimension = { | ||
# # not block supports only one dimension block | ||
# # explicit_name = { | ||
# # name = "ResourceGroupName" | ||
# # operator = "In" | ||
# # values = [ | ||
# # "example", | ||
# # ] | ||
# # }, | ||
# resource_group_key = { | ||
# # lz_key = "examples" | ||
# name = "resource_group_key" | ||
# values = [ | ||
# "test", | ||
# ] | ||
# } | ||
# } | ||
tag = { | ||
name = "name" | ||
values = ["not-tag"] | ||
} | ||
} | ||
} | ||
} | ||
} |
111 changes: 111 additions & 0 deletions
111
examples/consumption_budget/101-consumption-budget-subscription/configuration.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
global_settings = { | ||
default_region = "region1" | ||
regions = { | ||
region1 = "southeastasia" | ||
} | ||
random_length = 5 | ||
} | ||
|
||
resource_groups = { | ||
test = { | ||
name = "test" | ||
} | ||
} | ||
|
||
consumption_budgets = { | ||
test_budget = { | ||
subscription = { | ||
# id = "<subscription_id>" | ||
# lz_key = "" | ||
# key = "" | ||
} | ||
name = "example" | ||
amount = 1000 | ||
time_grain = "Monthly" | ||
time_period = { | ||
# uncomment to customize start_date | ||
# start_date = "2022-06-01T00:00:00Z" | ||
} | ||
notifications = { | ||
default = { | ||
enabled = true | ||
threshold = 95.0 | ||
operator = "EqualTo" | ||
contact_emails = [ | ||
"[email protected]", | ||
"[email protected]", | ||
] | ||
} | ||
contact_email = { | ||
enabled = true | ||
threshold = 90.0 | ||
operator = "EqualTo" | ||
contact_emails = [ | ||
"[email protected]", | ||
"[email protected]", | ||
] | ||
} | ||
contact_role = { | ||
enabled = true | ||
threshold = 80.0 | ||
operator = "EqualTo" | ||
contact_roles = [ | ||
"Owner", | ||
] | ||
} | ||
} | ||
filter = { | ||
dimensions = { | ||
explicit_name = { | ||
name = "ResourceGroupName" | ||
operator = "In" | ||
values = [ | ||
"example", | ||
] | ||
}, | ||
resource_group_key = { | ||
# lz_key = "examples" | ||
name = "resource_group_key" | ||
values = [ | ||
"test", | ||
] | ||
} | ||
} | ||
tags = { | ||
tag_example_default_operator = { | ||
name = "level", | ||
values = ["100"] | ||
}, | ||
tag_example_explicit_operator = { | ||
name = "mode", | ||
operator = "In" | ||
values = ["test"] | ||
} | ||
} | ||
not = { | ||
# dimension and tag block conflicts | ||
# dimension = { | ||
# # not block supports only one dimension block | ||
# # explicit_name = { | ||
# # name = "ResourceGroupName" | ||
# # operator = "In" | ||
# # values = [ | ||
# # "example", | ||
# # ] | ||
# # }, | ||
# resource_group_key = { | ||
# # lz_key = "examples" | ||
# name = "resource_group_key" | ||
# values = [ | ||
# "test", | ||
# ] | ||
# } | ||
# } | ||
tag = { | ||
name = "name" | ||
values = ["not-tag"] | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.