Skip to content

Commit

Permalink
Merge pull request #562 from aztfmod/integration/5.4.1
Browse files Browse the repository at this point in the history
Integration/5.4.1
  • Loading branch information
arnaudlh authored Jul 6, 2021
2 parents 2a9caf6 + 8c3b187 commit 372435a
Show file tree
Hide file tree
Showing 51 changed files with 1,567 additions and 177 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/standalone-scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"compute/virtual_machine/106-marketplace-image-with-plan",
"compute/virtual_machine/210-vm-bastion-winrm",
"compute/virtual_machine/211-vm-bastion-winrm-agents",
"consumption_budget/100-consumption-budget-rg",
"consumption_budget/101-consumption-budget-subscription",
"consumption_budget/102-consumption-budget-rg-alerts",
"consumption_budget/103-consumption-budget-subscription-alerts",
"compute/virtual_machine_scale_set/100-linux-win-vmss-lb",
"compute/virtual_machine_scale_set/101-linux-win-vmss-agw",
"compute/windows_virtual_desktop/wvd_resources",
Expand Down Expand Up @@ -58,6 +62,9 @@
"mariadb_server/102-private-endpoint-mariadb",
"mariadb_server/103-private-endpoint-with-fw-rule-mariadb",
"monitoring/100-service-health-alerts",
"monitoring/101-monitor-action-groups",
"mssql_server/101-sqlserver-simple",
"mssql_server/102-sqlserver-extend",
"mssql_server/104-sqlserver-elastic_pools",
"mssql_server/105-sqlserver-failover_groups",
"mssql_server/107-sqlserver-db-retention-policy",
Expand All @@ -68,6 +75,7 @@
"mysql_server/102-private-endpoint-mysql",
"mysql_server/103-private-endpoint-with-fw-rule-mysql",
"netapp/101-nfs",
"netapp/102-nfs-export-policy",
"networking/bastion/100-bastion-with-vm",
"networking/dns_zones/100-simple-dns_zone",
"networking/express_routes",
Expand Down
50 changes: 25 additions & 25 deletions application_gateways.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@ module "application_gateways" {
source = "./modules/networking/application_gateway"
for_each = local.networking.application_gateways

app_services = local.combined_objects_app_services
app_services = local.combined_objects_app_services
application_gateway_waf_policies = local.combined_objects_application_gateway_waf_policies
client_config = local.client_config
diagnostics = local.combined_diagnostics
dns_zones = local.combined_objects_dns_zones
global_settings = local.global_settings
keyvault_certificate_requests = module.keyvault_certificate_requests
keyvault_certificates = module.keyvault_certificates
keyvaults = local.combined_objects_keyvaults
managed_identities = local.combined_objects_managed_identities
private_dns = lookup(each.value, "private_dns_records", null) == null ? {} : local.combined_objects_private_dns
public_ip_addresses = local.combined_objects_public_ip_addresses
settings = each.value
sku_name = each.value.sku_name
sku_tier = each.value.sku_tier
vnets = local.combined_objects_networking
client_config = local.client_config
diagnostics = local.combined_diagnostics
dns_zones = local.combined_objects_dns_zones
global_settings = local.global_settings
keyvault_certificate_requests = module.keyvault_certificate_requests
keyvault_certificates = module.keyvault_certificates
keyvaults = local.combined_objects_keyvaults
managed_identities = local.combined_objects_managed_identities
private_dns = lookup(each.value, "private_dns_records", null) == null ? {} : local.combined_objects_private_dns
public_ip_addresses = local.combined_objects_public_ip_addresses
settings = each.value
sku_name = each.value.sku_name
sku_tier = each.value.sku_tier
vnets = local.combined_objects_networking

application_gateway_applications = {
for key, value in local.networking.application_gateway_applications : key => value
if value.application_gateway_key == each.key
}

resource_group_name = coalesce (
try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][each.value.resource_group.key].name,null),
try(local.combined_objects_resource_groups[local.client_config.landingzone_key][each.value.resource_group_key].name,null)
resource_group_name = coalesce(
try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][each.value.resource_group.key].name, null),
try(local.combined_objects_resource_groups[local.client_config.landingzone_key][each.value.resource_group_key].name, null)
)
base_tags = try(local.global_settings.inherit_tags, false) ? coalesce(
try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][each.value.resource_group.key].tags,null),
try(local.combined_objects_resource_groups[local.client_config.landingzone_key][each.value.resource_group_key].tags,null)
base_tags = try(local.global_settings.inherit_tags, false) ? coalesce(
try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][each.value.resource_group.key].tags, null),
try(local.combined_objects_resource_groups[local.client_config.landingzone_key][each.value.resource_group_key].tags, null)
) : {}
location = lookup(each.value, "region", null) == null ? coalesce(
try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][each.value.resource_group.key].location,null),
try(local.combined_objects_resource_groups[local.client_config.landingzone_key][each.value.resource_group_key].location,null)
) : local.global_settings.regions[each.value.region]
location = lookup(each.value, "region", null) == null ? coalesce(
try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][each.value.resource_group.key].location, null),
try(local.combined_objects_resource_groups[local.client_config.landingzone_key][each.value.resource_group_key].location, null)
) : local.global_settings.regions[each.value.region]
}

output "application_gateways" {
Expand Down
42 changes: 42 additions & 0 deletions consumption_budgets.tf
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
}
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"]
}
}
}
}
}
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"]
}
}
}
}
}
Loading

0 comments on commit 372435a

Please sign in to comment.