-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
EC2: launch templates created by CloudFormation have a generated name if not provided #7135
EC2: launch templates created by CloudFormation have a generated name if not provided #7135
Conversation
@@ -233,6 +233,10 @@ def random_launch_template_id() -> str: | |||
return random_id(prefix=EC2_RESOURCE_TO_PREFIX["launch-template"], size=17) | |||
|
|||
|
|||
def random_launch_template_name() -> str: | |||
return f"LaunchTemplate_{random_resource_id(size=12)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not quite right, it is closer to what is produced by cloudformation.utils.random_suffix
-- but importing random_suffix
is circular.
This is probably close enough.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7135 +/- ##
=======================================
Coverage 95.87% 95.88%
=======================================
Files 834 834
Lines 82233 82237 +4
=======================================
+ Hits 78844 78850 +6
+ Misses 3389 3387 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for the fix @skinitimski!
This is now part of moto >= 4.2.13.dev3 |
Purpose
Fixes a bug in the creation of launch templates via CloudFormation. If your template has more than one unnamed launch template, creation will fail with
This is because moto's implementation expects that the resource have a
LaunchTemplateName
property even though it is optional.