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

fix: set an ASG's launch template version to an explicit version to automatically trigger instance refresh #1370

Conversation

bashims
Copy link
Contributor

@bashims bashims commented May 19, 2021

Set an ASG's launch template version to an explicit version automatically. This will ensure that an instance refresh will be
triggered whenever the launch template changes.

PR o'clock

Description

In order to properly trigger instance refresh whenever a launch template is modified the version of the template must be updated in the autoscaling group. Previous versions of this module only supported setting the template version manually. This PR adds a new feature that will either set the version to the latest (real) version or the default (real) version with the use of the boolean use_latest_version. It is still possible to pin a specific version of template by setting launch_template_version in worker_groups_launch_template. The default launch_template_version is ignored in the case of autoscaling group launch template, however it is preserved for the node_group case.

This PR also adds the ability to optionally update the default version for any autoscaling group launch template.

Fixes: #1365 #1315 #1293

Checklist

@bashims bashims changed the title Set an ASG's launch template version to an explicit version automatically to trigger instance refresh. fix: set an ASG's launch template version to an explicit version automatically to trigger instance refresh. May 19, 2021
@bashims bashims changed the title fix: set an ASG's launch template version to an explicit version automatically to trigger instance refresh. fix: set an ASG's launch template version to an explicit version to automatically to trigger instance refresh. May 19, 2021
@barryib barryib self-assigned this May 19, 2021
@barryib
Copy link
Member

barryib commented May 19, 2021

@bashims can you please rebase your branch from master.

automatically. This will ensure that an instance refresh will be
triggered whenever the launch template changes.
@bashims bashims force-pushed the fix-1365-refresh-on-template-change branch from 4641c6c to fb61961 Compare May 19, 2021 11:51
@bashims bashims changed the title fix: set an ASG's launch template version to an explicit version to automatically to trigger instance refresh. fix: set an ASG's launch template version to an explicit version to automatically trigger instance refresh. May 19, 2021
@bashims
Copy link
Contributor Author

bashims commented May 19, 2021

@barryib rebased

local.tf Outdated Show resolved Hide resolved
workers_launch_template.tf Outdated Show resolved Hide resolved
Benjamin Ash added 2 commits May 19, 2021 10:09
default launch_template version.

Signed-off-by: Benjamin Ash <bash@intelerad.com>
@bashims bashims force-pushed the fix-1365-refresh-on-template-change branch from 604fb9a to 0cdc35d Compare May 19, 2021 14:21
@barryib barryib changed the title fix: set an ASG's launch template version to an explicit version to automatically trigger instance refresh. fix: set an ASG's launch template version to an explicit version to automatically trigger instance refresh May 19, 2021
@barryib barryib merged commit a2761ad into terraform-aws-modules:master May 19, 2021
@barryib
Copy link
Member

barryib commented May 19, 2021

Thanks again @bashims for your great work.

@bashims
Copy link
Contributor Author

bashims commented May 19, 2021

@barryib do you think you might be able to include this fix in a patch release today?

@barryib
Copy link
Member

barryib commented May 19, 2021

@barryib do you think you might be able to include this fix in a patch release today?

Yep. I'll do that tonight.

@barryib
Copy link
Member

barryib commented May 19, 2021

v16.1.0 is released.

barryib added a commit to barryib/terraform-aws-eks that referenced this pull request May 20, 2021
…utomatically trigger instance refresh (terraform-aws-modules#1370)

NOTES: Set an ASG's launch template version to an explicit version automatically. This will ensure that an instance refresh will be triggered whenever the launch template changes. The default `launch_template_version` is now used to determine the latest or default version of the created launch template for self-managed worker groups.

Signed-off-by: Benjamin Ash <bash@intelerad.com>
Co-authored-by: Thierno IB. BARRY <ibrahima.br@gmail.com>
ArchiFleKs pushed a commit to ArchiFleKs/terraform-aws-eks that referenced this pull request Jun 1, 2021
…utomatically trigger instance refresh (terraform-aws-modules#1370)

NOTES: Set an ASG's launch template version to an explicit version automatically. This will ensure that an instance refresh will be triggered whenever the launch template changes. The default `launch_template_version` is now used to determine the latest or default version of the created launch template for self-managed worker groups.

Signed-off-by: Benjamin Ash <bash@intelerad.com>
Co-authored-by: Thierno IB. BARRY <ibrahima.br@gmail.com>
@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, 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 15, 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

Successfully merging this pull request may close these issues.

Instance Refresh not triggering on launch_template changes
2 participants