Module: Convection::Model::Mixin::Taggable
- Included in:
- Template::Resource::AutoScalingGroup, Template::Resource::CloudFrontDistribution, Template::Resource::EC2CustomerGateway, Template::Resource::EC2DHCPOptions, Template::Resource::EC2Instance, Template::Resource::EC2InternetGateway, Template::Resource::EC2NetworkACL, Template::Resource::EC2RouteTable, Template::Resource::EC2SecurityGroup, Template::Resource::EC2Subnet, Template::Resource::EC2VPC, Template::Resource::EC2VPCPeeringConnection, Template::Resource::EC2VPNConnection, Template::Resource::EC2VPNGateway, Template::Resource::EC2Volume, Template::Resource::ELB, Template::Resource::ElastiCacheCluster, Template::Resource::ElastiCacheReplicationGroup, Template::Resource::RDSDBInstance, Template::Resource::RDSDBParameterGroup, Template::Resource::RDSDBSecurityGroup, Template::Resource::RDSDBSubnetGroup, Template::Resource::Route53HostedZone, Template::Resource::S3Bucket, Template::Resource::SQSQueue
- Defined in:
- lib/convection/model/mixin/taggable.rb
Overview
Add tag helpers to taddable resources
Instance Method Summary collapse
-
#immutable_metadata(purpose, target = '') ⇒ Object
Helper for Asgard.
- #render_tags(resource) ⇒ Object
- #tag(key, value) ⇒ Object
- #tags ⇒ Object
Instance Method Details
#immutable_metadata(purpose, target = '') ⇒ Object
Helper for Asgard
33 34 35 36 37 38 |
# File 'lib/convection/model/mixin/taggable.rb', line 33 def (purpose, target = '') tag('immutable_metadata', JSON.generate( :purpose => purpose, :target => target )) end |
#render_tags(resource) ⇒ Object
40 41 42 43 44 |
# File 'lib/convection/model/mixin/taggable.rb', line 40 def (resource) resource.tap do |r| r['Properties']['Tags'] = .render unless .empty? end end |
#tag(key, value) ⇒ Object
28 29 30 |
# File 'lib/convection/model/mixin/taggable.rb', line 28 def tag(key, value) [key] = value end |
#tags ⇒ Object
24 25 26 |
# File 'lib/convection/model/mixin/taggable.rb', line 24 def @tags ||= Tags.new end |