Class: Aws::Plugins::GlobalConfiguration Private

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/global_configuration.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This plugin provides the ability to provide global configuration for all AWS classes or specific ones.

## Global AWS configuration

You can specify global configuration defaults via `Aws.config`

Aws.config[:region] = 'us-west-2'

Options applied to `Aws.config` are merged with constructed service interfaces.

# uses the global configuration
Aws::EC2.new.config.region #=> 'us-west-2'

# constructor args have priority over global configuration
Aws::EC2.new(region: 'us-east-1').config.region #=> 'us-east-1'

## Service Specific Global Configuration

Some services have very specific configuration options that are not shared by other services.

# oops, this option is only recognized by Aws::S3
Aws.config[:force_path_style] = true
Aws::EC2.new
#=> raises ArgumentError: invalid configuration option `:force_path_style'

To avoid this issue, you can nest service specific options

Aws.config[:s3] = { force_path_style: true }

Aws::EC2.new # no error this time
Aws::S3.new.config.force_path_style #=> true

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_handlers, #add_options, #after_initialize, after_initialize, after_initialize_hooks, before_initialize, before_initialize_hooks, handlers, literal, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Class Method Details

.add_identifier(identifier) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Registers an additional service identifier.



75
76
77
# File 'lib/aws-sdk-core/plugins/global_configuration.rb', line 75

def add_identifier(identifier)
  @identifiers << identifier
end

.identifiersSet<String>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



81
82
83
# File 'lib/aws-sdk-core/plugins/global_configuration.rb', line 81

def identifiers
  @identifiers
end

Instance Method Details

#before_initialize(client_class, options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
50
51
# File 'lib/aws-sdk-core/plugins/global_configuration.rb', line 47

def before_initialize(client_class, options)
  # apply service specific defaults before the global aws defaults
  apply_service_defaults(client_class, options)
  apply_aws_defaults(client_class, options)
end