Skip to content
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

Sub Module Prefix Separator Causing Replacements #1791

Closed
joshua-giumelli-deltatre opened this issue Jan 19, 2022 · 1 comment
Closed

Sub Module Prefix Separator Causing Replacements #1791

joshua-giumelli-deltatre opened this issue Jan 19, 2022 · 1 comment

Comments

@joshua-giumelli-deltatre

Description

The submodules to create the node groups do not have the prefix_seperator variable passed through

The prefix_seperator is not passed through to the submodules (e.g. self-managed-node-group) and all the resources are hardcoded to use - as a separator. This is causing many of our resources to be replaced (ASGs, Launch Templates, etc.) to be replaced as the names/name_prefixes change from using our now non default separator ("") to "-".

ASG source: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/modules/self-managed-node-group/main.tf#L264

Launch Template source: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/modules/self-managed-node-group/main.tf#L51

Proposed fix: reuse the prefix_separator variable from the root module in each of the sub modules to replace the - in each resources name_prefix. Similar to the security group from the root module - https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/main.tf#L111.

This makes our migration to v18.0 extremely difficult as by default all our worker nodes would be replaced.

Example from Terraform Plan:

# module.cluster["0"].module.eks.module.self_managed_node_group["XXXXXXXXXX"].aws_launch_template.this[0] must be replaced
+/- resource "aws_launch_template" "this" {
...
!       name                                 = "XXXXXXXXXXYYYYYYYYYYY" -> (known after apply)
!       name_prefix                          = "XXXXXXXXXX" -> "XXXXXXXXXX-" # forces replacement
...
}
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants