Class: AWSCDK::EC2::ConfigureNatOptions

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

Overview

Options passed by the VPC when NAT needs to be configured.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(nat_subnets:, private_subnets:, vpc:) ⇒ ConfigureNatOptions

Returns a new instance of ConfigureNatOptions.

Parameters:



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

def initialize(nat_subnets:, private_subnets:, vpc:)
  @nat_subnets = nat_subnets
  Jsii::Type.check_type(@nat_subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuUHVibGljU3VibmV0In0sImtpbmQiOiJhcnJheSJ9fQ==")), "natSubnets")
  @private_subnets = private_subnets
  Jsii::Type.check_type(@private_subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuUHJpdmF0ZVN1Ym5ldCJ9LCJraW5kIjoiYXJyYXkifX0=")), "privateSubnets")
  @vpc = vpc
  Jsii::Type.check_type(@vpc, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZWMyLlZwYyJ9")), "vpc")
end

Instance Attribute Details

#nat_subnetsArray<AWSCDK::EC2::PublicSubnet> (readonly)

The public subnets where the NAT providers need to be placed.

Returns:



22
23
24
# File 'ec2/configure_nat_options.rb', line 22

def nat_subnets
  @nat_subnets
end

#private_subnetsArray<AWSCDK::EC2::PrivateSubnet> (readonly)

The private subnets that need to route through the NAT providers.

There may be more private subnets than public subnets with NAT providers.

Returns:



28
29
30
# File 'ec2/configure_nat_options.rb', line 28

def private_subnets
  @private_subnets
end

#vpcAWSCDK::EC2::VPC (readonly)

The VPC we're configuring NAT for.

Returns:



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

def vpc
  @vpc
end

Class Method Details

.jsii_propertiesObject



34
35
36
37
38
39
40
# File 'ec2/configure_nat_options.rb', line 34

def self.jsii_properties
  {
    :nat_subnets => "natSubnets",
    :private_subnets => "privateSubnets",
    :vpc => "vpc",
  }
end

Instance Method Details

#to_jsiiObject



42
43
44
45
46
47
48
49
50
# File 'ec2/configure_nat_options.rb', line 42

def to_jsii
  result = {}
  result.merge!({
    "natSubnets" => @nat_subnets,
    "privateSubnets" => @private_subnets,
    "vpc" => @vpc,
  })
  result.compact
end