-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(ec2): add versionDescription
property for LaunchTemplate
#30837
Changes from 1 commit
c3d69db
7163385
849e005
0bec9e2
115a68c
4a1505b
a2798a5
70c9be5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,7 +211,8 @@ | |
} | ||
] | ||
} | ||
] | ||
], | ||
"VersionDescription": "test template v1" | ||
} | ||
}, | ||
"sg2860DD91F": { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,6 +221,15 @@ export interface LaunchTemplateProps { | |
*/ | ||
readonly launchTemplateName?: string; | ||
|
||
/** | ||
* A description for the first version of the launch template. | ||
* The version descrioption must be maximum 255 characters long, including hyphens (-), | ||
* underscores (_), spaces, and tabs. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is there documentation available to confirm this? (I could not find that in the CFn documentation.) |
||
* | ||
* @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html#cfn-ec2-launchtemplate-versiondescription | ||
*/ | ||
readonly versionDescription?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The CodeBuild CI seems to be failing. Optional properties must have
|
||
|
||
/** | ||
* Type of instance to launch. | ||
* | ||
|
@@ -735,8 +744,13 @@ export class LaunchTemplate extends Resource implements ILaunchTemplate, iam.IGr | |
? [{ deviceIndex: 0, associatePublicIpAddress: props.associatePublicIpAddress, groups: securityGroupsToken }] | ||
: undefined; | ||
|
||
if (props.versionDescription && !Token.isUnresolved(props.versionDescription) && props.versionDescription.length > 255) { | ||
throw new Error(`versionDescription must be less than or equal to 255 characters, got ${props.versionDescription.length}`); | ||
} | ||
|
||
const resource = new CfnLaunchTemplate(this, 'Resource', { | ||
launchTemplateName: props?.launchTemplateName, | ||
versionDescription: props?.versionDescription, | ||
launchTemplateData: { | ||
blockDeviceMappings: props?.blockDevices !== undefined ? launchTemplateBlockDeviceMappings(this, props.blockDevices) : undefined, | ||
creditSpecification: props?.cpuCredits !== undefined ? { | ||
|
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.
A line break would make it clearer.