Skip to content

Commit

Permalink
Ignore .DS_Store and *.md.tmp files and adjusted TODO references (
Browse files Browse the repository at this point in the history
#83)

* Ignore `.DS_Store` and `*.md.tmp` files

* Adjusted TODO references to keep TF linter green for fresh modules

* adjusted
  • Loading branch information
segraef authored Feb 8, 2024
1 parent 6571141 commit 0983657
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ README-generated.md
avm.tflint.hcl
avm.tflint_example.hcl
*tfplan*
*.md.tmp

# MacOS
.DS_Store
2 changes: 1 addition & 1 deletion examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ module "test" {
# source = "Azure/avm-<res/ptn>-<name>/azurerm"
# ...
enable_telemetry = var.enable_telemetry # see variables.tf
name = "" # TODO update with module.naming.<RESOURCE_TYPE>.name_unique
name = "TODO" # TODO update with module.naming.<RESOURCE_TYPE>.name_unique
resource_group_name = azurerm_resource_group.this.name
}
2 changes: 1 addition & 1 deletion main.privateendpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "azurerm_private_endpoint" "this" {

private_service_connection {
name = each.value.private_service_connection_name != null ? each.value.private_service_connection_name : "pse-${var.name}"
private_connection_resource_id = azurerm_TODO.this.id
private_connection_resource_id = azurerm_resource_group.TODO.id # TODO: Replace this dummy resource azurerm_resource_group.TODO with your module resource
is_manual_connection = false
subresource_names = ["TODO subresource name, see https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-overview#private-link-resource"]
}
Expand Down
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ data "azurerm_resource_group" "parent" {
name = var.resource_group_name
}

resource "azurerm_TODO_the_resource_for_this_module" "this" {
# 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
resource_group_name = var.resource_group_name
location = coalesce(var.location, local.resource_group_location)
# etc
}
Expand All @@ -15,13 +15,13 @@ resource "azurerm_TODO_the_resource_for_this_module" "this" {
resource "azurerm_management_lock" "this" {
count = var.lock.kind != "None" ? 1 : 0
name = coalesce(var.lock.name, "lock-${var.name}")
scope = azurerm_TODO_resource.this.id
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_TODO_resource.this.id
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
principal_id = each.value.principal_id
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# 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_this_module_resource.this
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."
}

Expand Down
5 changes: 2 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ variable "name" {
type = string
description = "The name of the this resource."
validation {
condition = can(regex("TODO determine REGEX", var.name))
error_message = "The name must be TODO."
# TODO remove the example below once complete:
condition = can(regex("TODO", var.name))
error_message = "The name must be TODO." # TODO remove the example below once complete:
#condition = can(regex("^[a-z0-9]{5,50}$", var.name))
#error_message = "The name must be between 5 and 50 characters long and can only contain lowercase letters and numbers."
}
Expand Down

0 comments on commit 0983657

Please sign in to comment.