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

Tagging spot instances with launch templates #753

Closed
2 tasks done
Art3mK opened this issue Feb 27, 2020 · 2 comments
Closed
2 tasks done

Tagging spot instances with launch templates #753

Art3mK opened this issue Feb 27, 2020 · 2 comments

Comments

@Art3mK
Copy link

Art3mK commented Feb 27, 2020

I'm submitting a...

  • feature request
  • kudos, thank you, warm fuzzy

What is the current behavior?

Currently there is a way to pass tags to launch templates, but it defines those only for volumes.

My use case is deny IAM policy, which doesn't allow to call ec2:RunInstances without specifying certain tags for instance. I know there is way for ASG to pass tags to instance, but AWS Documentation states that:

In most cases, when an Auto Scaling group launches instances, it adds tags to the instances during resource creation rather than after the resource is created.

The exception is when you use a launch configuration to launch Spot Instances. For this scenario, your Auto Scaling group adds tags while the instances are in the Pending lifecycle state

if you need the Auto Scaling group to add tags to instances as part of the same API call that launches the Spot Instances, consider migrating to launch templates.

But currently there is no way to pass tags for instances down to launch templates.

In my case debugging of that took a lot of time because of terraform showing this error:

Error: Error creating AutoScaling Group: AccessDenied: You are not authorized to use launch template: lt-009a3ea50f5e2c231
    status code: 403, request id: 2f09ef93-17a6-4b41-950d-03b3f194411d
      on .terraform/modules/eks/terraform-aws-modules-terraform-aws-eks-dd06c59/workers_launch_template.tf line 3, in resource "aws_autoscaling_group" "workers_launch_template":
       3: resource "aws_autoscaling_group" "workers_launch_template" {

So error was unclear, but cause of error was that missing instance tag in launch template.

What's the expected behavior?

One could specify instance tags via launch template


Thanks!

@barryib
Copy link
Member

barryib commented Apr 1, 2020

This is now implemented in https://github.com/terraform-aws-modules/terraform-aws-eks/releases/tag/v11.0.0.

See #762 #822 for more info.

@barryib barryib closed this as completed Apr 1, 2020
@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 27, 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 a pull request may close this issue.

2 participants