-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(aws-ec2): fix code generation of IcmpPing (#1235)
IcmpPing used to generate a piece of ingress/egress rule that would not deploy. Added to integration test to make sure. Fixes #1231.
- Loading branch information
Showing
3 changed files
with
93 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
import { App, Stack } from '@aws-cdk/cdk'; | ||
import { VpcNetwork } from '../lib'; | ||
import cdk = require('@aws-cdk/cdk'); | ||
import ec2 = require('../lib'); | ||
|
||
const app = new App(); | ||
const app = new cdk.App(); | ||
const stack = new cdk.Stack(app, 'aws-cdk-ec2-vpc'); | ||
|
||
const stack = new Stack(app, 'aws-cdk-ec2-vpc'); | ||
const vpc = new ec2.VpcNetwork(stack, 'MyVpc'); | ||
|
||
new VpcNetwork(stack, 'MyVpc'); | ||
// Test Security Group Rules | ||
const sg = new ec2.SecurityGroup(stack, 'SG', { vpc }); | ||
|
||
const rules = [ | ||
new ec2.IcmpPing(), | ||
new ec2.IcmpAllTypeCodes(128), | ||
new ec2.IcmpAllTypesAndCodes(), | ||
new ec2.UdpAllPorts(), | ||
new ec2.UdpPort(123), | ||
new ec2.UdpPortRange(800, 801), | ||
]; | ||
|
||
for (const rule of rules) { | ||
sg.addIngressRule(new ec2.AnyIPv4(), rule); | ||
} | ||
|
||
app.run(); |