Class CfnVPNConnection
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.ec2.CfnVPNConnection
- All Implemented Interfaces:
IInspectable,IVPNConnectionRef,IEnvironmentAware,ITaggable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-12-01T16:02:19.285Z")
@Stability(Stable)
public class CfnVPNConnection
extends CfnResource
implements IInspectable, IVPNConnectionRef, ITaggable
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
.enableAcceleration(false)
.localIpv4NetworkCidr("localIpv4NetworkCidr")
.localIpv6NetworkCidr("localIpv6NetworkCidr")
.outsideIpAddressType("outsideIpAddressType")
.preSharedKeyStorage("preSharedKeyStorage")
.remoteIpv4NetworkCidr("remoteIpv4NetworkCidr")
.remoteIpv6NetworkCidr("remoteIpv6NetworkCidr")
.staticRoutesOnly(false)
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.transitGatewayId("transitGatewayId")
.transportTransitGatewayAttachmentId("transportTransitGatewayAttachmentId")
.tunnelBandwidth("tunnelBandwidth")
.tunnelInsideIpVersion("tunnelInsideIpVersion")
.vpnConcentratorId("vpnConcentratorId")
.vpnGatewayId("vpnGatewayId")
.vpnTunnelOptionsSpecifications(List.of(VpnTunnelOptionsSpecificationProperty.builder()
.dpdTimeoutAction("dpdTimeoutAction")
.dpdTimeoutSeconds(123)
.enableTunnelLifecycleControl(false)
.ikeVersions(List.of(Map.of(
"value", "value")))
.logOptions(VpnTunnelLogOptionsSpecificationProperty.builder()
.cloudwatchLogOptions(CloudwatchLogOptionsSpecificationProperty.builder()
.bgpLogEnabled(false)
.bgpLogGroupArn("bgpLogGroupArn")
.bgpLogOutputFormat("bgpLogOutputFormat")
.logEnabled(false)
.logGroupArn("logGroupArn")
.logOutputFormat("logOutputFormat")
.build())
.build())
.phase1DhGroupNumbers(List.of(Phase1DHGroupNumbersRequestListValueProperty.builder()
.value(123)
.build()))
.phase1EncryptionAlgorithms(List.of(Phase1EncryptionAlgorithmsRequestListValueProperty.builder()
.value("value")
.build()))
.phase1IntegrityAlgorithms(List.of(Phase1IntegrityAlgorithmsRequestListValueProperty.builder()
.value("value")
.build()))
.phase1LifetimeSeconds(123)
.phase2DhGroupNumbers(List.of(Phase2DHGroupNumbersRequestListValueProperty.builder()
.value(123)
.build()))
.phase2EncryptionAlgorithms(List.of(Phase2EncryptionAlgorithmsRequestListValueProperty.builder()
.value("value")
.build()))
.phase2IntegrityAlgorithms(List.of(Phase2IntegrityAlgorithmsRequestListValueProperty.builder()
.value("value")
.build()))
.phase2LifetimeSeconds(123)
.preSharedKey("preSharedKey")
.rekeyFuzzPercentage(123)
.rekeyMarginTimeSeconds(123)
.replayWindowSize(123)
.startupAction("startupAction")
.tunnelInsideCidr("tunnelInsideCidr")
.tunnelInsideIpv6Cidr("tunnelInsideIpv6Cidr")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnVPNConnection.static interfaceOptions for sending VPN tunnel logs to CloudWatch.static interfaceThe IKE version that is permitted for the VPN tunnel.static interfaceSpecifies a Diffie-Hellman group number for the VPN tunnel for phase 1 IKE negotiations.static interfaceSpecifies the encryption algorithm for the VPN tunnel for phase 1 IKE negotiations.static interfaceSpecifies the integrity algorithm for the VPN tunnel for phase 1 IKE negotiations.static interfaceSpecifies a Diffie-Hellman group number for the VPN tunnel for phase 2 IKE negotiations.static interfaceSpecifies the encryption algorithm for the VPN tunnel for phase 2 IKE negotiations.static interfaceSpecifies the integrity algorithm for the VPN tunnel for phase 2 IKE negotiations.static interfaceOptions for logging VPN tunnel activity.static interfaceThe tunnel options for a single VPN tunnel.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.ec2.IVPNConnectionRef
IVPNConnectionRef.Jsii$Default, IVPNConnectionRef.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnVPNConnection(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnVPNConnection(software.amazon.jsii.JsiiObjectRef objRef) CfnVPNConnection(software.constructs.Construct scope, String id, CfnVPNConnectionProps props) Create a newAWS::EC2::VPNConnection. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForVPNConnection(IVPNConnectionRef resource) static IVPNConnectionReffromVpnConnectionId(software.constructs.Construct scope, String id, String vpnConnectionId) Creates a new IVPNConnectionRef from a vpnConnectionId.The ID of the VPN connection.The ID of the customer gateway at your end of the VPN connection.Indicate whether to enable acceleration for the VPN connection.The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection.The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection.The type of IP address assigned to the outside interface of the customer gateway device.Describes the storage location for an instance store-backed AMI.The IPv4 CIDR on the AWS side of the VPN connection.The IPv6 CIDR on the AWS side of the VPN connection.Indicates whether the VPN connection uses static routes only.getTags()Tag Manager which manages the tags for this resource.Any tags assigned to the VPN connection.The ID of the transit gateway associated with the VPN connection.The transit gateway attachment ID to use for the VPN tunnel.Indicate whether the VPN tunnels process IPv4 or IPv6 traffic.getType()The type of VPN connection.A reference to a VPNConnection resource.The ID of the virtual private gateway at the AWS side of the VPN connection.The tunnel options for the VPN connection.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnVPNConnection.renderProperties(Map<String, Object> props) voidsetCustomerGatewayId(String value) The ID of the customer gateway at your end of the VPN connection.voidsetEnableAcceleration(Boolean value) Indicate whether to enable acceleration for the VPN connection.voidsetEnableAcceleration(IResolvable value) Indicate whether to enable acceleration for the VPN connection.voidsetLocalIpv4NetworkCidr(String value) The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection.voidsetLocalIpv6NetworkCidr(String value) The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection.voidsetOutsideIpAddressType(String value) The type of IP address assigned to the outside interface of the customer gateway device.voidsetPreSharedKeyStorage(String value) Describes the storage location for an instance store-backed AMI.voidsetRemoteIpv4NetworkCidr(String value) The IPv4 CIDR on the AWS side of the VPN connection.voidsetRemoteIpv6NetworkCidr(String value) The IPv6 CIDR on the AWS side of the VPN connection.voidsetStaticRoutesOnly(Boolean value) Indicates whether the VPN connection uses static routes only.voidsetStaticRoutesOnly(IResolvable value) Indicates whether the VPN connection uses static routes only.voidsetTagsRaw(List<CfnTag> value) Any tags assigned to the VPN connection.voidsetTransitGatewayId(String value) The ID of the transit gateway associated with the VPN connection.voidThe transit gateway attachment ID to use for the VPN tunnel.voidsetTunnelBandwidth(String value) voidsetTunnelInsideIpVersion(String value) Indicate whether the VPN tunnels process IPv4 or IPv6 traffic.voidThe type of VPN connection.voidsetVpnConcentratorId(String value) voidsetVpnGatewayId(String value) The ID of the virtual private gateway at the AWS side of the VPN connection.voidThe tunnel options for the VPN connection.voidThe tunnel options for the VPN connection.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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 software.constructs.Construct scope, @NotNull String id, @NotNull CfnVPNConnectionProps props) Create a newAWS::EC2::VPNConnection.- Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
arnForVPNConnection
@Stability(Stable) @NotNull public static String arnForVPNConnection(@NotNull IVPNConnectionRef resource) - Parameters:
resource- This parameter is required.
-
fromVpnConnectionId
@Stability(Stable) @NotNull public static IVPNConnectionRef fromVpnConnectionId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String vpnConnectionId) Creates a new IVPNConnectionRef from a vpnConnectionId.- Parameters:
scope- This parameter is required.id- This parameter is required.vpnConnectionId- This parameter is required.
-
isCfnVPNConnection
Checks whether the given object is a CfnVPNConnection.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- 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:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrVpnConnectionId
The ID of the VPN connection. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getVpnConnectionRef
A reference to a VPNConnection resource.- Specified by:
getVpnConnectionRefin interfaceIVPNConnectionRef
-
getCustomerGatewayId
The ID of the customer gateway at your end of the VPN connection. -
setCustomerGatewayId
The ID of the customer gateway at your end of the VPN connection. -
getType
The type of VPN connection. -
setType
The type of VPN connection. -
getEnableAcceleration
Indicate whether to enable acceleration for the VPN connection.Returns union: either
BooleanorIResolvable -
setEnableAcceleration
Indicate whether to enable acceleration for the VPN connection. -
setEnableAcceleration
Indicate whether to enable acceleration for the VPN connection. -
getLocalIpv4NetworkCidr
The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. -
setLocalIpv4NetworkCidr
The IPv4 CIDR on the customer gateway (on-premises) side of the VPN connection. -
getLocalIpv6NetworkCidr
The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. -
setLocalIpv6NetworkCidr
The IPv6 CIDR on the customer gateway (on-premises) side of the VPN connection. -
getOutsideIpAddressType
The type of IP address assigned to the outside interface of the customer gateway device. -
setOutsideIpAddressType
The type of IP address assigned to the outside interface of the customer gateway device. -
getRemoteIpv4NetworkCidr
The IPv4 CIDR on the AWS side of the VPN connection. -
setRemoteIpv4NetworkCidr
The IPv4 CIDR on the AWS side of the VPN connection. -
getRemoteIpv6NetworkCidr
The IPv6 CIDR on the AWS side of the VPN connection. -
setRemoteIpv6NetworkCidr
The IPv6 CIDR on the AWS side of the VPN connection. -
getStaticRoutesOnly
Indicates whether the VPN connection uses static routes only.Returns union: either
BooleanorIResolvable -
setStaticRoutesOnly
Indicates whether the VPN connection uses static routes only. -
setStaticRoutesOnly
Indicates whether the VPN connection uses static routes only. -
getTagsRaw
Any tags assigned to the VPN connection. -
setTagsRaw
Any tags assigned to the VPN connection. -
getTransitGatewayId
The ID of the transit gateway associated with the VPN connection. -
setTransitGatewayId
The ID of the transit gateway associated with the VPN connection. -
getTransportTransitGatewayAttachmentId
The transit gateway attachment ID to use for the VPN tunnel. -
setTransportTransitGatewayAttachmentId
The transit gateway attachment ID to use for the VPN tunnel. -
getTunnelBandwidth
-
setTunnelBandwidth
-
getTunnelInsideIpVersion
Indicate whether the VPN tunnels process IPv4 or IPv6 traffic. -
setTunnelInsideIpVersion
Indicate whether the VPN tunnels process IPv4 or IPv6 traffic. -
getVpnConcentratorId
-
setVpnConcentratorId
-
getVpnGatewayId
The ID of the virtual private gateway at the AWS side of the VPN connection. -
setVpnGatewayId
The ID of the virtual private gateway at the AWS side of the VPN connection. -
getVpnTunnelOptionsSpecifications
The tunnel options for the VPN connection.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnVPNConnection.VpnTunnelOptionsSpecificationProperty> -
setVpnTunnelOptionsSpecifications
The tunnel options for the VPN connection. -
setVpnTunnelOptionsSpecifications
The tunnel options for the VPN connection.
-