Method: Cfer::Core::Resource#tag
- Defined in:
- lib/cfer/core/resource.rb
#tag(k, v, **options) ⇒ Object
Sets a tag on this resource. The resource must support the CloudFormation Tags property.
42 43 44 45 46 |
# File 'lib/cfer/core/resource.rb', line 42 def tag(k, v, **) self[:Properties][:Tags] ||= [] self[:Properties][:Tags].delete_if { |kv| kv["Key"] == k } self[:Properties][:Tags].unshift({"Key" => k, "Value" => v}.merge()) end |