Class: 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, #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.



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

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



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

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



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

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



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

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

#set_network_acl(network_acl) ⇒ Object



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

def set_network_acl(network_acl)
  @network_acl = network_acl
end