terraform-null-label

Terraform Module to define a consistent naming convention by (namespace, stage, name, [attributes])

APACHE-2.0 License

Stars
633
Committers
27

Bot releases are visible (Hide)

terraform-null-label - v0.25.0 Latest Release

Published by cloudpossebot about 3 years ago

what

  • Add additional label and id component: tenant
  • New input labels_as_tags controls which labels are exported as tags
  • New input descriptor_formats generates new output descriptors
  • Update README, remove link to obsolete terraform-terraform-label

why

  • Support users that host resources on behalf of and/or dedicated to single customers
  • Supersedes and closes #131, giving people control over which tags the module generates
  • Simple mechanism for creating multiple identifiers from the same inputs, reducing the need to create multiple instances of null-label
  • Document tenant, labels_as_tags, descriptor_formats, add additional clarification, stop promoting obsolete module

what

  • Update README snippets to reflect use of Terraform Registry.

why

  • Including snippets that reflect use of the Terraform Registry make it easier for users to quickly instantiate a null_label module.
  • README is out of date and does not include snippets that reflect use of the Terraform Registry.

references

  • N/A

what

  • Resolve Bridgecrew compliance complaint about example Autoscaling Group (BC_AWS_GENERAL_31)
  • Fix typo in README
  • Include Terraform lock file in .gitignore

why

  • Get clean Bridgecrew badge
  • Correct confusing error
  • Ensure lock files are not checked into GitHub

note

The PR can and should be merged into master to update README and Bridgecrew without triggering a new release/version. These changes have no effect on the actual module in use and a release will create unnecessary ripple effects. However, merging to master will update the README and badges, so is worthwhile, and the changes will move forward into the next release.

what

  • Properly output descriptors of chained modules

why

  • Bug fix; implement intended behavior
terraform-null-label - v0.25.0-rc.1

Published by cloudpossebot about 3 years ago

what

  • Add additional label and id component: tenant
  • New input labels_as_tags controls which labels are exported as tags
  • New input descriptor_formats generates new output descriptors
  • Update README, remove link to obsolete terraform-terraform-label

why

  • Support users that host resources on behalf of and/or dedicated to single customers
  • Supersedes and closes #131, giving people control over which tags the module generates
  • Simple mechanism for creating multiple identifiers from the same inputs, reducing the need to create multiple instances of null-label
  • Document tenant, labels_as_tags, descriptor_formats, add additional clarification, stop promoting obsolete module

what

  • Update README snippets to reflect use of Terraform Registry.

why

  • Including snippets that reflect use of the Terraform Registry make it easier for users to quickly instantiate a null_label module.
  • README is out of date and does not include snippets that reflect use of the Terraform Registry.

references

  • N/A

what

  • Resolve Bridgecrew compliance complaint about example Autoscaling Group (BC_AWS_GENERAL_31)
  • Fix typo in README
  • Include Terraform lock file in .gitignore

why

  • Get clean Bridgecrew badge
  • Correct confusing error
  • Ensure lock files are not checked into GitHub

note

The PR can and should be merged into master to update README and Bridgecrew without triggering a new release/version. These changes have no effect on the actual module in use and a release will create unnecessary ripple effects. However, merging to master will update the README and badges, so is worthwhile, and the changes will move forward into the next release.

terraform-null-label - v0.24.1 Allow control of letter case of outputs

Published by cloudpossebot over 3 years ago

You now have control over the letter case of generated tag names and supplied labels, which means you also have control over the letter case of the ultimate id.

Labels are the elements you can include in label_order, namely namespace, environment, stage, name, and attributes. For every non-empty label, a corresponding tag name is generated. For namespace, environment, stage, the output is the formatted, normalized input. (By "normalized" we mean that it goes through regex_replace_chars.), For attributes, which is a list, each element is normalized, duplicates are removed, and the resulting list is converted to a string by joining the elements with the delimiter (defaults to hyphen). For name, which is special, the output is the same as id, which is the joining of the labels in the order specified by label_order and separated by delimiter.

  • You can set label_key_case to one of upper, lower, or title, which will result in generated tag names in the corresponding case: NAME, name, or Name. For backwards compatibility, title is the default
  • You can set label_value_case to one of upper, lower, title, or none, which will result in output label values in the corresponding case (with none meaning no case conversion of any kind will be done, though the labels will still be subject to regex_replace_chars). The case converted labels will show up not just in the module output of the labels themselves, but also in the tag values and in the id string.

You can look at the test cases in examples/complete and the expected results in test/src/examples_complete_test.go to see examples of how this is supposed to work.

One interesting example is that you can create ids in Pascal case by setting label_value_case = "title" and delimiter = "".

what

  • Include updates to exports/context.tf
  • Update README with features and compatibilty
  • Add validation for id_length_limit

why

  • The exports/context.tf is what gets distributed and needs to be in sync
  • Replace outdated information
  • Was not validated earlier because validators are not supported in TF 0.12 but now we are dropping support for TF 0.12 and so we can add validators

what

  • Restore backward compatibility with v0.22.1 and earlier
  • Allow setting of label_key_case and label_value_case by vars, not just by context attributes.

why

  • Allow interoperability of old and new modules
  • Normally, root modules make settings via individual variables, not by setting an entire context block.

Incorporates and closes #120

🐛 Bug fix/Breaking change

This version introduced a bug fix that technically is a breaking change.

The input regex_replace_chars specifies a regular expression, and characters matching it are removed
from labels/id elements. Prior to this release, if the delimiter itself matched the regular expression,
then the delimiter would be removed from the attributes portion of the id. This was not a problem
for most users, since the default delimiter was - (dash) and the default regex allowed dashes, but
if you customized the delimiter and/or regex, this could affect you.

terraform-null-label - v0.24.0

Published by cloudpossebot over 3 years ago

what

  • Restore backward compatibility with v0.22.1 and earlier
  • Allow setting of label_key_case and label_value_case by vars, not just by context attributes.

why

  • Allow interoperability of old and new modules
  • Normally, root modules make settings via individual variables, not by setting an entire context block.

Incorporates and closes #120

You now have control over the letter case of generated tag names and supplied labels, which means you also have control over the letter case of the ultimate id.

Labels are the elements you can include in label_order, namely namespace, environment, stage, name, and attributes. For every non-empty label, a corresponding tag name is generated. For namespace, environment, stage, the output is the formatted, normalized input. (By "normalized" we mean that it goes through regex_replace_chars.), For attributes, which is a list, each element is normalized, duplicates are removed, and the resulting list is converted to a string by joining the elements with the delimiter (defaults to hyphen). For name, which is special, the output is the same as id, which is the joining of the labels in the order specified by label_order and separated by delimiter.

  • You can set label_key_case to one of upper, lower, or title, which will result in generated tag names in the corresponding case: NAME, name, or Name. For backwards compatibility, title is the default
  • You can set label_value_case to one of upper, lower, title, or none, which will result in output label values in the corresponding case (with none meaning no case conversion of any kind will be done, though the labels will still be subject to regex_replace_chars). The case converted labels will show up not just in the module output of the labels themselves, but also in the tag values and in the id string.

You can look at the test cases in examples/complete and the expected results in test/src/examples_complete_test.go to see examples of how this is supposed to work.

One interesting example is that you can create ids in Pascal case by setting label_value_case = "title" and delimiter = "".

Known issues

  • exports/context.tf still not backwards compatible
  • Validation for id_length not included in exports/context.tf
terraform-null-label - v0.23.0 pre-release: Allow control of letter case of outputs

Published by cloudpossebot over 3 years ago

Known issues

  • Does not interoperate with earlier versions of null-label. The canonical context = module.this.context fails if module.this.context is an older version
  • context.tf does not incorporate var.label_key_case and var.label_value_case into the module.this object, preventing those variables from taking effect in the root module's module.this.

With this release, you gain control over the letter case of generated tag names and supplied labels, which means you also have control over the letter case of the ultimate id.

Labels are the elements you can include in label_order, namely namespace, environment, stage, name, and attributes. For every non-empty label, a corresponding tag name is generated. For namespace, environment, stage, the output is the formatted, normalized input. (By "normalized" we mean that it goes through regex_replace_chars.), For attributes, which is a list, each element is normalized, duplicates are removed, and the resulting list is converted to a string by joining the elements with the delimiter (defaults to hyphen). For name, which is special, the output is the same as id, which is the joining of the labels in the order specified by label_order and separated by delimiter.

  • You can set label_key_case to one of upper, lower, or title, which will result in generated tag names in the corresponding case: NAME, name, or Name. For backwards compatibility, title is the default
  • You can set label_value_case to one of upper, lower, title, or none, which will result in output label values in the corresponding case (with none meaning no case conversion of any kind will be done, though the labels will still be subject to regex_replace_chars). The case converted labels will show up not just in the module output of the labels themselves, but also in the tag values and in the id string.

You can look at the test cases in examples/complete and the expected results in test/src/examples_complete_test.go to see examples of how this is supposed to work.

One interesting example is that you can create ids in Pascal case by setting label_value_case = "title" and delimiter = "".

terraform-null-label - v0.22.1

Published by cloudpossebot almost 4 years ago

what

  • Add var.attributes to end of context.attributes, not vice versa
  • Update to current workflows (with some exceptions)

why

  • Modules should append to attributes passed in, not insert themselves ahead of others
  • New features, like auto-format (but holding back some, because this is a special module)

references

  • closes #113
  • closes #108
terraform-null-label - v0.22.0

Published by cloudpossebot almost 4 years ago

Breaking change: This release updates minimum Terraform version requirement to 0.12.26

what

  • Convert context.tf to use registry reference
  • Update version requirement to >= 0.12.26
  • Switch auto-publish to draft mode

why

  • New standard way to reference modules
  • Minimum version that supports registry references
  • Ensure that version numbers are set manually and match what is in context.tf
terraform-null-label - v0.21.0

Published by cloudpossebot almost 4 years ago

what

  • Update null-label version used for exporting into other modules

why

  • New release will be made from this PR - use this release in exports/context.tf to be exported into other modules
terraform-null-label - v0.20.0

Published by github-actions[bot] almost 4 years ago

Adds support for Terraform 0..14 (currently in beta2)

I've currently got it pinned to < 0.14.1 to be conservative. Can update to < 0.15 or similar.

what

  • Bumps versions.tf to support terraform 0.14

why

  • I make extensive use of this label module (it's an amazing contribution to the TF ecosystem. Thank you!)
  • I am currently running into an unrelated issue w/ TF 0.13. The proposed workaround for that unrelated issue does not work for me at this time.
  • The solution is to use tf 0.14 which is in beta, now.

references

Fixes https://github.com/cloudposse/terraform-null-label/issues/104

terraform-null-label - v0.19.2

Published by github-actions[bot] about 4 years ago

what

  • Replace symbolic link to context.tf (examples/autoscalinggroup/context.tf) with copy of file
  • Move module to top of context.tf and clean up documentation comments inside the file

why

  • Terraform clones the whole repo, not just the top directory, and the symbolic link causes problems for some IDEs
  • Module contains version number and source URL, which should be at the top of the file
terraform-null-label - v0.19.1

Published by github-actions[bot] about 4 years ago

Enhancement to #99

what

  • Include all context inputs as normalized outputs

why

  • Enable a consistent pattern of module.this.context.var to reference the input value with null defaults and module.this.var to reference the normalized value with nulls replaced by actual default values.

references

  • See #99: Standardize context for input and chaining
terraform-null-label - v0.19.0

Published by github-actions[bot] about 4 years ago

what

  • Refine the context object concept:
    • The previous context output contained normalized and generated data. This has now been renamed normalized_context
    • The new context object output simply propagates the input unmodified
    • The new context.tf file can be dropped into any module to provide standard context inputs and a context output (module.this.context) that can be fed into other modules
  • Refine the id length limit:
    • Rename id_max_length to id_length_limit
    • Prevent consecutive delimiters and at the same time ensure that if the id is truncated, it is truncate to exactly id_length_limit characters
  • Ensure that it is possible to eliminate delimiters by setting delimiter = "". Closes #77
  • Add additional tests for all of the above.

why

  • Provide a consistent interface to our modules, allow chaining, and provide something like a global setting as requested in #88
  • Make length limit for id more intuitive. Since id is also used as a tag value, and AWS limits tag value length to 255 characters, limit the id length by default so it will not break AWS.
  • Some environments do not allow non-alphabetic characters in names
  • Greater code coverage for testing helps prevent bugs from creeping in as new features are added
terraform-null-label - 0.18.0: Add id_max_length

Published by Nuru about 4 years ago

This is a pre-release, to thank @tibbing for his contribution. There will be breaking changes to this feature in the next release.

#98 Thanks to @tibbing

  • Adds a new optional variable id_max_length, that when set to a value greater than 0 will limit the length of ID output to given value.
  • The truncated ID is still disambiguated by suffixing the first 5 characters of the md5 hash of the full ID.
  • The full ID will still be available as a new output id_full.
  • The default value of id_max_length is 0, so that the change is not breaking any existing usages.
terraform-null-label -

Published by nitrocode about 4 years ago

terraform-null-label - 0.16.0 Removed unnecessary step for tags_as_list_of_maps

Published by aknysh almost 5 years ago

what

  • Cleaned up code, removed unnecessary step
  • Removed provider code for null_resource from versions

why

terraform-null-label - 0.15.0 Drop `null_resource`

Published by aknysh about 5 years ago

what

  • Replace null_resource with Terraform 0.12 for-logic

Why

  • No provider dependency, less resources
terraform-null-label - 0.14.1 Fix example

Published by aknysh over 5 years ago

what

  • Fix example
  • Apply TF 0.12 syntax

why

  • Remove TF version pinning from the provider in the example
  • TF 0.12 prefers using list index to get items from a list
terraform-null-label - 0.14.0

Published by aknysh over 5 years ago

what

  • Use required_providers to pin Terraform providers

why

  • Pinning the module's providers version in required_providers block allows specifying only the required provider version for the module without the need to specify all providers with versions explicitly
terraform-null-label - 0.13.0 Add `versions.tf`

Published by aknysh over 5 years ago

what

  • Add versions.tf

why

  • Standardize on a file name to pin Terraform and provider versions
  • The file with a standard name is easy to check manually by users and automatically by scripts
  • versions.tf is also automatically added by terraform 0.12upgrade tool
terraform-null-label - 0.12.2 Update Codefresh badge

Published by aknysh over 5 years ago

what

  • Update Codefresh badge

why

  • Codefresh test pipeline has been moved to Codefresh terraform-modules project
Related Projects