Class: AWSCDK::EC2::VpnConnectionProps

Inherits:
VpnConnectionOptions
  • Object
show all
Defined in:
ec2/vpn_connection_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip:, asn: nil, static_routes: nil, tunnel_options: nil, vpc:) ⇒ VpnConnectionProps

Returns a new instance of VpnConnectionProps.

Parameters:

  • ip (String)

    The ip address of the customer gateway.

  • asn (Numeric, nil) (defaults to: nil)

    The ASN of the customer gateway.

  • static_routes (Array<String>, nil) (defaults to: nil)

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

  • tunnel_options (Array<AWSCDK::EC2::VpnTunnelOption>, nil) (defaults to: nil)

    The tunnel options for the VPN connection.

  • vpc (AWSCDK::EC2::IVPC)

    The VPC to connect to.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'ec2/vpn_connection_props.rb', line 11

def initialize(ip:, asn: nil, static_routes: nil, tunnel_options: nil, vpc:)
  @ip = ip
  Jsii::Type.check_type(@ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "ip")
  @asn = asn
  Jsii::Type.check_type(@asn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "asn") unless @asn.nil?
  @static_routes = static_routes
  Jsii::Type.check_type(@static_routes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "staticRoutes") unless @static_routes.nil?
  @tunnel_options = tunnel_options.is_a?(Array) ? tunnel_options.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::EC2::VpnTunnelOption.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tunnel_options
  Jsii::Type.check_type(@tunnel_options, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuVnBuVHVubmVsT3B0aW9uIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "tunnelOptions") unless @tunnel_options.nil?
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLklWcGMifQ==")), "vpc")
end

Instance Attribute Details

#asnNumeric? (readonly)

Note:

Default: 65000

The ASN of the customer gateway.

Returns:

  • (Numeric, nil)


32
33
34
# File 'ec2/vpn_connection_props.rb', line 32

def asn
  @asn
end

#ipString (readonly)

The ip address of the customer gateway.

Returns:

  • (String)


27
28
29
# File 'ec2/vpn_connection_props.rb', line 27

def ip
  @ip
end

#static_routesArray<String>? (readonly)

Note:

Default: Dynamic routing (BGP)

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

Returns:

  • (Array<String>, nil)


37
38
39
# File 'ec2/vpn_connection_props.rb', line 37

def static_routes
  @static_routes
end

#tunnel_optionsArray<AWSCDK::EC2::VpnTunnelOption>? (readonly)

Note:

Default: Amazon generated tunnel options

The tunnel options for the VPN connection.

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

Returns:



45
46
47
# File 'ec2/vpn_connection_props.rb', line 45

def tunnel_options
  @tunnel_options
end

#vpcAWSCDK::EC2::IVPC (readonly)

The VPC to connect to.

Returns:



49
50
51
# File 'ec2/vpn_connection_props.rb', line 49

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



51
52
53
54
55
56
57
58
59
# File 'ec2/vpn_connection_props.rb', line 51

def self.jsii_properties
  {
    :ip => "ip",
    :asn => "asn",
    :static_routes => "staticRoutes",
    :tunnel_options => "tunnelOptions",
    :vpc => "vpc",
  }
end

Instance Method Details

#to_jsiiObject



61
62
63
64
65
66
67
68
69
70
71
72
# File 'ec2/vpn_connection_props.rb', line 61

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "ip" => @ip,
    "asn" => @asn,
    "staticRoutes" => @static_routes,
    "tunnelOptions" => @tunnel_options,
    "vpc" => @vpc,
  })
  result.compact
end