-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecf1c63
commit db845c0
Showing
9 changed files
with
146 additions
and
118 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
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 |
---|---|---|
@@ -1,14 +1,16 @@ | ||
resource "random_id" "telem" { | ||
count = var.enable_telemetry ? 1 : 0 | ||
count = var.enable_telemetry ? 1 : 0 | ||
|
||
byte_length = 4 | ||
} | ||
|
||
# This is the module telemetry deployment that is only created if telemetry is enabled. | ||
# It is deployed to the resource's resource group. | ||
resource "azurerm_resource_group_template_deployment" "telemetry" { | ||
count = var.enable_telemetry ? 1 : 0 | ||
count = var.enable_telemetry ? 1 : 0 | ||
|
||
deployment_mode = "Incremental" | ||
name = local.telem_arm_deployment_name | ||
resource_group_name = var.resource_group_name | ||
deployment_mode = "Incremental" | ||
template_content = local.telem_arm_template_content | ||
} |
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 |
---|---|---|
@@ -1,32 +1,34 @@ | ||
# TODO: insert resources here. | ||
data "azurerm_resource_group" "parent" { | ||
count = var.location == null ? 1 : 0 | ||
name = var.resource_group_name | ||
|
||
name = var.resource_group_name | ||
} | ||
|
||
# TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource | ||
resource "azurerm_resource_group" "TODO" { | ||
name = var.name # calling code must supply the name | ||
location = coalesce(var.location, local.resource_group_location) | ||
# etc | ||
location = coalesce(var.location, local.resource_group_location) | ||
name = var.name # calling code must supply the name | ||
} | ||
|
||
# required AVM resources interfaces | ||
resource "azurerm_management_lock" "this" { | ||
count = var.lock.kind != "None" ? 1 : 0 | ||
count = var.lock.kind != "None" ? 1 : 0 | ||
|
||
lock_level = var.lock.kind | ||
name = coalesce(var.lock.name, "lock-${var.name}") | ||
scope = azurerm_resource_group.TODO.id # TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource | ||
lock_level = var.lock.kind | ||
} | ||
|
||
resource "azurerm_role_assignment" "this" { | ||
for_each = var.role_assignments | ||
scope = azurerm_resource_group.TODO.id # TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource | ||
role_definition_id = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? each.value.role_definition_id_or_name : null | ||
role_definition_name = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? null : each.value.role_definition_id_or_name | ||
for_each = var.role_assignments | ||
|
||
principal_id = each.value.principal_id | ||
scope = azurerm_resource_group.TODO.id # TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource | ||
condition = each.value.condition | ||
condition_version = each.value.condition_version | ||
skip_service_principal_aad_check = each.value.skip_service_principal_aad_check | ||
delegated_managed_identity_resource_id = each.value.delegated_managed_identity_resource_id | ||
role_definition_id = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? each.value.role_definition_id_or_name : null | ||
role_definition_name = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? null : each.value.role_definition_id_or_name | ||
skip_service_principal_aad_check = each.value.skip_service_principal_aad_check | ||
} |
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 |
---|---|---|
@@ -1,13 +1,11 @@ | ||
# TODO: insert outputs here. | ||
output "private_endpoints" { | ||
description = "A map of private endpoints. The map key is the supplied input to var.private_endpoints. The map value is the entire azurerm_private_endpoint resource." | ||
value = azurerm_private_endpoint.this | ||
} | ||
|
||
# Module owners should include the full resource via a 'resource' output | ||
# https://azure.github.io/Azure-Verified-Modules/specs/terraform/#id-tffr2---category-outputs---additional-terraform-outputs | ||
output "resource" { | ||
value = azurerm_resource_group.TODO # TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource | ||
description = "This is the full output for the resource." | ||
} | ||
|
||
output "private_endpoints" { | ||
value = azurerm_private_endpoint.this | ||
description = "A map of private endpoints. The map key is the supplied input to var.private_endpoints. The map value is the entire azurerm_private_endpoint resource." | ||
value = azurerm_resource_group.TODO # TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource | ||
} |
Oops, something went wrong.