Skip to content

Commit

Permalink
fix: add module comment and chnage label order
Browse files Browse the repository at this point in the history
  • Loading branch information
mamrajyadav committed Jan 2, 2024
1 parent 786aab3 commit e7168dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ usage: |-
Application = "CloudDrove"
}
}
```
```
6 changes: 4 additions & 2 deletions _example/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ provider "azurerm" {
features {}
}

##-----------------------------------------------------------------------------
## Labels module call.
##-----------------------------------------------------------------------------
module "labels" {
source = "./../"

source = "./../"
name = "labels"
environment = "test"
label_order = ["name", "environment"]
Expand Down
14 changes: 5 additions & 9 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
## Managed By : CloudDrove
## Copyright @ CloudDrove. All Right Reserved.

#Module : locals
#Description : This terraform module is designed to generate consistent label names and tags for resources. You can use terraform-labels to implement a strict naming convention.

##-----------------------------------------------------------------------------
## This terraform module is designed to generate consistent label names and tags for resources. You can use terraform-labels to implement a strict naming convention.
##-----------------------------------------------------------------------------
locals {
label_order_defaults = {
label_order = ["environment", "name"]
label_order = ["name", "environment"]
}

id_context = {
Expand Down Expand Up @@ -38,6 +35,5 @@ locals {
}

generated_tags = { for l in keys(local.tags_context) : title(l) => local.tags_context[l] if length(local.tags_context[l]) > 0 }

tags = merge(local.generated_tags, var.extra_tags)
tags = merge(local.generated_tags, var.extra_tags)
}

0 comments on commit e7168dd

Please sign in to comment.