Module: Cloudshaper::Aws

Included in:
StackElement
Defined in:
lib/cloudshaper/aws/tagging.rb,
lib/cloudshaper/aws/remote_s3.rb

Overview

Aws provider-specific functionality, to be mixed in to stack elements

Defined Under Namespace

Modules: RemoteS3

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.taggable?(resource_type) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
14
# File 'lib/cloudshaper/aws/tagging.rb', line 4

def self.taggable?(resource_type)
  supports_tagging = [:aws_autoscaling_group, :aws_customer_gateway,
                      :aws_db_instance, :aws_elasticache_cluster,
                      :aws_elb, :aws_instance, :aws_internet_gateway,
                      :aws_network_acl, :aws_network_interface, :aws_route53_zone,
                      :aws_route_table, :aws_s3_bucket, :aws_security_group,
                      :aws_subnet, :aws_vpc, :aws_vpc_dhcp_options,
                      :aws_vpc_peering_connection, :aws_vpn_connection,
                      :aws_vpn_gateway]
  supports_tagging.include?(resource_type.to_sym)
end

Instance Method Details

#post_processing_awsObject

Tag all resources (that support tagging) that we created with this stack id



17
18
19
20
21
# File 'lib/cloudshaper/aws/tagging.rb', line 17

def post_processing_aws
  return unless Aws.taggable?(@resource_type)
  @fields[:tags] ||= {}
  @fields[:tags][:cloudshaper_stack_id] = var(:cloudshaper_stack_id)
end