VpnConnectionOptions

class aws_cdk.aws_ec2.VpnConnectionOptions(*, ip, asn=None, static_routes=None, tunnel_options=None)

Bases: object

Parameters:
  • ip (str) – The ip address of the customer gateway.

  • asn (Union[int, float, None]) – The ASN of the customer gateway. Default: 65000

  • static_routes (Optional[Sequence[str]]) – The static routes to be routed from the VPN gateway to the customer gateway. Default: Dynamic routing (BGP)

  • tunnel_options (Optional[Sequence[Union[VpnTunnelOption, Dict[str, Any]]]]) – The tunnel options for the VPN connection. At most two elements (one per tunnel). Duplicates not allowed. Default: Amazon generated tunnel options

ExampleMetadata:

infused

Example:

vpc = ec2.Vpc(self, "MyVpc",
    vpn_connections={
        "dynamic": ec2.VpnConnectionOptions( # Dynamic routing (BGP)
            ip="1.2.3.4"),
        "static": ec2.VpnConnectionOptions( # Static routing
            ip="4.5.6.7",
            static_routes=["192.168.10.0/24", "192.168.20.0/24"
            ])
    }
)

Attributes

asn

The ASN of the customer gateway.

Default:

65000

ip

The ip address of the customer gateway.

static_routes

The static routes to be routed from the VPN gateway to the customer gateway.

Default:

Dynamic routing (BGP)

tunnel_options

The tunnel options for the VPN connection.

At most two elements (one per tunnel). Duplicates not allowed.

Default:

Amazon generated tunnel options