Class: DrawCloud::Subnet::SubnetRouteTableAssociation

Inherits:
Object
  • Object
show all
Defined in:
lib/draw_cloud/subnet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subnet, route_table) ⇒ SubnetRouteTableAssociation

Returns a new instance of SubnetRouteTableAssociation.



23
24
25
26
# File 'lib/draw_cloud/subnet.rb', line 23

def initialize(subnet, route_table)
  @subnet = subnet
  @route_table = route_table
end

Instance Attribute Details

#route_tableObject

Returns the value of attribute route_table.



22
23
24
# File 'lib/draw_cloud/subnet.rb', line 22

def route_table
  @route_table
end

#subnetObject

Returns the value of attribute subnet.



22
23
24
# File 'lib/draw_cloud/subnet.rb', line 22

def subnet
  @subnet
end

Instance Method Details

#resource_nameObject



28
29
30
# File 'lib/draw_cloud/subnet.rb', line 28

def resource_name
  subnet.resource_name + "RouteTableAssociation"
end

#to_hObject



32
33
34
35
36
37
38
39
# File 'lib/draw_cloud/subnet.rb', line 32

def to_h
  { "Type" => "AWS::EC2::SubnetRouteTableAssociation",
    "Properties" => {
      "SubnetId" => DrawCloud.ref(subnet),
      "RouteTableId" => DrawCloud.ref(route_table),
    }
  }
end