interface RouteProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.RouteProps |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#RouteProps |
Java | software.amazon.awscdk.services.ec2.alpha.RouteProps |
Python | aws_cdk.aws_ec2_alpha.RouteProps |
TypeScript (source) | @aws-cdk/aws-ec2-alpha ยป RouteProps |
Properties to define a route.
Example
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 natgw = new NatGateway(this, 'NatGW', {
subnet: subnet,
vpc: myVpc,
connectivityType: NatConnectivityType.PRIVATE,
privateIpAddress: '10.0.0.42',
});
new Route(this, 'NatGwRoute', {
routeTable,
destination: '0.0.0.0/0',
target: { gateway: natgw },
});
Properties
Name | Type | Description |
---|---|---|
destination | string | The IPv4 or IPv6 CIDR block used for the destination match. |
route | IRoute | The ID of the route table for the route. |
target | Route | The gateway or endpoint targeted by the route. |
route | string | The resource name of the route. |
destination
Type:
string
The IPv4 or IPv6 CIDR block used for the destination match.
Routing decisions are based on the most specific match.
routeTable
Type:
IRoute
The ID of the route table for the route.
target
Type:
Route
The gateway or endpoint targeted by the route.
routeName?
Type:
string
(optional, default: provisioned without a route name)
The resource name of the route.