Class: AWS::EC2::NetworkACLCollection

Inherits:
Collection
  • Object
show all
Includes:
Core::Collection::Simple, TaggedCollection
Defined in:
lib/aws/ec2/network_acl_collection.rb

Instance Method Summary collapse

Methods included from Core::Collection

#each, #each_batch, #enum, #first, #in_groups_of, #page

Methods included from TaggedCollection

#tagged, #tagged_values

Methods included from FilteredCollection

#filter, #initialize

Instance Method Details

#[](network_acl_id) ⇒ NetworkACL

Parameters:

  • network_acl_id (String)

Returns:



45
46
47
# File 'lib/aws/ec2/network_acl_collection.rb', line 45

def [] network_acl_id
  NetworkACL.new(network_acl_id, :config => config)
end

#create(options = {}) ⇒ NetworkACL

Creates a network ACL.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :vpc (VPC, String)

    The vpc or vpc id of where you want to create the subnet.

Returns:



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/aws/ec2/network_acl_collection.rb', line 31

def create options = {}

  client_opts = {}
  client_opts[:vpc_id] = vpc_id_option(options)
  
  resp = client.create_network_acl(client_opts)

  NetworkACL.new_from(:create_network_acl, resp.network_acl,
    resp.network_acl.network_acl_id, :config => config)

end