interface InternetGatewayProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.InternetGatewayProps |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#InternetGatewayProps |
Java | software.amazon.awscdk.services.ec2.alpha.InternetGatewayProps |
Python | aws_cdk.aws_ec2_alpha.InternetGatewayProps |
TypeScript (source) | @aws-cdk/aws-ec2-alpha » InternetGatewayProps |
Properties to define an internet gateway.
Example
const stack = new Stack();
const myVpc = new VpcV2(this, 'Vpc');
const routeTable = new RouteTable(this, 'RouteTable', {
vpc: myVpc,
});
const subnet = new SubnetV2(this, 'Subnet', {
vpc: myVpc,
availabilityZone: 'eu-west-2a',
ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
subnetType: SubnetType.PRIVATE_ISOLATED });
const igw = new InternetGateway(this, 'IGW', {
vpc: myVpc,
});
new Route(this, 'IgwRoute', {
routeTable,
destination: '0.0.0.0/0',
target: { gateway: igw },
});
Properties
Name | Type | Description |
---|---|---|
vpc | IVpc | The ID of the VPC for which to create the internet gateway. |
internet | string | The resource name of the internet gateway. |
vpc
Type:
IVpc
The ID of the VPC for which to create the internet gateway.
internetGatewayName?
Type:
string
(optional, default: provisioned without a resource name)
The resource name of the internet gateway.