Method: AWS::EC2::TaggedItem#add_tag
- Defined in:
- lib/aws/ec2/tagged_item.rb
#add_tag(key, options = {}) ⇒ Tag Also known as: tag
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')
30 31 32 33 34 35 36 |
# File 'lib/aws/ec2/tagged_item.rb', line 30 def add_tag key, = {} client.({ :resources => [id], :tags => [{ :key => key, :value => [:value].to_s }], }) Tag.new(self, key, .merge(:config => config)) end |