Class CfnVPNConnection

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.180Z") @Stability(Stable) public class CfnVPNConnection extends CfnResource implements IInspectable
A CloudFormation AWS::EC2::VPNConnection.

Specifies a VPN connection between a virtual private gateway and a VPN customer gateway or a transit gateway and a VPN customer gateway.

To specify a VPN connection between a transit gateway and customer gateway, use the TransitGatewayId and CustomerGatewayId properties.

To specify a VPN connection between a virtual private gateway and customer gateway, use the VpnGatewayId and CustomerGatewayId properties.

For more information, see AWS Site-to-Site VPN in the AWS Site-to-Site VPN User Guide .

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.*;
 CfnVPNConnection cfnVPNConnection = CfnVPNConnection.Builder.create(this, "MyCfnVPNConnection")
         .customerGatewayId("customerGatewayId")
         .type("type")
         // the properties below are optional
         .staticRoutesOnly(false)
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .transitGatewayId("transitGatewayId")
         .vpnGatewayId("vpnGatewayId")
         .vpnTunnelOptionsSpecifications(List.of(VpnTunnelOptionsSpecificationProperty.builder()
                 .preSharedKey("preSharedKey")
                 .tunnelInsideCidr("tunnelInsideCidr")
                 .build()))
         .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

    • CfnVPNConnection

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

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

      @Stability(Stable) public CfnVPNConnection(@NotNull Construct scope, @NotNull String id, @NotNull CfnVPNConnectionProps props)
      Create a new AWS::EC2::VPNConnection.

      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.
      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.
    • getAttrVpnConnectionId

      @Stability(Stable) @NotNull public String getAttrVpnConnectionId()
      The ID of the VPN connection.
    • getCfnProperties

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

      @Stability(Stable) @NotNull public TagManager getTags()
      Any tags assigned to the VPN connection.
    • getCustomerGatewayId

      @Stability(Stable) @NotNull public String getCustomerGatewayId()
      The ID of the customer gateway at your end of the VPN connection.
    • setCustomerGatewayId

      @Stability(Stable) public void setCustomerGatewayId(@NotNull String value)
      The ID of the customer gateway at your end of the VPN connection.
    • getType

      @Stability(Stable) @NotNull public String getType()
      The type of VPN connection.
    • setType

      @Stability(Stable) public void setType(@NotNull String value)
      The type of VPN connection.
    • getStaticRoutesOnly

      @Stability(Stable) @Nullable public Object getStaticRoutesOnly()
      Indicates whether the VPN connection uses static routes only.

      Static routes must be used for devices that don't support BGP.

      If you are creating a VPN connection for a device that does not support Border Gateway Protocol (BGP), you must specify true .

    • setStaticRoutesOnly

      @Stability(Stable) public void setStaticRoutesOnly(@Nullable Boolean value)
      Indicates whether the VPN connection uses static routes only.

      Static routes must be used for devices that don't support BGP.

      If you are creating a VPN connection for a device that does not support Border Gateway Protocol (BGP), you must specify true .

    • setStaticRoutesOnly

      @Stability(Stable) public void setStaticRoutesOnly(@Nullable IResolvable value)
      Indicates whether the VPN connection uses static routes only.

      Static routes must be used for devices that don't support BGP.

      If you are creating a VPN connection for a device that does not support Border Gateway Protocol (BGP), you must specify true .

    • getTransitGatewayId

      @Stability(Stable) @Nullable public String getTransitGatewayId()
      The ID of the transit gateway associated with the VPN connection.

      You must specify either TransitGatewayId or VpnGatewayId , but not both.

    • setTransitGatewayId

      @Stability(Stable) public void setTransitGatewayId(@Nullable String value)
      The ID of the transit gateway associated with the VPN connection.

      You must specify either TransitGatewayId or VpnGatewayId , but not both.

    • getVpnGatewayId

      @Stability(Stable) @Nullable public String getVpnGatewayId()
      The ID of the virtual private gateway at the AWS side of the VPN connection.

      You must specify either TransitGatewayId or VpnGatewayId , but not both.

    • setVpnGatewayId

      @Stability(Stable) public void setVpnGatewayId(@Nullable String value)
      The ID of the virtual private gateway at the AWS side of the VPN connection.

      You must specify either TransitGatewayId or VpnGatewayId , but not both.

    • getVpnTunnelOptionsSpecifications

      @Stability(Stable) @Nullable public Object getVpnTunnelOptionsSpecifications()
      The tunnel options for the VPN connection.
    • setVpnTunnelOptionsSpecifications

      @Stability(Stable) public void setVpnTunnelOptionsSpecifications(@Nullable IResolvable value)
      The tunnel options for the VPN connection.
    • setVpnTunnelOptionsSpecifications

      @Stability(Stable) public void setVpnTunnelOptionsSpecifications(@Nullable List<Object> value)
      The tunnel options for the VPN connection.