Class: CfFactory::CfNetworkAclEntry

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/vpc/cf_network_acl_entry.rb

Instance Method Summary collapse

Methods included from CfBase

#generate, #generate_ref, #get_deletion_policy, #get_name, #get_update_policy, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name, rule_number, protocol, rule_action, egress, cidr_block, from_port, to_port) ⇒ CfNetworkAclEntry

Returns a new instance of CfNetworkAclEntry.



7
8
9
10
11
12
13
14
15
16
# File 'lib/cf_factory/vpc/cf_network_acl_entry.rb', line 7

def initialize(name, rule_number, protocol, rule_action, egress, cidr_block, from_port, to_port)
  @name = name
  @rule_number = rule_number
  @protocol = protocol
  @rule_action = rule_action
  @egress = egress
  @cidr_block = cidr_block    
  @from_port = from_port
  @to_port = to_port
end

Instance Method Details

#get_cf_attributesObject



26
27
28
# File 'lib/cf_factory/vpc/cf_network_acl_entry.rb', line 26

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



30
31
32
33
34
35
# File 'lib/cf_factory/vpc/cf_network_acl_entry.rb', line 30

def get_cf_properties
  {"NetworkAclId" => @network_acl.generate_ref, "CidrBlock" => @cidr_block, 
    "Protocol" => @protocol.to_i, "RuleNumber" => @rule_number.to_i, "RuleAction" => @rule_action, "Egress" => @egress,
    "PortRange" => {"From" => @from_port.to_i, "To" => @to_port.to_i }
  }
end

#get_cf_typeObject



22
23
24
# File 'lib/cf_factory/vpc/cf_network_acl_entry.rb', line 22

def get_cf_type
  "AWS::EC2::NetworkAclEntry"
end

#set_network_acl(network_acl) ⇒ Object



18
19
20
# File 'lib/cf_factory/vpc/cf_network_acl_entry.rb', line 18

def set_network_acl(network_acl)
  @network_acl = network_acl
end