-
Notifications
You must be signed in to change notification settings - Fork 709
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
Add suffix option to azurecaf_name resources #1294
base: main
Are you sure you want to change the base?
Conversation
suffix_with_hyphen = try(var.global_settings.suffix_with_hyphen, format("%s-", try(var.global_settings.suffix, try(var.global_settings.suffixes[0], random_string.suffix.0.result)))) | ||
suffixes = try(var.global_settings.suffix, null) == "" ? null : try([var.global_settings.suffix], try(var.global_settings.suffixes, [random_string.suffix.0.result])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether these two could also be useful. Just copied over the idea from the prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a CAF convention that basically adds a random prefix if no prefix is provided, but that shouldn't apply to suffixes. The current implementation will add random strings for every legacy CAF deployment that exists since they won't have global_settings.suffix set. The local global_settings.suffix should just stay null if the var global_settings suffix is null. This is what is causing resources to be regenerated if suffix isn't provided.
@hyperfocus1337 Bumping this -- suffixes would be very useful for a number of use cases. The PR should have the 'set suffix to random if not provided' logic removed so that it won't force replacement on existing workloads if suffix isn't provided. |
Issue-id
PR Checklist
Description
Adds the suffix option to the azurecaf_name for all resources across the framework. Also related to PR Azure/caf-terraform-landingzones#407 and issue #1287.
Does this introduce a breaking change
Testing