-
Notifications
You must be signed in to change notification settings - Fork 4.5k
feat(ec2): network interface definitions for launch templates #34327
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
Changes from all commits
5ad5aa2
3c3d94b
18c396c
b07cee8
c29affd
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2479,6 +2479,35 @@ const launchTemplate = new ec2.LaunchTemplate(this, 'LaunchTemplate', { | |
| }); | ||
| ``` | ||
|
|
||
| Following demonstrates how to add multiple network interface cards to launch template. | ||
|
Member
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. Consider adding a comment explaining the real-world use case this example addresses, such as multi-homed instances or instances with multiple public IPs. |
||
|
|
||
| ```ts | ||
| declare const vpc: ec2.Vpc; | ||
|
|
||
| const sg1 = new ec2.SecurityGroup(this, 'sg1', { | ||
| vpc: vpc, | ||
| }); | ||
| const sg2 = new ec2.SecurityGroup(this, 'sg2', { | ||
| vpc: vpc, | ||
| }); | ||
|
|
||
| new ec2.LaunchTemplate(this, 'LaunchTemplate', { | ||
| machineImage: ec2.MachineImage.latestAmazonLinux2023(), | ||
| networkInterfaces: [ | ||
| { | ||
| associatePublicIpAddress: false, | ||
| deviceIndex: 0, | ||
| groups: [sg1], | ||
| }, | ||
| { | ||
| associatePublicIpAddress: false, | ||
| deviceIndex: 1, | ||
| groups: [sg2], | ||
| }, | ||
| ], | ||
| }); | ||
| ``` | ||
|
|
||
| ### Placement Group | ||
|
|
||
| Specify `placementGroup` to enable the placement group support: | ||
|
|
||
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.
The integration test only covers a basic case with minimal properties. It doesn't test more complex scenarios like using security groups, subnets, or other network interface properties.