Class Fog::Compute::AWS::NetworkAcl
In: lib/fog/aws/models/compute/network_acl.rb
Parent: Fog::Model

Methods

Constants

ICMP = 1
TCP = 6
UDP = 17

Public Instance methods

Add a new rule

network_acl.add_rule(100, Fog::Compute::AWS::NetworkAcl::TCP, ‘allow’, ‘0.0.0.0/0’, true, ‘PortRange.From’ => 22, ‘PortRange.To’ => 22)

Parameters

  • rule_number<~Integer> - The rule number for the entry, between 100 and 32766
  • protocol<~Integer> - The IP protocol to which the rule applies. You can use -1 to mean all protocols.
  • rule_action<~String> - Allows or denies traffic that matches the rule. (either allow or deny)
  • cidr_block<~String> - The CIDR range to allow or deny
  • egress<~Boolean> - Indicates whether this rule applies to egress traffic from the subnet (true) or ingress traffic to the subnet (false).
  • options<~Hash>:
  • ‘Icmp.Code’ - ICMP code, required if protocol is 1
  • ‘Icmp.Type’ - ICMP type, required if protocol is 1
  • ‘PortRange.From’ - The first port in the range, required if protocol is 6 (TCP) or 17 (UDP)
  • ‘PortRange.To’ - The last port in the range, required if protocol is 6 (TCP) or 17 (UDP)

Returns

True or false depending on the result

Associate a subnet with this network ACL

network_acl.associate_with(subnet)

Parameters

  • subnet<~Subnet> - Subnet object to associate with this network ACL

Returns

True or false depending on the result

Removes an existing network ACL

network_acl.destroy

Returns

True or false depending on the result

Remove an inbound rule, shortcut method for remove_rule

Remove an outbound rule, shortcut method for remove_rule

Update a specific rule number

network_acl.remove_rule(100, true)

Parameters

  • rule_number<~Integer> - The rule number for the entry, between 100 and 32766
  • egress<~Boolean> - Indicates whether this rule applies to egress traffic from the subnet (true) or ingress traffic to the subnet (false).

Returns

True or false depending on the result

Create a network ACL

 >> g = AWS.network_acls.new(:vpc_id => 'vpc-abcdefgh')
 >> g.save

Update a specific rule number

network_acl.update_rule(100, Fog::Compute::AWS::NetworkAcl::TCP, ‘allow’, ‘0.0.0.0/0’, true, ‘PortRange.From’ => 22, ‘PortRange.To’ => 22)

Parameters

  • rule_number<~Integer> - The rule number for the entry, between 100 and 32766
  • protocol<~Integer> - The IP protocol to which the rule applies. You can use -1 to mean all protocols.
  • rule_action<~String> - Allows or denies traffic that matches the rule. (either allow or deny)
  • cidr_block<~String> - The CIDR range to allow or deny
  • egress<~Boolean> - Indicates whether this rule applies to egress traffic from the subnet (true) or ingress traffic to the subnet (false).
  • options<~Hash>:
  • ‘Icmp.Code’ - ICMP code, required if protocol is 1
  • ‘Icmp.Type’ - ICMP type, required if protocol is 1
  • ‘PortRange.From’ - The first port in the range, required if protocol is 6 (TCP) or 17 (UDP)
  • ‘PortRange.To’ - The last port in the range, required if protocol is 6 (TCP) or 17 (UDP)

Returns

True or false depending on the result

[Validate]