Class VpnConnection
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ec2.VpnConnectionBase
software.amazon.awscdk.services.ec2.VpnConnection
- All Implemented Interfaces:
IResource,IVpnConnection,IVPNConnectionRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:38.366Z")
@Stability(Stable)
public class VpnConnection
extends VpnConnectionBase
Define a VPN Connection.
Example:
// Across all tunnels in the account/region
Metric allDataOut = VpnConnection.metricAllTunnelDataOut();
// For a specific vpn connection
VpnConnection vpnConnection = vpc.addVpnConnection("Dynamic", VpnConnectionOptions.builder()
.ip("1.2.3.4")
.build());
Metric state = vpnConnection.metricTunnelState();
-
Nested Class Summary
Nested ClassesNested 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.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IVpnConnection
IVpnConnection.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedVpnConnection(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedVpnConnection(software.amazon.jsii.JsiiObjectRef objRef) VpnConnection(software.constructs.Construct scope, String id, VpnConnectionProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IVpnConnectionfromVpnConnectionAttributes(software.constructs.Construct scope, String id, VpnConnectionAttributes attrs) Import a VPN connection by supplying all attributes directly.The ASN of the customer gateway.The id of the customer gateway.The ip address of the customer gateway.getVpnId()The id of the VPN connection.static MetricReturn the given named metric for all VPN connections in the account/region.static MetricmetricAll(String metricName, MetricOptions props) Return the given named metric for all VPN connections in the account/region.static MetricMetric for the tunnel data in of all VPN connections in the account/region.static MetricMetric for the tunnel data in of all VPN connections in the account/region.static MetricMetric for the tunnel data out of all VPN connections.static MetricMetric for the tunnel data out of all VPN connections.static MetricMetric for the tunnel state of all VPN connections in the account/region.static MetricMetric for the tunnel state of all VPN connections in the account/region.Methods inherited from class software.amazon.awscdk.services.ec2.VpnConnectionBase
getVpnConnectionRef, metric, metric, metricTunnelDataIn, metricTunnelDataIn, metricTunnelDataOut, metricTunnelDataOut, metricTunnelState, metricTunnelStateMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods 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.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.awscdk.services.ec2.IVpnConnection
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
VpnConnection
protected VpnConnection(software.amazon.jsii.JsiiObjectRef objRef) -
VpnConnection
protected VpnConnection(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
VpnConnection
@Stability(Stable) public VpnConnection(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VpnConnectionProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromVpnConnectionAttributes
@Stability(Stable) @NotNull public static IVpnConnection fromVpnConnectionAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull VpnConnectionAttributes attrs) Import a VPN connection by supplying all attributes directly.- Parameters:
scope- This parameter is required.id- This parameter is required.attrs- This parameter is required.
-
metricAll
@Stability(Stable) @NotNull public static Metric metricAll(@NotNull String metricName, @Nullable MetricOptions props) Return the given named metric for all VPN connections in the account/region.- Parameters:
metricName- This parameter is required.props-
-
metricAll
Return the given named metric for all VPN connections in the account/region.- Parameters:
metricName- This parameter is required.
-
metricAllTunnelDataIn
@Stability(Stable) @NotNull public static Metric metricAllTunnelDataIn(@Nullable MetricOptions props) Metric for the tunnel data in of all VPN connections in the account/region.Default: sum over 5 minutes
- Parameters:
props-
-
metricAllTunnelDataIn
Metric for the tunnel data in of all VPN connections in the account/region.Default: sum over 5 minutes
-
metricAllTunnelDataOut
@Stability(Stable) @NotNull public static Metric metricAllTunnelDataOut(@Nullable MetricOptions props) Metric for the tunnel data out of all VPN connections.Default: sum over 5 minutes
- Parameters:
props-
-
metricAllTunnelDataOut
Metric for the tunnel data out of all VPN connections.Default: sum over 5 minutes
-
metricAllTunnelState
@Stability(Stable) @NotNull public static Metric metricAllTunnelState(@Nullable MetricOptions props) Metric for the tunnel state of all VPN connections in the account/region.Default: average over 5 minutes
- Parameters:
props-
-
metricAllTunnelState
Metric for the tunnel state of all VPN connections in the account/region.Default: average over 5 minutes
-
getCustomerGatewayAsn
The ASN of the customer gateway.- Specified by:
getCustomerGatewayAsnin interfaceIVpnConnection- Specified by:
getCustomerGatewayAsnin classVpnConnectionBase
-
getCustomerGatewayId
The id of the customer gateway.- Specified by:
getCustomerGatewayIdin interfaceIVpnConnection- Specified by:
getCustomerGatewayIdin classVpnConnectionBase
-
getCustomerGatewayIp
The ip address of the customer gateway.- Specified by:
getCustomerGatewayIpin interfaceIVpnConnection- Specified by:
getCustomerGatewayIpin classVpnConnectionBase
-
getVpnId
The id of the VPN connection.- Specified by:
getVpnIdin interfaceIVpnConnection- Specified by:
getVpnIdin classVpnConnectionBase
-