Class: Clusters::Aws::VerifyProvisionStatusService

Inherits:
Object
  • Object
show all
Defined in:
app/services/clusters/aws/verify_provision_status_service.rb

Constant Summary collapse

INITIAL_INTERVAL =
5.minutes
POLL_INTERVAL =
1.minute
TIMEOUT =
30.minutes

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#providerObject (readonly)

Returns the value of attribute provider


6
7
8
# File 'app/services/clusters/aws/verify_provision_status_service.rb', line 6

def provider
  @provider
end

Instance Method Details

#execute(provider) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/services/clusters/aws/verify_provision_status_service.rb', line 12

def execute(provider)
  @provider = provider

  case cluster_stack.stack_status
  when 'CREATE_IN_PROGRESS'
    continue_creation
  when 'CREATE_COMPLETE'
    finalize_creation
  else
    provider.make_errored!("Unexpected status; #{cluster_stack.stack_status}")
  end
rescue ::Aws::CloudFormation::Errors::ServiceError => e
  provider.make_errored!("Amazon CloudFormation request failed; #{e.message}")
end