You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

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, #with_tag

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