module AWS::EC2::TaggedItem

def add_tag key, options = {}

Returns:
  • (Tag) - The tag that was created.

Options Hash: (**options)
  • :value (String) -- An optional tag value.

Parameters:
  • options (Hash) --
  • key (String) -- The name of the tag to add.
def add_tag key, options = {}
  client.create_tags({
    :resources => [id],
    :tags => [{ :key => key, :value => options[:value].to_s }],
  })
  Tag.new(self, key, options.merge(:config => config))
end

def cached_tags

Other tags:
    Api: - private
def cached_tags
  if cache = AWS.response_cache
    cache.select(describe_call_name.to_sym).each do |resp|
      if obj = find_in_response(resp)
        return obj.tag_set.inject({}) do |hash, tag|
          hash[tag.key] = tag.value
          hash
        end
      end
    end
  end
  nil
end

def clear_tags

Returns:
  • (nil) -
def clear_tags
  client.delete_tags(:resources => [self.id])
  nil
end

def tagging_resource_type

Other tags:
    Api: - private
def tagging_resource_type
  Core::Inflection.ruby_name(self.class.to_s).tr("_","-")
end

def tags

Returns:
  • (ResourceTagCollection) - A collection of tags that

Other tags:
    Example: Manipulating the tags of an EC2 instance -
def tags
  ResourceTagCollection.new(self, :config => config)
end