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

Run an ASG instance refresh on TF configuration change #25259

Closed
Tracked by #24785
hugoShaka opened this issue Apr 27, 2023 · 1 comment · Fixed by #46324
Closed
Tracked by #24785

Run an ASG instance refresh on TF configuration change #25259

hugoShaka opened this issue Apr 27, 2023 · 1 comment · Fixed by #46324
Labels
feature-request Used for new features in Teleport, improvements to current should be #enhancements terraform Legacy Terraform label terraform-deployment-examples Issues relating to Terraform deployment examples under examples/aws/terraform

Comments

@hugoShaka
Copy link
Contributor

hugoShaka commented Apr 27, 2023

What would you like Teleport to do?

As a user editing the Teleport ASG with Terraform (updating config or Teleport version) I want the changes to apply immediately.

What problem does this solve?

Changes in configuration don't trigger an instance refresh, thus are not applied unless machines are deleted/restarted.
This causes a lot of confusion and time lost troubleshooting why the configuration change did not apply. This can also cause security issues when users think they have updated to a version containing a security fix while still running vulnerable images.

If a workaround exists, please include it.

Trigger instance rollout manually.

Implementation details

See https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/autoscaling_group#automatically-refresh-all-instances-after-the-group-is-updated

@hugoShaka hugoShaka added feature-request Used for new features in Teleport, improvements to current should be #enhancements terraform Legacy Terraform label labels Apr 27, 2023
@webvictim webvictim added the terraform-deployment-examples Issues relating to Terraform deployment examples under examples/aws/terraform label Jun 6, 2023
@GavinFrazar
Copy link
Contributor

template changes will trigger a refresh by default, unless you use version = "$Latest" instead of referring to the template latest version:

A refresh will not start when version = "$Latest" is configured in the launch_template block. To trigger the instance refresh when a launch template is changed, configure version to use the latest_version attribute of the aws_launch_template resource.

Thus the fix is to change these config blocks like so:

  launch_template {
    name    = aws_launch_template.proxy.name
-   version = "$Latest"
+   version = aws_launch_template.proxy.latest_version
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Used for new features in Teleport, improvements to current should be #enhancements terraform Legacy Terraform label terraform-deployment-examples Issues relating to Terraform deployment examples under examples/aws/terraform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants