Sha256: c3f8b17ba9d6b5f662c004ae8489e5a2414db5125014f7fcd0970836c6650b97

Contents?: true

Size: 1003 Bytes

Versions: 152

Compression:

Stored size: 1003 Bytes

Contents

# frozen_string_literal: true

module Aws
  # @api private
  module Plugins
    # @api private
    class DefaultsMode < Seahorse::Client::Plugin

      option(:defaults_mode,
             default: 'legacy',
             doc_type: String,
             docstring: <<-DOCS
See {Aws::DefaultsModeConfiguration} for a list of the 
accepted modes and the configuration defaults that are included.
      DOCS
      ) do |cfg|
        resolve_defaults_mode(cfg)
      end

      option(:defaults_mode_config_resolver,
             doc_type: 'Aws::DefaultsModeConfigResolver') do |cfg|
        Aws::DefaultsModeConfigResolver.new(
          Aws::DefaultsModeConfiguration::SDK_DEFAULT_CONFIGURATION, cfg)
      end

      class << self
        private

        def resolve_defaults_mode(cfg)
          value = ENV['AWS_DEFAULTS_MODE']
          value ||= Aws.shared_config.defaults_mode(
            profile: cfg.profile
          )
          value&.downcase || "legacy"
        end
      end

    end
  end
end

Version data entries

152 entries across 152 versions & 1 rubygems

Version Path
aws-sdk-core-3.217.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.217.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.216.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.216.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.215.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.215.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.214.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.214.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.213.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.212.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.211.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.210.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.209.1 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.209.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.208.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.207.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.206.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.205.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.204.0 lib/aws-sdk-core/plugins/defaults_mode.rb
aws-sdk-core-3.203.0 lib/aws-sdk-core/plugins/defaults_mode.rb