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

Add support for EC2 launch templates #219

Open
scraperg opened this issue Dec 5, 2022 · 5 comments
Open

Add support for EC2 launch templates #219

scraperg opened this issue Dec 5, 2022 · 5 comments

Comments

@scraperg
Copy link

scraperg commented Dec 5, 2022

Describe the Feature

Request support be added for EC2 launch templates.

AWS now recommends using EC2 launch templates instead of launch configurations. Currently the terraform-aws-elastic-beanstalk-environment module only supports launch configurations.

References:
An AWS Blog post recommending migrating from launch configurations to launch templates:
https://aws.amazon.com/blogs/compute/amazon-ec2-auto-scaling-will-no-longer-add-support-for-new-ec2-features-to-launch-configurations/

Documentation for launch configurations warns "We strongly recommend that you do not use launch configurations.":
https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html

Documentation for launch templates: https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-templates.html

Thanks.

@runtman
Copy link

runtman commented Dec 8, 2022

+1

@ddxor
Copy link

ddxor commented Dec 14, 2022

We're also tracking this issue. This will affect our clients DR plans, as after Dec 2023 there will be no ability to deploy new EB apps with launch configurations to a new AWS account.

@ddxor
Copy link

ddxor commented Dec 14, 2022

The good news in the short term is that by enabling the metadata v2 service, launch templates will be deployed in place of launch configurations.

+  additional_settings = [
+    {
+      namespace = "aws:autoscaling:launchconfiguration",
+      name = "DisableIMDSv1",
+      value = "true"
+    }
+  ]

@scraperg
Copy link
Author

scraperg commented Jan 6, 2023

Hi @ddxor,

Thanks for the DisableIMDSv1 suggestion.

When I add that setting to a pre-existing Beanstalk environment, it switches from launch configurations to launch templates. Which is great. But when I include the setting in an all new environment, I get the following error when applying:

Error: Error creating SSM activation: ValidationException: Nonexistent role or missing ssm service principal in trust policy: arn:aws:iam::XXXXXXXXX:role/XXXXXXX-eb-ec2

After removing the DisableIMDSv1 setting the environment came up successfully. I could then re-add the setting, and the env switched over to launch templates. But that process wouldn't be helpful in a DR scenario after December 2023.

Were you able to bring up a new Beanstalk environment with this setting?

Thanks.

Update: This error was caused by #205, unrelated to the DisableIMDSv1 setting. Thanks.

@N-Mohammed
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants