Class: AWS::CloudFormation::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/stacco.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#service_registryObject

Returns the value of attribute service_registry.



32
33
34
# File 'lib/stacco.rb', line 32

def service_registry
  @service_registry
end

Instance Method Details

#bucketsObject



42
43
44
# File 'lib/stacco.rb', line 42

def buckets
  self.resources_of_type("S3::Bucket").map{ |res| @service_registry[:s3].buckets[res.physical_resource_id] }
end

#distributionsObject



38
39
40
# File 'lib/stacco.rb', line 38

def distributions
  self.resources_of_type("CloudFront::Distribution").map{ |res| @service_registry[:cloudfront].distributions[res.physical_resource_id] }
end

#elastic_ipsObject



46
47
48
# File 'lib/stacco.rb', line 46

def elastic_ips
  self.resources_of_type("EC2::EIP").map{ |res| @service_registry[:ec2].elastic_ips[res.physical_resource_id] }
end

#resources_of_type(type_name) ⇒ Object



34
35
36
# File 'lib/stacco.rb', line 34

def resources_of_type(type_name)
  self.resources.find_all{ |r| r.resource_type == "AWS::#{type_name}" && r.resource_status =~ /_COMPLETE/ && r.resource_status != "DELETE_COMPLETE" }
end