class AWS::EC2::TagCollection

Represents all EC2 tags in an account.

def [] tag_name

Returns:
  • (Tag) - Returns a reference to a tag with the given name.
def [] tag_name
  super
end

def create resource, key, options = {}

Returns:
  • (Tag) -

Options Hash: (**optins)
  • :value (String) -- The optional tag value. When

Parameters:
  • options (Hash) --
  • key (String) -- The tag key (or name).
  • resource (Object) -- The item to tag. This should be a taggable

Other tags:
    Example: tagging with names (keys) and values -
    Example: tagging with names (keys) only -
def create resource, key, options = {}
  value = options[:value].to_s
  client.create_tags(
    :resources => [resource.id],
    :tags => [{ :key => key, :value => value }])
  Tag.new(resource, key, :value => value, :config => config)
end

def each &block

Returns:
  • (nil) -

Other tags:
    Yieldparam: tag -

Other tags:
    Yield: -
def each &block
  response = filtered_request(:describe_tags)
  response.tag_set.each do |tag|
    resource_class_name = Core::Inflection.class_name(tag.resource_type)
    if EC2.const_defined?(resource_class_name)
      resource_class = EC2.const_get(resource_class_name)
      resource = resource_class.new(tag.resource_id, :config => config)
    else
      resource = ResourceObject.new(tag.resource_id,
                                    :resource_type => tag.resource_type,
                                    :config => config)
    end
    yield(Tag.new(resource, tag.key))
  end
  nil
end

def member_class

def member_class
  Tag
end