Module: Aws::Record::ClientConfiguration

Included in:
Batch, Transactions
Defined in:
lib/aws-record/record/client_configuration.rb

Instance Method Summary collapse

Instance Method Details

#configure_client(opts = {}) ⇒ Object

Configures the Amazon DynamoDB client used by this class and all instances of this class.

Please note that this method is also called internally when you first attempt to perform an operation against the remote end, if you have not already configured a client. As such, please read and understand the documentation in the AWS SDK for Ruby around configuration to ensure you understand how default configuration behavior works. When in doubt, call this method to ensure your client is configured the way you want it to be configured.

Parameters:

  • opts (Hash) (defaults to: {})

    the options you wish to use to create the client. Note that if you include the option :client, all other options will be ignored. See the documentation for other options in the AWS SDK for Ruby.

Options Hash (opts):

  • :client (Aws::DynamoDB::Client)

    allows you to pass in your own pre-configured client.



35
36
37
# File 'lib/aws-record/record/client_configuration.rb', line 35

def configure_client(opts = {})
  @dynamodb_client = _build_client(opts)
end

#dynamodb_clientAws::DynamoDB::Client

Gets the https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/DynamoDB/Client.html instance that Transactions use. When called for the first time, if #configure_client has not yet been called, will configure a new client for you with default parameters.

Returns:

  • (Aws::DynamoDB::Client)

    the Amazon DynamoDB client instance.



46
47
48
# File 'lib/aws-record/record/client_configuration.rb', line 46

def dynamodb_client
  @dynamodb_client ||= configure_client
end