Method: Sfn::CommandModule::Base::InstanceMethods#provider

Defined in:
lib/sfn/command_module/base.rb

#providerKnifeCloudformation::Provider

Returns:

  • (KnifeCloudformation::Provider)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/sfn/command_module/base.rb', line 17

def provider
  memoize(:provider, :direct) do
    result = Sfn::Provider.new(
      :miasma => config[:credentials],
      :async => false,
      :fetch => false
    )
    result.connection.data[:stack_types] = (
      [
        result.connection.class.const_get(:RESOURCE_MAPPING).detect do |klass, info|
          info[:api] == :orchestration
        end.first
      ] + custom_stack_types
    ).compact.uniq
    result.connection.data[:retry_ui] = ui
    result.connection.data[:locations] = config.fetch(:locations, {})
    result.connection.data[:retry_type] = config.fetch(:retry, :type, :exponential)
    result.connection.data[:retry_interval] = config.fetch(:retry, :interval, 5)
    result.connection.data[:retry_max] = config.fetch(:retry, :max_attempts, 20)
    result
  end
end