Adds a single tag with an optional tag value.
# adds a tag with the key production resource.tag('production') # adds a tag with the optional value set to production resource.tag('role', :value => 'webserver')
@param [String] key The name of the tag to add. @param [Hash] options @option options [String] :value An optional tag value. @return [Tag] The tag that was created.
# File lib/aws/ec2/tagged_item.rb, line 30 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
@private
# File lib/aws/ec2/tagged_item.rb, line 79 def tagging_resource_type Core::Inflection.ruby_name(self.class.to_s).tr("_","-") end