-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remove envs and sort attrs * sort tags module attr * add example * introduce locals * add outputs
- Loading branch information
Showing
7 changed files
with
80 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,59 @@ | ||
# basic example | ||
A basic example for this repository | ||
|
||
## Code | ||
Look to [main.tf](./main.tf), or be helpful and copy/paste that code here. | ||
|
||
## Applying | ||
``` | ||
> alias tf="terraform" | ||
> tf apply | ||
Apply complete! Resources: 0 added, 0 changed, 0 destroyed. | ||
Outputs: | ||
example = { | ||
"tags_module" = { | ||
"name" = "TEST" | ||
"name32" = "TEST" | ||
"name6" = "TEST" | ||
"namenosymbols" = "TEST" | ||
"tags" = { | ||
"Name" = "TEST" | ||
"terraform_managed" = true | ||
"terraform_module" = "terraform-terraform-tags-1.0.0" | ||
"terraform_root_module" = "." | ||
"terraform_workspace" = "default" | ||
} | ||
"tags_as_list_of_maps" = [ | ||
{ | ||
"key" = "Name" | ||
"value" = "TEST" | ||
}, | ||
{ | ||
"key" = "terraform_managed" | ||
"value" = true | ||
}, | ||
{ | ||
"key" = "terraform_module" | ||
"value" = "terraform-terraform-tags-1.0.0" | ||
}, | ||
{ | ||
"key" = "terraform_root_module" | ||
"value" = "." | ||
}, | ||
{ | ||
"key" = "terraform_workspace" | ||
"value" = "default" | ||
}, | ||
] | ||
"tags_no_name" = { | ||
"terraform_managed" = true | ||
"terraform_module" = "terraform-terraform-tags-1.0.0" | ||
"terraform_root_module" = "." | ||
"terraform_workspace" = "default" | ||
} | ||
} | ||
} | ||
``` |
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,4 +1,10 @@ | ||
|
||
module "example" { | ||
source = "../.." | ||
|
||
name = "test" | ||
} | ||
|
||
output "example" { | ||
value = module.example | ||
} |
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,5 @@ | ||
|
||
locals { | ||
name = module.tags.name | ||
tags = module.tags.tags_no_name | ||
} |
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,5 @@ | ||
|
||
output "tags_module" { | ||
description = "Tags Module in it's entirety" | ||
value = module.tags | ||
} |
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