aws-cdk-lib.aws_ec2.VpnConnectionBase

class VpnConnectionBase

LanguageType name
.NETAmazon.CDK.AWS.EC2.VpnConnectionBase
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#VpnConnectionBase
Javasoftware.amazon.awscdk.services.ec2.VpnConnectionBase
Pythonaws_cdk.aws_ec2.VpnConnectionBase
TypeScript (source)aws-cdk-lib » aws_ec2 » VpnConnectionBase

Implements IConstruct, IDependable, IResource, IVpnConnection

Extends Resource

Implemented by VpnConnection

Base class for Vpn connections.

Initializer

new VpnConnectionBase(scope: Construct, id: string, props?: ResourceProps)

Parameters

  • scope Construct
  • id string
  • props ResourceProps

Properties

NameTypeDescription
customerGatewayAsnnumberThe ASN of the customer gateway.
customerGatewayIdstringThe id of the customer gateway.
customerGatewayIpstringThe ip address of the customer gateway.
envResourceEnvironmentThe environment this resource belongs to.
nodeNodeThe tree node.
stackStackThe stack in which this resource is defined.
vpnIdstringThe id of the VPN connection.

customerGatewayAsn

Type: number

The ASN of the customer gateway.


customerGatewayId

Type: string

The id of the customer gateway.


customerGatewayIp

Type: string

The ip address of the customer gateway.


env

Type: ResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


node

Type: Node

The tree node.


stack

Type: Stack

The stack in which this resource is defined.


vpnId

Type: string

The id of the VPN connection.

Methods

NameDescription
applyRemovalPolicy(policy)Apply the given removal policy to this resource.
metric(metricName, props?)Return the given named metric for this VPNConnection.
metricTunnelDataIn(props?)The bytes received through the VPN tunnel.
metricTunnelDataOut(props?)The bytes sent through the VPN tunnel.
metricTunnelState(props?)The state of the tunnel. 0 indicates DOWN and 1 indicates UP.
toString()Returns a string representation of this construct.

applyRemovalPolicy(policy)

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).


metric(metricName, props?)

public metric(metricName: string, props?: MetricOptions): Metric

Parameters

  • metricName string
  • props MetricOptions

Returns

  • Metric

Return the given named metric for this VPNConnection.


metricTunnelDataIn(props?)

public metricTunnelDataIn(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

The bytes received through the VPN tunnel.

Sum over 5 minutes


metricTunnelDataOut(props?)

public metricTunnelDataOut(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

The bytes sent through the VPN tunnel.

Sum over 5 minutes


metricTunnelState(props?)

public metricTunnelState(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

The state of the tunnel. 0 indicates DOWN and 1 indicates UP.

Average over 5 minutes


toString()

public toString(): string

Returns

  • string

Returns a string representation of this construct.