Class: AwsHelpers::CloudFormation::StackCreate

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_helpers/cloud_formation/stack_create.rb

Instance Method Summary collapse

Constructor Details

#initialize(cloud_formation_client, create_request) ⇒ StackCreate

Returns a new instance of StackCreate


8
9
10
11
12
13
# File 'lib/aws_helpers/cloud_formation/stack_create.rb', line 8

def initialize(cloud_formation_client, create_request)
  @cloud_formation_client = cloud_formation_client
  @create_request = create_request
  @stack_name = create_request[:stack_name]
  @stack_exists = StackExists.new(cloud_formation_client, @stack_name)
end

Instance Method Details

#executeObject


15
16
17
18
19
20
21
22
23
# File 'lib/aws_helpers/cloud_formation/stack_create.rb', line 15

def execute
  puts "Creating #{@stack_name}"
  @cloud_formation_client.create_stack(@create_request)

  until @stack_exists.execute
    sleep 5
  end
  StackProgress.new(@cloud_formation_client, @stack_name).execute
end