Class: AWSCDK::CXAPI::VPCSubnet Deprecated

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cxapi/vpc_subnet.rb

Overview

Deprecated.

The definition of this type has moved to @aws-cdk/cloud-assembly-api.

A subnet representation that the VPC provider uses.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(availability_zone:, route_table_id:, subnet_id:, cidr: nil) ⇒ VPCSubnet

Returns a new instance of VPCSubnet.

Parameters:

  • availability_zone (String)

    The code of the availability zone this subnet is in (for example, 'us-west-2a').

  • route_table_id (String)

    The identifier of the route table for this subnet.

  • subnet_id (String)

    The identifier of the subnet.

  • cidr (String, nil) (defaults to: nil)

    CIDR range of the subnet.



13
14
15
16
17
18
19
20
21
22
# File 'cxapi/vpc_subnet.rb', line 13

def initialize(availability_zone:, route_table_id:, subnet_id:, cidr: nil)
  @availability_zone = availability_zone
  Jsii::Type.check_type(@availability_zone, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "availabilityZone")
  @route_table_id = route_table_id
  Jsii::Type.check_type(@route_table_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "routeTableId")
  @subnet_id = subnet_id
  Jsii::Type.check_type(@subnet_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetId")
  @cidr = cidr
  Jsii::Type.check_type(@cidr, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cidr") unless @cidr.nil?
end

Instance Attribute Details

#availability_zoneString (readonly)

The code of the availability zone this subnet is in (for example, 'us-west-2a').

Returns:

  • (String)


27
28
29
# File 'cxapi/vpc_subnet.rb', line 27

def availability_zone
  @availability_zone
end

#cidrString? (readonly)

Note:

Default: - CIDR information not available

CIDR range of the subnet.

Returns:

  • (String, nil)


40
41
42
# File 'cxapi/vpc_subnet.rb', line 40

def cidr
  @cidr
end

#route_table_idString (readonly)

The identifier of the route table for this subnet.

Returns:

  • (String)


31
32
33
# File 'cxapi/vpc_subnet.rb', line 31

def route_table_id
  @route_table_id
end

#subnet_idString (readonly)

The identifier of the subnet.

Returns:

  • (String)


35
36
37
# File 'cxapi/vpc_subnet.rb', line 35

def subnet_id
  @subnet_id
end

Class Method Details

.jsii_propertiesObject



42
43
44
45
46
47
48
49
# File 'cxapi/vpc_subnet.rb', line 42

def self.jsii_properties
  {
    :availability_zone => "availabilityZone",
    :route_table_id => "routeTableId",
    :subnet_id => "subnetId",
    :cidr => "cidr",
  }
end

Instance Method Details

#to_jsiiObject



51
52
53
54
55
56
57
58
59
60
# File 'cxapi/vpc_subnet.rb', line 51

def to_jsii
  result = {}
  result.merge!({
    "availabilityZone" => @availability_zone,
    "routeTableId" => @route_table_id,
    "subnetId" => @subnet_id,
    "cidr" => @cidr,
  })
  result.compact
end