Module: Convection::DSL::Template::Resource::EC2Subnet

Included in:
Model::Template::Resource::EC2Subnet
Defined in:
lib/convection/model/template/resource/aws_ec2_subnet.rb

Overview

Add DSL for RouteTableAssocaition

Instance Method Summary collapse

Instance Method Details

#acl(acl_entity, &block) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/convection/model/template/resource/aws_ec2_subnet.rb', line 21

def acl(acl_entity, &block)
  assoc = Model::Template::Resource::EC2SubnetNetworkACLAssociation.new("#{ name }ACLAssociation#{ acl_entity.name }", template)
  assoc.acl(acl_entity)
  assoc.subnet(self)

  assoc.instance_exec(&block) if block
  @template.resources[assoc.name] = assoc
end

#route_table(table, &block) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/convection/model/template/resource/aws_ec2_subnet.rb', line 12

def route_table(table, &block)
  assoc = Model::Template::Resource::EC2SubnetRouteTableAssociation.new("#{ name }RouteTableAssociation#{ table.name }", template)
  assoc.route_table(table)
  assoc.subnet(self)

  assoc.instance_exec(&block) if block
  @template.resources[assoc.name] = assoc
end