class RouteTargetType
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.RouteTargetType |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#RouteTargetType |
Java | software.amazon.awscdk.services.ec2.alpha.RouteTargetType |
Python | aws_cdk.aws_ec2_alpha.RouteTargetType |
TypeScript (source) | @aws-cdk/aws-ec2-alpha » RouteTargetType |
The gateway or endpoint targeted by the route.
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 },
});
Initializer
new RouteTargetType(props: RouteTargetProps)
Parameters
- props
Route
Target Props
Properties
Name | Type | Description |
---|---|---|
endpoint? | IVpc | The endpoint route target. |
gateway? | IRoute | The gateway route target. |
endpoint?
Type:
IVpc
(optional, default: target is not set to an endpoint, in this case a gateway is needed.)
The endpoint route target.
This is used for targets such as VPC endpoints.
gateway?
Type:
IRoute
(optional, default: target is not set to a gateway, in this case an endpoint is needed.)
The gateway route target.
This is used for targets such as egress-only internet gateway or VPC peering connection.