@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-28T21:34:21.844Z") public class CfnRoute extends CfnResource implements IInspectable
Specifies a route in a route table within a VPC.
You must specify either DestinationCidrBlock
or DestinationIpv6CidrBlock
, plus the ID of one of the target resources.
If you create a route that references a transit gateway in the same template where you create the transit gateway, you must declare a dependency on the transit gateway attachment. The route table cannot use the transit gateway until it has successfully attached to the VPC. Add a DependsOn Attribute in the AWS::EC2::Route
resource to explicitly declare a dependency on the AWS::EC2::TransitGatewayAttachment
resource.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.ec2.*; CfnRoute cfnRoute = CfnRoute.Builder.create(this, "MyCfnRoute") .routeTableId("routeTableId") // the properties below are optional .carrierGatewayId("carrierGatewayId") .destinationCidrBlock("destinationCidrBlock") .destinationIpv6CidrBlock("destinationIpv6CidrBlock") .egressOnlyInternetGatewayId("egressOnlyInternetGatewayId") .gatewayId("gatewayId") .instanceId("instanceId") .localGatewayId("localGatewayId") .natGatewayId("natGatewayId") .networkInterfaceId("networkInterfaceId") .transitGatewayId("transitGatewayId") .vpcEndpointId("vpcEndpointId") .vpcPeeringConnectionId("vpcPeeringConnectionId") .build();
Modifier and Type | Class and Description |
---|---|
static class |
CfnRoute.Builder
A fluent builder for
CfnRoute . |
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
IConstruct.Jsii$Default
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
Modifier | Constructor and Description |
---|---|
|
CfnRoute(Construct scope,
java.lang.String id,
CfnRouteProps props)
Create a new `AWS::EC2::Route`.
|
protected |
CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnRoute(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCarrierGatewayId()
The ID of the carrier gateway.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
getCfnProperties() |
java.lang.String |
getDestinationCidrBlock()
The IPv4 CIDR block used for the destination match.
|
java.lang.String |
getDestinationIpv6CidrBlock()
The IPv6 CIDR block used for the destination match.
|
java.lang.String |
getEgressOnlyInternetGatewayId()
The ID of the egress-only internet gateway.
|
java.lang.String |
getGatewayId()
The ID of an internet gateway or virtual private gateway attached to your VPC.
|
java.lang.String |
getInstanceId()
The ID of a NAT instance in your VPC.
|
java.lang.String |
getLocalGatewayId()
The ID of the local gateway.
|
java.lang.String |
getNatGatewayId()
The ID of a NAT gateway.
|
java.lang.String |
getNetworkInterfaceId()
The ID of the network interface.
|
java.lang.String |
getRouteTableId()
The ID of the route table.
|
java.lang.String |
getTransitGatewayId()
The ID of a transit gateway.
|
java.lang.String |
getVpcEndpointId()
The ID of a VPC endpoint.
|
java.lang.String |
getVpcPeeringConnectionId()
The ID of a VPC peering connection.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
renderProperties(java.util.Map<java.lang.String,java.lang.Object> props) |
void |
setCarrierGatewayId(java.lang.String value)
The ID of the carrier gateway.
|
void |
setDestinationCidrBlock(java.lang.String value)
The IPv4 CIDR block used for the destination match.
|
void |
setDestinationIpv6CidrBlock(java.lang.String value)
The IPv6 CIDR block used for the destination match.
|
void |
setEgressOnlyInternetGatewayId(java.lang.String value)
The ID of the egress-only internet gateway.
|
void |
setGatewayId(java.lang.String value)
The ID of an internet gateway or virtual private gateway attached to your VPC.
|
void |
setInstanceId(java.lang.String value)
The ID of a NAT instance in your VPC.
|
void |
setLocalGatewayId(java.lang.String value)
The ID of the local gateway.
|
void |
setNatGatewayId(java.lang.String value)
The ID of a NAT gateway.
|
void |
setNetworkInterfaceId(java.lang.String value)
The ID of the network interface.
|
void |
setRouteTableId(java.lang.String value)
The ID of the route table.
|
void |
setTransitGatewayId(java.lang.String value)
The ID of a transit gateway.
|
void |
setVpcEndpointId(java.lang.String value)
The ID of a VPC endpoint.
|
void |
setVpcPeeringConnectionId(java.lang.String value)
The ID of a VPC peering connection.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validateProperties
getRef
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
public static final java.lang.String CFN_RESOURCE_TYPE_NAME
protected CfnRoute(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnRoute(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public CfnRoute(Construct scope, java.lang.String id, CfnRouteProps props)
scope
- - scope in which this resource is defined. This parameter is required.id
- - scoped id of the resource. This parameter is required.props
- - resource properties. This parameter is required.public void inspect(TreeInspector inspector)
inspect
in interface IInspectable
inspector
- - tree inspector to collect and process attributes. This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> renderProperties(java.util.Map<java.lang.String,java.lang.Object> props)
renderProperties
in class CfnResource
props
- This parameter is required.protected java.util.Map<java.lang.String,java.lang.Object> getCfnProperties()
getCfnProperties
in class CfnResource
public java.lang.String getRouteTableId()
The routing table must be associated with the same VPC that the virtual private gateway is attached to.
public void setRouteTableId(java.lang.String value)
The routing table must be associated with the same VPC that the virtual private gateway is attached to.
public java.lang.String getCarrierGatewayId()
public void setCarrierGatewayId(java.lang.String value)
public java.lang.String getDestinationCidrBlock()
public void setDestinationCidrBlock(java.lang.String value)
public java.lang.String getDestinationIpv6CidrBlock()
public void setDestinationIpv6CidrBlock(java.lang.String value)
public java.lang.String getEgressOnlyInternetGatewayId()
public void setEgressOnlyInternetGatewayId(java.lang.String value)
public java.lang.String getGatewayId()
public void setGatewayId(java.lang.String value)
public java.lang.String getInstanceId()
public void setInstanceId(java.lang.String value)
public java.lang.String getLocalGatewayId()
public void setLocalGatewayId(java.lang.String value)
public java.lang.String getNatGatewayId()
public void setNatGatewayId(java.lang.String value)
public java.lang.String getNetworkInterfaceId()
public void setNetworkInterfaceId(java.lang.String value)
public java.lang.String getTransitGatewayId()
public void setTransitGatewayId(java.lang.String value)
public java.lang.String getVpcEndpointId()
Supported for Gateway Load Balancer endpoints only.
public void setVpcEndpointId(java.lang.String value)
Supported for Gateway Load Balancer endpoints only.
public java.lang.String getVpcPeeringConnectionId()
public void setVpcPeeringConnectionId(java.lang.String value)