Class: Aws::S3::Plugins::IADRegionalEndpoint

Inherits:
Seahorse::Client::Plugin
  • Object
show all
Defined in:
lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb

Class Method Summary collapse

Class Method Details

.resolve_iad_regional_endpoint(cfg) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/aws-sdk-s3/plugins/iad_regional_endpoint.rb', line 21

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