-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Label order #36
Label order #36
Conversation
* 'master' of github.com:cloudposse/terraform-null-label: Added missing environment output (#32)
… in the id output and Name tag
Yes, it works as needed with following setup: module "label1" {
source = "github.com/cloudposse/terraform-null-label?ref=label-order"
namespace = "test"
environment = ""
stage = "dev"
name = "fe"
label_order = [ "namespace", "name", "stage"]
}
output "label1" {
value = {
id = "${module.label1.id}"
}
} Produces on apply: Outputs:
label1 = {
id = test-fe-dev
} However, I am not using it as is. I am using label through following projects: https://github.com/cloudposse/terraform-aws-cicd |
I tried to use this simpler and more scalable pattern to generate
It worked OK when After uncommenting it, started to throw errors: And that’s because we introduced a resource (even if it’s So I ended up using this pattern from @Jamie-BitFlight (simplified a little bit):
Works OK for all scenarios including |
A new variable that allows for providing a
label_order
as a list to specify which variables and in what order they go into theid
output andName
tag.The list can include all or none of the a variable names:
"namespace", "environment", "stage", "name", "attributes"
Resolves #35
Usage:
Outputs: