Class: AWSCDK::EC2::VpnConnectionOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
ec2/vpn_connection_options.rb

Direct Known Subclasses

VpnConnectionProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of VpnConnectionOptions.

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.



10
11
12
13
14
15
16
17
18
19
# File 'ec2/vpn_connection_options.rb', line 10

def initialize(ip:, asn: nil, static_routes: nil, tunnel_options: nil)
  @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?
end

Instance Attribute Details

#asnNumeric? (readonly)

Note:

Default: 65000

The ASN of the customer gateway.

Returns:

  • (Numeric, nil)


29
30
31
# File 'ec2/vpn_connection_options.rb', line 29

def asn
  @asn
end

#ipString (readonly)

The ip address of the customer gateway.

Returns:

  • (String)


24
25
26
# File 'ec2/vpn_connection_options.rb', line 24

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)


34
35
36
# File 'ec2/vpn_connection_options.rb', line 34

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:



42
43
44
# File 'ec2/vpn_connection_options.rb', line 42

def tunnel_options
  @tunnel_options
end

Class Method Details

.jsii_propertiesObject



44
45
46
47
48
49
50
51
# File 'ec2/vpn_connection_options.rb', line 44

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

Instance Method Details

#to_jsiiObject



53
54
55
56
57
58
59
60
61
62
# File 'ec2/vpn_connection_options.rb', line 53

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