lib/aws/core/configuration.rb in aws-sdk-1.3.4 vs lib/aws/core/configuration.rb in aws-sdk-1.3.5

- old
+ new

@@ -53,56 +53,70 @@ # # == Global Configuration # # The global default configuration can be found at {AWS.config} # - # @attr_reader [String,nil] access_key_id AWS access key id credential. - # Defaults to +nil+. + # @attr_reader [String,nil] access_key_id (nil) + # AWS access key id credential. # - # @attr_reader [String] ec2_endpoint The service endpoint for Amazon EC2. - # Defaults to 'ec2.amazonaws.com'. + # @attr_reader [String,nil] secret_access_key (nil) + # AWS secret access key credential. # + # @attr_reader [String,nil] session_token (nil) AWS secret token credential. + # + # @attr_reader [String] dynamo_db_endpoint ('dynamodb.us-east-1.amazonaws.com') + # The service endpoint for Amazon DynamoDB. + # + # @attr_reader [String] dynamo_db_retry_throughput_errors (true) When + # true, AWS::DynamoDB::Errors::ProvisionedThroughputExceededException + # errors will be retried. + # + # @attr_reader [String] ec2_endpoint ('ec2.amazonaws.com') + # The service endpoint for Amazon EC2. + # + # @attr_reader [String] elb_endpoint ('elasticloadbalancing.us-east-1.amazonaws.com') + # The service endpoint for Elastic Load Balancing. + # # @attr_reader [Object] http_handler The http handler that sends requests # to AWS. Defaults to an HTTP handler built on net/http. # - # @attr_reader [String] iam_endpoint The service endpoint for AWS Idenity - # Access Management (IAM). Defaults to 'iam.amazonaws.com'. + # @attr_reader [String] iam_endpoint ('iam.amazonaws.com') + # The service endpoint for AWS Idenity Access Management (IAM). # - # @attr_reader [Object,nil] logger A logger instance that + # @attr_reader [Object,nil] logger (nil) A logger instance that # should receive log messages generated by service requets. # A logger needs to respond to #log and must accept a # severity (e.g. :info, :error, etc) and a string message. - # Defaults to +nil+. # - # @attr_reader [Integer] max_retries The maximum number of times + # @attr_reader [Integer] max_retries (3) The maximum number of times # service errors (500) should be retried. There is an exponential # backoff in between service request retries, so the more retries the - # longer it can take to fail. Defautls to 3. + # longer it can take to fail. # - # @attr_reader [String, URI, nil] proxy_uri The URI of the proxy + # @attr_reader [String, URI, nil] proxy_uri (nil) The URI of the proxy # to send service requests through. You can pass a URI object or a # URI string. Defautls to +nil+. # # AWS.config(:proxy_uri => 'https://user:pass@my.proxy:443') # - # @attr_reader [String] s3_endpoint The service endpoint for Amazon S3. - # Defaults to 's3.amazonaws.com'. + # @attr_reader [String] s3_endpoint ('s3.amazonaws.com') + # The service endpoint for Amazon S3. # - # @attr_reader [Integer] s3_multipart_max_parts The maximum number of - # parts to split a file into when uploading in parts to S3. - # Defaults to 1000. + # @attr_reader [Integer] s3_multipart_max_parts (1000) + # The maximum number of parts to split a file into when uploading + # in parts to S3. # # @attr_reader [Integer] s3_multipart_threshold (16777216) When uploading # data to S3, if the number of bytes to send exceedes # +:s3_multipart_threshold+ then a multi part session is automatically # started and the data is sent up in chunks. The size of each part # is specified by +:s3_multipart_min_part_size+. Defaults to # 16777216 (16MB). # - # @attr_reader [Integer] s3_multipart_min_part_size The absolute minimum - # size (in bytes) each S3 multipart segment should be. - # Defaults to 5242880 (5MB). + # @attr_reader [Integer] s3_multipart_min_part_size (5242880) + # The absolute minimum size (in bytes) each S3 multipart + # segment should be defaults to 5242880 (5MB). # # @attr_reader [Symbol] s3_server_side_encryption The algorithm to # use when encrypting object data on the server side. The only # valid value is +:aes256+, which specifies that the object # should be stored using the AES encryption algorithm with 256 @@ -120,69 +134,64 @@ # You can construct an interface to Amazon S3 which always # stores data using server side encryption as follows: # # s3 = AWS::S3.new(:s3_server_side_encryption => :aes256) # - # @attr_reader [String,nil] secret_access_key AWS secret access key - # credential. Defaults to +nil+. + # @attr_reader [String] simple_db_endpoint ('sdb.amazonaws.com') + # The service endpoint for Amazon SimpleDB. # - # @attr_reader [String,nil] session_token AWS secret token credential. - # Defaults to +nil+. - # - # @attr_reader [String] simple_db_endpoint The service endpoint for Amazon - # SimpleDB. Defaults to 'sdb.amazonaws.com'. - # - # @attr_reader [Boolean] simple_db_consistent_reads Determines + # @attr_reader [Boolean] simple_db_consistent_reads (false) Determines # if all SimpleDB read requests should be done consistently. # Consistent reads are slower, but reflect all changes to SDB. - # Defaults to +false+. # - # @attr_reader [String] simple_email_service_endpoint The service endpoint - # for Amazon Simple Email Service. Defaults to - # 'email.us-east-1.amazonaws.com'. + # @attr_reader [String] simple_email_service_endpoint ('email.us-east-1.amazonaws.com') + # The service endpoint for Amazon Simple Email Service. # - # @attr_reader [Object] signer The request signer. Defaults to - # a default request signer implementation. + # @attr_reader [String] simple_workflow_endpoint ('swf.us-east-1.amazonaws.com') + # The service endpoint for Amazon Simple Workflow Service. # + # @attr_reader [Object] signer + # The request signer. Defaults to a default request signer implementation. + # # @attr_reader [String] ssl_ca_file The path to a CA cert bundle in # PEM format. # # If +ssl_verify_peer+ is true (the default) this bundle will be # used to validate the server certificate in each HTTPS request. # The AWS SDK for Ruby ships with a CA cert bundle, which is the # default value for this option. # - # @attr_reader [Boolean] ssl_verify_peer When +true+ + # @attr_reader [String] ssl_ca_path (nil) + # The path the a CA cert directory. + # + # @attr_reader [Boolean] ssl_verify_peer (true) When +true+ # the HTTP handler validate server certificates for HTTPS requests. - # Defaults to +true+. # # This option should only be disabled for diagnostic purposes; # leaving this option set to +false+ exposes your application to # man-in-the-middle attacks and can pose a serious security # risk. # - # @attr_reader [Boolean] stub_requests When +true+ requests are not + # @attr_reader [Boolean] stub_requests (false) When +true+ requests are not # sent to AWS, instead empty reponses are generated and returned to # each service request. # - # @attr_reader [String] sns_endpoint The service endpoint for Amazon SNS. - # Defaults to 'sns.us-east-1.amazonaws.com'. + # @attr_reader [String] sns_endpoint ('sns.us-east-1.amazonaws.com') + # The service endpoint for Amazon SNS. # - # @attr_reader [String] sqs_endpoint The service endpoint for Amazon SQS. - # Defaults to 'sqs.us-east-1.amazonaws.com'. + # @attr_reader [String] sqs_endpoint ('sqs.us-east-1.amazonaws.com') + # The service endpoint for Amazon SQS. # - # @attr_reader [String] sts_endpoint The service endpoint for AWS - # Security Token Service. Defaults to 'sts.amazonaws.com'. + # @attr_reader [String] sts_endpoint ('sts.amazonaws.com') + # The service endpoint for AWS Security Token Service. # - # @attr_reader [Boolean] use_ssl When +true+, all requests + # @attr_reader [Boolean] use_ssl (true) When +true+, all requests # to AWS are sent using HTTPS instead vanilla HTTP. - # Defaults to +true+. # - # @attr_reader [String] user_agent_prefix A string prefix to + # @attr_reader [String] user_agent_prefix (nil) A string prefix to # append to all requets against AWS services. This should be set # for clients and applications built ontop of the aws-sdk gem. - # Defaults to +nil+. # class Configuration # Creates a new Configuration object. # @param options (see AWS.config) @@ -196,9 +205,18 @@ if self.class.accepted_options.include?(opt_name) supplied[opt_name] = value end end + end + + # @return [Hash] Returns a hash with your configured credentials. + def credentials + credentials = {} + credentials[:access_key_id] = access_key_id + credentials[:secret_access_key] = secret_access_key + credentials[:session_token] = session_token if session_token + credentials end # Used to create a new Configuration object with the given modifications. # The current configuration object is not modified. #