Class: AWSCDK::EC2::SelectedSubnets

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

Overview

Result of selecting a subset of subnets from a VPC.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(availability_zones:, has_public:, internet_connectivity_established:, subnet_ids:, subnets:, is_pending_lookup: nil) ⇒ SelectedSubnets

Returns a new instance of SelectedSubnets.

Parameters:

  • availability_zones (Array<String>)

    The respective AZs of each subnet.

  • has_public (Boolean)

    Whether any of the given subnets are from the VPC's public subnets.

  • internet_connectivity_established (Constructs::IDependable)

    Dependency representing internet connectivity for these subnets.

  • subnet_ids (Array<String>)

    The subnet IDs.

  • subnets (Array<AWSCDK::EC2::ISubnet>)

    Selected subnet objects.

  • is_pending_lookup (Boolean, nil) (defaults to: nil)

    The subnet selection is not actually real yet.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'ec2/selected_subnets.rb', line 13

def initialize(availability_zones:, has_public:, internet_connectivity_established:, subnet_ids:, subnets:, is_pending_lookup: nil)
  @availability_zones = availability_zones
  Jsii::Type.check_type(@availability_zones, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "availabilityZones")
  @has_public = has_public
  Jsii::Type.check_type(@has_public, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "hasPublic")
  @internet_connectivity_established = internet_connectivity_established
  Jsii::Type.check_type(@internet_connectivity_established, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklEZXBlbmRhYmxlIn0=")), "internetConnectivityEstablished")
  @subnet_ids = subnet_ids
  Jsii::Type.check_type(@subnet_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "subnetIds")
  @subnets = subnets
  Jsii::Type.check_type(@subnets, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19lYzIuSVN1Ym5ldCJ9LCJraW5kIjoiYXJyYXkifX0=")), "subnets")
  @is_pending_lookup = is_pending_lookup
  Jsii::Type.check_type(@is_pending_lookup, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "isPendingLookup") unless @is_pending_lookup.nil?
end

Instance Attribute Details

#availability_zonesArray<String> (readonly)

The respective AZs of each subnet.

Returns:

  • (Array<String>)


31
32
33
# File 'ec2/selected_subnets.rb', line 31

def availability_zones
  @availability_zones
end

#has_publicBoolean (readonly)

Whether any of the given subnets are from the VPC's public subnets.

Returns:

  • (Boolean)


35
36
37
# File 'ec2/selected_subnets.rb', line 35

def has_public
  @has_public
end

#internet_connectivity_establishedConstructs::IDependable (readonly)

Dependency representing internet connectivity for these subnets.

Returns:

  • (Constructs::IDependable)


39
40
41
# File 'ec2/selected_subnets.rb', line 39

def internet_connectivity_established
  @internet_connectivity_established
end

#is_pending_lookupBoolean? (readonly)

Note:

Default: false

The subnet selection is not actually real yet.

If this value is true, don't validate anything about the subnets. The count or identities are not known yet, and the validation will most likely fail which will prevent a successful lookup.

Returns:

  • (Boolean, nil)


56
57
58
# File 'ec2/selected_subnets.rb', line 56

def is_pending_lookup
  @is_pending_lookup
end

#subnet_idsArray<String> (readonly)

The subnet IDs.

Returns:

  • (Array<String>)


43
44
45
# File 'ec2/selected_subnets.rb', line 43

def subnet_ids
  @subnet_ids
end

#subnetsArray<AWSCDK::EC2::ISubnet> (readonly)

Selected subnet objects.

Returns:



47
48
49
# File 'ec2/selected_subnets.rb', line 47

def subnets
  @subnets
end

Class Method Details

.jsii_propertiesObject



58
59
60
61
62
63
64
65
66
67
# File 'ec2/selected_subnets.rb', line 58

def self.jsii_properties
  {
    :availability_zones => "availabilityZones",
    :has_public => "hasPublic",
    :internet_connectivity_established => "internetConnectivityEstablished",
    :subnet_ids => "subnetIds",
    :subnets => "subnets",
    :is_pending_lookup => "isPendingLookup",
  }
end

Instance Method Details

#to_jsiiObject



69
70
71
72
73
74
75
76
77
78
79
80
# File 'ec2/selected_subnets.rb', line 69

def to_jsii
  result = {}
  result.merge!({
    "availabilityZones" => @availability_zones,
    "hasPublic" => @has_public,
    "internetConnectivityEstablished" => @internet_connectivity_established,
    "subnetIds" => @subnet_ids,
    "subnets" => @subnets,
    "isPendingLookup" => @is_pending_lookup,
  })
  result.compact
end