Sha256: 4879191d5d7575db66d64df762680588420701e68c0b9253db9140eaf42ee649
Contents?: true
Size: 1.57 KB
Versions: 8
Compression:
Stored size: 1.57 KB
Contents
require 'fog' module Stackster class AWS class CloudFormation def initialize(args) c = args[:config] @connect = Fog::AWS::CloudFormation.new :aws_access_key_id => c.access_key, :aws_secret_access_key => c.secret_key, :region => c.region end def create(args) parameters = { 'Parameters' => args[:parameters] } data = { 'Capabilities' => ['CAPABILITY_IAM'], 'TemplateBody' => args[:template] }.merge parameters @connect.create_stack(args[:name], data) end def update(args) parameters = { 'Parameters' => args[:parameters] } data = { 'Capabilities' => ['CAPABILITY_IAM'], 'TemplateBody' => args[:template] }.merge parameters @connect.update_stack(args[:name], data) end def destroy(name) @connect.delete_stack name end def describe_stack(name) @connect.describe_stacks('StackName' => name).body['Stacks'] end def stack_resources(name) @connect.describe_stack_resources('StackName' => name).body['StackResources'] end def stack_events(name) @connect.describe_stack_events(name).body['StackEvents'] end def stack_status(name) describe_stack(name).first['StackStatus'] end def stack_outputs(name) describe_stack(name).last['Outputs'] end def template(name) @connect.get_template(name).body['TemplateBody'] end end end end
Version data entries
8 entries across 8 versions & 1 rubygems