aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
(AWS::EC2::LaunchTemplate ) - allow to set any VersionNumber as Default of an LaunchTemplate using CFN
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### Name of the resource
AWS::EC2::LaunchTemplate
### Resource name
_No response_
### Description
#### summary/impact
For debugging reasons, sometimes people check details of the currently "Configuration-In-Use" of an LaunchTemplate via AWS Console. If you click on a existing Launch template via Console you will always get the details of the Default Version - which is "hard-coded" always Version 1. Details below:
To begin with I tested the scenario by creating a Launch Template via CFN in eu-central-1 region. The launch template with version 1 (default) was created successfully along with the description as specified in the stack template. I then updated the stack which resulted in creation of a new version 2, but the default was still set to 1 and the new version 2 did not have any description.
Thus, I can conclude that the default version of a launch template cannot be specified in AWS CloudFormation. The same is given in [CloudFormation Documentation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#aws-resource-ec2-launchtemplate-return-values-fn--getatt). Regarding the description issue, I've added #1517
#### is-state
> The default version of a launch template cannot be specified in AWS CloudFormation.
(Hence, it's always 1)

#### target state
We are able to flag a version as default using CDK/CFN.
### Other Details
The AWS CLI command "modify-launch-template" supports setting the default version, hence CloudFormation could do so as well.
Contributor guide
Research direction
Start with the AWS::EC2::LaunchTemplate CloudFormation resource documentation and the issue's reference to the AWS CLI modify-launch-template command. The work is complete when CloudFormation or CDK can select any existing launch-template version as the default, rather than always using version 1.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100