Sha256: a361faa2911fac3b6159c5fb6e0cb2985aaf6c1989c696d2c0c3c9254ced14ab

Contents?: true

Size: 1.26 KB

Versions: 71

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module Aws
  module S3
    module Plugins

      class IADRegionalEndpoint < Seahorse::Client::Plugin

        option(:s3_us_east_1_regional_endpoint,
          default: 'legacy',
          doc_type: String,
          docstring: <<-DOCS) do |cfg|
Pass in `regional` to enable the `us-east-1` regional endpoint.
Defaults to `legacy` mode which uses the global endpoint.
          DOCS
          resolve_iad_regional_endpoint(cfg)
        end

        private

        def self.resolve_iad_regional_endpoint(cfg)
          default_mode_value =
            if cfg.respond_to?(:defaults_mode_config_resolver)
              cfg.defaults_mode_config_resolver.resolve(:s3_us_east_1_regional_endpoint)
            end

          mode = ENV['AWS_S3_US_EAST_1_REGIONAL_ENDPOINT'] ||
            Aws.shared_config.s3_us_east_1_regional_endpoint(profile: cfg.profile) ||
            default_mode_value ||
            'legacy'
          mode = mode.downcase
          unless %w(legacy regional).include?(mode)
            raise ArgumentError, "expected :s3_us_east_1_regional_endpoint or"\
              " ENV['AWS_S3_US_EAST_1_REGIONAL_ENDPOINT'] to be `legacy` or"\
              " `regional`."
          end
          mode
        end

      end

    end
  end
end

Version data entries

71 entries across 71 versions & 1 rubygems

Version Path
aws-sdk-s3-1.174.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.173.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.172.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.171.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.170.1 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.170.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.169.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.168.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.167.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.166.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.165.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.164.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.163.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.162.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.161.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.160.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.159.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.158.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.157.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb
aws-sdk-s3-1.156.0 lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb