Class CfnTransitGateway

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.065Z") @Stability(Stable) public class CfnTransitGateway extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::TransitGateway.

Specifies a transit gateway.

You can use a transit gateway to interconnect your virtual private clouds (VPC) and on-premises networks. After the transit gateway enters the available state, you can attach your VPCs and VPN connections to the transit gateway.

To attach your VPCs, use AWS::EC2::TransitGatewayAttachment .

To attach a VPN connection, use AWS::EC2::CustomerGateway to create a customer gateway and specify the ID of the customer gateway and the ID of the transit gateway in a call to AWS::EC2::VPNConnection .

When you create a transit gateway, we create a default transit gateway route table and use it as the default association route table and the default propagation route table. You can use AWS::EC2::TransitGatewayRouteTable to create additional transit gateway route tables. If you disable automatic route propagation, we do not create a default transit gateway route table. You can use AWS::EC2::TransitGatewayRouteTablePropagation to propagate routes from a resource attachment to a transit gateway route table. If you disable automatic associations, you can use AWS::EC2::TransitGatewayRouteTableAssociation to associate a resource attachment with a transit gateway route table.

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.*;
 CfnTransitGateway cfnTransitGateway = CfnTransitGateway.Builder.create(this, "MyCfnTransitGateway")
         .amazonSideAsn(123)
         .associationDefaultRouteTableId("associationDefaultRouteTableId")
         .autoAcceptSharedAttachments("autoAcceptSharedAttachments")
         .defaultRouteTableAssociation("defaultRouteTableAssociation")
         .defaultRouteTablePropagation("defaultRouteTablePropagation")
         .description("description")
         .dnsSupport("dnsSupport")
         .multicastSupport("multicastSupport")
         .propagationDefaultRouteTableId("propagationDefaultRouteTableId")
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .transitGatewayCidrBlocks(List.of("transitGatewayCidrBlocks"))
         .vpnEcmpSupport("vpnEcmpSupport")
         .build();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnTransitGateway

      protected CfnTransitGateway(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnTransitGateway

      protected CfnTransitGateway(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnTransitGateway

      @Stability(Stable) public CfnTransitGateway(@NotNull Construct scope, @NotNull String id, @Nullable CfnTransitGatewayProps props)
      Create a new AWS::EC2::TransitGateway.

      Parameters:
      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.
    • CfnTransitGateway

      @Stability(Stable) public CfnTransitGateway(@NotNull Construct scope, @NotNull String id)
      Create a new AWS::EC2::TransitGateway.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      Parameters:
      inspector -
      • tree inspector to collect and process attributes.
      This parameter is required.
    • renderProperties

      @Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
      Overrides:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrId

      @Stability(Stable) @NotNull public String getAttrId()
      The ID of the transit gateway.
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      The tags for the transit gateway.
    • getAmazonSideAsn

      @Stability(Stable) @Nullable public Number getAmazonSideAsn()
      A private Autonomous System Number (ASN) for the Amazon side of a BGP session.

      The range is 64512 to 65534 for 16-bit ASNs. The default is 64512.

    • setAmazonSideAsn

      @Stability(Stable) public void setAmazonSideAsn(@Nullable Number value)
      A private Autonomous System Number (ASN) for the Amazon side of a BGP session.

      The range is 64512 to 65534 for 16-bit ASNs. The default is 64512.

    • getAssociationDefaultRouteTableId

      @Stability(Stable) @Nullable public String getAssociationDefaultRouteTableId()
      The ID of the default association route table.
    • setAssociationDefaultRouteTableId

      @Stability(Stable) public void setAssociationDefaultRouteTableId(@Nullable String value)
      The ID of the default association route table.
    • getAutoAcceptSharedAttachments

      @Stability(Stable) @Nullable public String getAutoAcceptSharedAttachments()
      Enable or disable automatic acceptance of attachment requests.

      Disabled by default.

    • setAutoAcceptSharedAttachments

      @Stability(Stable) public void setAutoAcceptSharedAttachments(@Nullable String value)
      Enable or disable automatic acceptance of attachment requests.

      Disabled by default.

    • getDefaultRouteTableAssociation

      @Stability(Stable) @Nullable public String getDefaultRouteTableAssociation()
      Enable or disable automatic association with the default association route table.

      Enabled by default.

    • setDefaultRouteTableAssociation

      @Stability(Stable) public void setDefaultRouteTableAssociation(@Nullable String value)
      Enable or disable automatic association with the default association route table.

      Enabled by default.

    • getDefaultRouteTablePropagation

      @Stability(Stable) @Nullable public String getDefaultRouteTablePropagation()
      Enable or disable automatic propagation of routes to the default propagation route table.

      Enabled by default.

    • setDefaultRouteTablePropagation

      @Stability(Stable) public void setDefaultRouteTablePropagation(@Nullable String value)
      Enable or disable automatic propagation of routes to the default propagation route table.

      Enabled by default.

    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      The description of the transit gateway.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      The description of the transit gateway.
    • getDnsSupport

      @Stability(Stable) @Nullable public String getDnsSupport()
      Enable or disable DNS support.

      Enabled by default.

    • setDnsSupport

      @Stability(Stable) public void setDnsSupport(@Nullable String value)
      Enable or disable DNS support.

      Enabled by default.

    • getMulticastSupport

      @Stability(Stable) @Nullable public String getMulticastSupport()
      Indicates whether multicast is enabled on the transit gateway.
    • setMulticastSupport

      @Stability(Stable) public void setMulticastSupport(@Nullable String value)
      Indicates whether multicast is enabled on the transit gateway.
    • getPropagationDefaultRouteTableId

      @Stability(Stable) @Nullable public String getPropagationDefaultRouteTableId()
      The ID of the default propagation route table.
    • setPropagationDefaultRouteTableId

      @Stability(Stable) public void setPropagationDefaultRouteTableId(@Nullable String value)
      The ID of the default propagation route table.
    • getTransitGatewayCidrBlocks

      @Stability(Stable) @Nullable public List<String> getTransitGatewayCidrBlocks()
      The transit gateway CIDR blocks.
    • setTransitGatewayCidrBlocks

      @Stability(Stable) public void setTransitGatewayCidrBlocks(@Nullable List<String> value)
      The transit gateway CIDR blocks.
    • getVpnEcmpSupport

      @Stability(Stable) @Nullable public String getVpnEcmpSupport()
      Enable or disable Equal Cost Multipath Protocol support.

      Enabled by default.

    • setVpnEcmpSupport

      @Stability(Stable) public void setVpnEcmpSupport(@Nullable String value)
      Enable or disable Equal Cost Multipath Protocol support.

      Enabled by default.