feat(ec2): add addSecurityGroup method to launth template#25697
feat(ec2): add addSecurityGroup method to launth template#25697mergify[bot] merged 4 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
08bdfc4 to
a13ebdf
Compare
0c8910f to
d25a187
Compare
d25a187 to
cdafcc5
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
563ef61 to
c5e1a8b
Compare
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
2e6adaf to
b8f9851
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
4107865 to
decf58d
Compare
decf58d to
11770cf
Compare
| */ | ||
| public addSecurityGroup(securityGroup: ISecurityGroup): void { | ||
| if (!this._connections) { | ||
| throw new Error('LaunchTemplate can only be added a securityGroup if another securityGroup is initialized in the constructor.'); |
There was a problem hiding this comment.
Thank you for your comment.
Because I understood that _connections is initialized only in the constructor.
https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-ec2/lib/launch-template.ts#L585
If _connections wasn't initialized in the constructor, an error occurs when trying to call addSecurityGroup here.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@Mergifyio requeue |
❌ Command disallowed due to command restrictions in the Mergify configuration.Details
|
Pull request has been modified.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
LaunchTemplateProps is able to process a single securityGroup.
Currently we are required to use connections when we wanted to use multiple security groups. #18712 (comment)
I implemented addSecurityGroup method to make this easier.
Closes #18712
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license