Sha256: 0181e8f8235790681eb43e6cbed56bc3c4521960ad994b7d5750528fac47e9d5

Contents?: true

Size: 810 Bytes

Versions: 5

Compression:

Stored size: 810 Bytes

Contents

module Roark
  module Aws
    module CloudFormation
      class CreateStack

        def initialize(connection)
          @connection = connection
        end

        def create(args)
          name       = args[:name]
          parameters = args[:parameters]
          template   = args[:template]

          @connection.cf.stacks.create name, template, { :capabilities => capabilities,
                                                         :parameters   => format_parameters(parameters) }
        end

        private

        def format_parameters(parameters={})
          parameters.map do |p|
            { :parameter_key   => p.first,
              :parameter_value => p.last }
          end
        end

        def capabilities
          ['CAPABILITY_IAM']
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
roark-0.2.2 lib/roark/aws/cloud_formation/create_stack.rb
roark-0.2.1 lib/roark/aws/cloud_formation/create_stack.rb
roark-0.2.0 lib/roark/aws/cloud_formation/create_stack.rb
roark-0.1.0 lib/roark/aws/cloud_formation/create_stack.rb
roark-0.0.1 lib/roark/aws/cloud_formation/create_stack.rb