Class: AWS.S3

Inherits:
AWS.Service show all
Identifier:
s3
API Version:
2006-03-01
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Sending a Request Using S3

var s3 = new AWS.S3();
s3.abortMultipartUpload(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the S3 object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var s3 = new AWS.S3({apiVersion: '2006-03-01'});

You can also set the API version globally in AWS.config.apiVersions using the s3 service identifier:

AWS.config.apiVersions = {
  s3: '2006-03-01',
  // other service API versions
};

var s3 = new AWS.S3();

Version:

  • 2006-03-01

Defined Under Namespace

Classes: ManagedUpload

Waiter Resource States

This service supports a list of resource states that can be polled using the waitFor() method. The resource states are:

bucketExists, bucketNotExists, objectExists, objectNotExists

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, defineService

Constructor Details

new AWS.S3(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a S3 object

var s3 = new AWS.S3({apiVersion: '2006-03-01'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.S3.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.S3.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.S3.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean)

    whether parameter validation is on.

  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

abortMultipartUpload(params = {}, callback) ⇒ AWS.Request

Aborts a multipart upload.

To verify that all parts have been removed, so you don't get charged for the part storage, you should call the List Parts operation and ensure the parts list is empty.

Examples:

Calling the abortMultipartUpload operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  UploadId: 'STRING_VALUE' /* required */
};
s3.abortMultipartUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)
    • UploadId — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

completeMultipartUpload(params = {}, callback) ⇒ AWS.Request

Completes a multipart upload by assembling previously uploaded parts.

Examples:

Calling the completeMultipartUpload operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  UploadId: 'STRING_VALUE', /* required */
  MultipartUpload: {
    Parts: [
      {
        ETag: 'STRING_VALUE',
        PartNumber: 0
      },
      /* more items */
    ]
  }
};
s3.completeMultipartUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)
    • MultipartUpload — (map)
      • Parts — (Array<map>)
        • ETag — (String) Entity tag returned when the part was uploaded.
        • PartNumber — (Integer) Part number that identifies the part.
    • UploadId — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Location — (String)
      • Bucket — (String)
      • Key — (String)
      • Expiration — (Date) If the object expiration is configured, this will contain the expiration date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded.
      • ETag — (String) Entity tag of the object.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • VersionId — (String) Version of the object.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

copyObject(params = {}, callback) ⇒ AWS.Request

Creates a copy of an object that is already stored in Amazon S3.

Examples:

Calling the copyObject operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  CopySource: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  ACL: 'private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control',
  CacheControl: 'STRING_VALUE',
  ContentDisposition: 'STRING_VALUE',
  ContentEncoding: 'STRING_VALUE',
  ContentLanguage: 'STRING_VALUE',
  ContentType: 'STRING_VALUE',
  CopySourceIfMatch: 'STRING_VALUE',
  CopySourceIfModifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  CopySourceIfNoneMatch: 'STRING_VALUE',
  CopySourceIfUnmodifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  CopySourceSSECustomerAlgorithm: 'STRING_VALUE',
  CopySourceSSECustomerKey: 'STRING_VALUE',
  CopySourceSSECustomerKeyMD5: 'STRING_VALUE',
  Expires: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  GrantFullControl: 'STRING_VALUE',
  GrantRead: 'STRING_VALUE',
  GrantReadACP: 'STRING_VALUE',
  GrantWriteACP: 'STRING_VALUE',
  Metadata: {
    someKey: 'STRING_VALUE',
    /* anotherKey: ... */
  },
  MetadataDirective: 'COPY | REPLACE',
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE',
  SSEKMSKeyId: 'STRING_VALUE',
  ServerSideEncryption: 'AES256',
  StorageClass: 'STANDARD | REDUCED_REDUNDANCY',
  WebsiteRedirectLocation: 'STRING_VALUE'
};
s3.copyObject(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ACL — (String) The canned ACL to apply to the object. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
      • "bucket-owner-read"
      • "bucket-owner-full-control"
    • Bucket — (String)
    • CacheControl — (String) Specifies caching behavior along the request/reply chain.
    • ContentDisposition — (String) Specifies presentational information for the object.
    • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    • ContentLanguage — (String) The language the content is in.
    • ContentType — (String) A standard MIME type describing the format of the object data.
    • CopySource — (String) The name of the source bucket and key name of the source object, separated by a slash (/). Must be URL-encoded.
    • CopySourceIfMatch — (String) Copies the object if its entity tag (ETag) matches the specified tag.
    • CopySourceIfModifiedSince — (Date) Copies the object if it has been modified since the specified time.
    • CopySourceIfNoneMatch — (String) Copies the object if its entity tag (ETag) is different than the specified ETag.
    • CopySourceIfUnmodifiedSince — (Date) Copies the object if it hasn't been modified since the specified time.
    • Expires — (Date) The date and time at which the object is no longer cacheable.
    • GrantFullControl — (String) Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
    • GrantRead — (String) Allows grantee to read the object data and its metadata.
    • GrantReadACP — (String) Allows grantee to read the object ACL.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable object.
    • Key — (String)
    • Metadata — (map<String>) A map of metadata to store with the object in S3.
    • MetadataDirective — (String) Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request. Possible values include:
      • "COPY"
      • "REPLACE"
    • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
      • "AES256"
    • StorageClass — (String) The type of storage to use for the object. Defaults to 'STANDARD'. Possible values include:
      • "STANDARD"
      • "REDUCED_REDUNDANCY"
    • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.
    • SSEKMSKeyId — (String) Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
    • CopySourceSSECustomerAlgorithm — (String) Specifies the algorithm to use when decrypting the source object (e.g., AES256).
    • CopySourceSSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.
    • CopySourceSSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • CopyObjectResult — (map)
        • ETag — (String)
        • LastModified — (Date)
      • Expiration — (Date) If the object expiration is configured, the response includes this header.
      • CopySourceVersionId — (String)
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBucket(params, callback) ⇒ AWS.Request

Creates a new bucket.

Examples:

Calling the createBucket operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  ACL: 'private | public-read | public-read-write | authenticated-read',
  CreateBucketConfiguration: {
    LocationConstraint: 'EU | eu-west-1 | us-west-1 | us-west-2 | ap-southeast-1 | ap-southeast-2 | ap-northeast-1 | sa-east-1 |  | cn-north-1 | eu-central-1'
  },
  GrantFullControl: 'STRING_VALUE',
  GrantRead: 'STRING_VALUE',
  GrantReadACP: 'STRING_VALUE',
  GrantWrite: 'STRING_VALUE',
  GrantWriteACP: 'STRING_VALUE'
};
s3.createBucket(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • ACL — (String) The canned ACL to apply to the bucket. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
    • Bucket — (String)
    • CreateBucketConfiguration — (map)
      • LocationConstraint — (String) Specifies the region where the bucket will be created. Possible values include:
        • "EU"
        • "eu-west-1"
        • "us-west-1"
        • "us-west-2"
        • "ap-southeast-1"
        • "ap-southeast-2"
        • "ap-northeast-1"
        • "sa-east-1"
        • ""
        • "cn-north-1"
        • "eu-central-1"
    • GrantFullControl — (String) Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
    • GrantRead — (String) Allows grantee to list the objects in the bucket.
    • GrantReadACP — (String) Allows grantee to read the bucket ACL.
    • GrantWrite — (String) Allows grantee to create, overwrite, and delete any object in the bucket.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable bucket.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Location — (String)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createMultipartUpload(params = {}, callback) ⇒ AWS.Request

Initiates a multipart upload and returns an upload ID.

Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.

Examples:

Calling the createMultipartUpload operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  ACL: 'private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control',
  CacheControl: 'STRING_VALUE',
  ContentDisposition: 'STRING_VALUE',
  ContentEncoding: 'STRING_VALUE',
  ContentLanguage: 'STRING_VALUE',
  ContentType: 'STRING_VALUE',
  Expires: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  GrantFullControl: 'STRING_VALUE',
  GrantRead: 'STRING_VALUE',
  GrantReadACP: 'STRING_VALUE',
  GrantWriteACP: 'STRING_VALUE',
  Metadata: {
    someKey: 'STRING_VALUE',
    /* anotherKey: ... */
  },
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE',
  SSEKMSKeyId: 'STRING_VALUE',
  ServerSideEncryption: 'AES256',
  StorageClass: 'STANDARD | REDUCED_REDUNDANCY',
  WebsiteRedirectLocation: 'STRING_VALUE'
};
s3.createMultipartUpload(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ACL — (String) The canned ACL to apply to the object. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
      • "bucket-owner-read"
      • "bucket-owner-full-control"
    • Bucket — (String)
    • CacheControl — (String) Specifies caching behavior along the request/reply chain.
    • ContentDisposition — (String) Specifies presentational information for the object.
    • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    • ContentLanguage — (String) The language the content is in.
    • ContentType — (String) A standard MIME type describing the format of the object data.
    • Expires — (Date) The date and time at which the object is no longer cacheable.
    • GrantFullControl — (String) Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
    • GrantRead — (String) Allows grantee to read the object data and its metadata.
    • GrantReadACP — (String) Allows grantee to read the object ACL.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable object.
    • Key — (String)
    • Metadata — (map<String>) A map of metadata to store with the object in S3.
    • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
      • "AES256"
    • StorageClass — (String) The type of storage to use for the object. Defaults to 'STANDARD'. Possible values include:
      • "STANDARD"
      • "REDUCED_REDUNDANCY"
    • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.
    • SSEKMSKeyId — (String) Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Bucket — (String) Name of the bucket to which the multipart upload was initiated.
      • Key — (String) Object key for which the multipart upload was initiated.
      • UploadId — (String) ID for the initiated multipart upload.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBucket(params = {}, callback) ⇒ AWS.Request

Deletes the bucket. All objects (including all object versions and Delete Markers) in the bucket must be deleted before the bucket itself can be deleted.

Examples:

Calling the deleteBucket operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.deleteBucket(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBucketCors(params = {}, callback) ⇒ AWS.Request

Deletes the cors configuration information set for the bucket.

Examples:

Calling the deleteBucketCors operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.deleteBucketCors(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBucketLifecycle(params = {}, callback) ⇒ AWS.Request

Deletes the lifecycle configuration from the bucket.

Examples:

Calling the deleteBucketLifecycle operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.deleteBucketLifecycle(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBucketPolicy(params = {}, callback) ⇒ AWS.Request

Deletes the policy from the bucket.

Examples:

Calling the deleteBucketPolicy operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.deleteBucketPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBucketTagging(params = {}, callback) ⇒ AWS.Request

Deletes the tags from the bucket.

Examples:

Calling the deleteBucketTagging operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.deleteBucketTagging(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBucketWebsite(params = {}, callback) ⇒ AWS.Request

This operation removes the website configuration from the bucket.

Examples:

Calling the deleteBucketWebsite operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.deleteBucketWebsite(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteObject(params = {}, callback) ⇒ AWS.Request

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects.

Examples:

Calling the deleteObject operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  MFA: 'STRING_VALUE',
  VersionId: 'STRING_VALUE'
};
s3.deleteObject(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)
    • MFA — (String) The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
    • VersionId — (String) VersionId used to reference a specific version of the object.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DeleteMarker — (Boolean) Specifies whether the versioned object that was permanently deleted was (true) or was not (false) a delete marker.
      • VersionId — (String) Returns the version ID of the delete marker created as a result of the DELETE operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteObjects(params = {}, callback) ⇒ AWS.Request

This operation enables you to delete multiple objects from a bucket using a single HTTP request. You may specify up to 1000 keys.

Examples:

Calling the deleteObjects operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Delete: { /* required */
    Objects: [ /* required */
      {
        Key: 'STRING_VALUE', /* required */
        VersionId: 'STRING_VALUE'
      },
      /* more items */
    ],
    Quiet: true || false
  },
  MFA: 'STRING_VALUE'
};
s3.deleteObjects(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Delete — (map)
      • Objectsrequired — (Array<map>)
        • Keyrequired — (String) Key name of the object to delete.
        • VersionId — (String) VersionId for the specific version of the object to delete.
      • Quiet — (Boolean) Element to enable quiet mode for the request. When you add this element, you must set its value to true.
    • MFA — (String) The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Deleted — (Array<map>)
        • Key — (String)
        • VersionId — (String)
        • DeleteMarker — (Boolean)
        • DeleteMarkerVersionId — (String)
      • Errors — (Array<map>)
        • Key — (String)
        • VersionId — (String)
        • Code — (String)
        • Message — (String)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketAcl(params = {}, callback) ⇒ AWS.Request

Gets the access control policy for the bucket.

Examples:

Calling the getBucketAcl operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketAcl(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Owner — (map)
        • DisplayName — (String)
        • ID — (String)
      • Grants — (Array<map>) A list of grants.
        • Grantee — (map)
          • DisplayName — (String) Screen name of the grantee.
          • EmailAddress — (String) Email address of the grantee.
          • ID — (String) The canonical user ID of the grantee.
          • Typerequired — (String) Type of grantee Possible values include:
            • "CanonicalUser"
            • "AmazonCustomerByEmail"
            • "Group"
          • URI — (String) URI of the grantee group.
        • Permission — (String) Specifies the permission given to the grantee. Possible values include:
          • "FULL_CONTROL"
          • "WRITE"
          • "WRITE_ACP"
          • "READ"
          • "READ_ACP"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketCors(params = {}, callback) ⇒ AWS.Request

Returns the cors configuration for the bucket.

Examples:

Calling the getBucketCors operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketCors(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • CORSRules — (Array<map>)
        • AllowedHeaders — (Array<String>) Specifies which headers are allowed in a pre-flight OPTIONS request.
        • AllowedMethods — (Array<String>) Identifies HTTP methods that the domain/origin specified in the rule is allowed to execute.
        • AllowedOrigins — (Array<String>) One or more origins you want customers to be able to access the bucket from.
        • ExposeHeaders — (Array<String>) One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).
        • MaxAgeSeconds — (Integer) The time in seconds that your browser is to cache the preflight response for the specified resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketLifecycle(params = {}, callback) ⇒ AWS.Request

Returns the lifecycle configuration information set on the bucket.

Examples:

Calling the getBucketLifecycle operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketLifecycle(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Rules — (Array<map>)
        • Expiration — (map)
          • Date — (Date) Indicates at what date the object is to be moved or deleted. Should be in GMT ISO 8601 Format.
          • Days — (Integer) Indicates the lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
        • ID — (String) Unique identifier for the rule. The value cannot be longer than 255 characters.
        • Prefixrequired — (String) Prefix identifying one or more objects to which the rule applies.
        • Statusrequired — (String) If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. Possible values include:
          • "Enabled"
          • "Disabled"
        • Transition — (map)
          • StorageClass — (String) The class of storage used to store the object. Possible values include:
            • "GLACIER"
        • NoncurrentVersionTransition — (map) Container for the transition rule that describes when noncurrent objects transition to the GLACIER storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the GLACIER storage class at a specific period in the object's lifetime.
        • NoncurrentVersionExpiration — (map) Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketLocation(params = {}, callback) ⇒ AWS.Request

Returns the region the bucket resides in.

Examples:

Calling the getBucketLocation operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketLocation(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LocationConstraint — (String) Possible values include:
        • "EU"
        • "eu-west-1"
        • "us-west-1"
        • "us-west-2"
        • "ap-southeast-1"
        • "ap-southeast-2"
        • "ap-northeast-1"
        • "sa-east-1"
        • ""
        • "cn-north-1"
        • "eu-central-1"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketLogging(params = {}, callback) ⇒ AWS.Request

Returns the logging status of a bucket and the permissions users have to view and modify that status. To use GET, you must be the bucket owner.

Examples:

Calling the getBucketLogging operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketLogging(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • LoggingEnabled — (map)
        • TargetBucket — (String) Specifies the bucket where you want Amazon S3 to store server access logs. You can have your logs delivered to any bucket that you own, including the same bucket that is being logged. You can also configure multiple buckets to deliver their logs to the same target bucket. In this case you should choose a different TargetPrefix for each source bucket so that the delivered log files can be distinguished by key.
        • TargetGrants — (Array<map>)
          • Grantee — (map)
            • DisplayName — (String) Screen name of the grantee.
            • EmailAddress — (String) Email address of the grantee.
            • ID — (String) The canonical user ID of the grantee.
            • Typerequired — (String) Type of grantee Possible values include:
              • "CanonicalUser"
              • "AmazonCustomerByEmail"
              • "Group"
            • URI — (String) URI of the grantee group.
          • Permission — (String) Logging permissions assigned to the Grantee for the bucket. Possible values include:
            • "FULL_CONTROL"
            • "READ"
            • "WRITE"
        • TargetPrefix — (String) This element lets you specify a prefix for the keys that the log files will be stored under.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketNotification(params = {}, callback) ⇒ AWS.Request

Return the notification configuration of a bucket.

Examples:

Calling the getBucketNotification operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketNotification(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TopicConfiguration — (map)
        • Id — (String)
        • Events — (Array<String>)
        • Topic — (String) Amazon SNS topic to which Amazon S3 will publish a message to report the specified events for the bucket.
      • QueueConfiguration — (map)
        • Id — (String)
        • Event — (String) Possible values include:
          • "s3:ReducedRedundancyLostObject"
          • "s3:ObjectCreated:Put"
          • "s3:ObjectCreated:Post"
          • "s3:ObjectCreated:Copy"
          • "s3:ObjectCreated:CompleteMultipartUpload"
        • Events — (Array<String>)
        • Queue — (String)
      • CloudFunctionConfiguration — (map)
        • Id — (String)
        • Event — (String) Possible values include:
          • "s3:ReducedRedundancyLostObject"
          • "s3:ObjectCreated:Put"
          • "s3:ObjectCreated:Post"
          • "s3:ObjectCreated:Copy"
          • "s3:ObjectCreated:CompleteMultipartUpload"
        • Events — (Array<String>)
        • CloudFunction — (String)
        • InvocationRole — (String)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketPolicy(params = {}, callback) ⇒ AWS.Request

Returns the policy of a specified bucket.

Examples:

Calling the getBucketPolicy operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Policy — (String) The bucket policy as a JSON document.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketRequestPayment(params = {}, callback) ⇒ AWS.Request

Returns the request payment configuration of a bucket.

Examples:

Calling the getBucketRequestPayment operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketRequestPayment(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Payer — (String) Specifies who pays for the download and request fees. Possible values include:
        • "Requester"
        • "BucketOwner"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketTagging(params = {}, callback) ⇒ AWS.Request

Returns the tag set associated with the bucket.

Examples:

Calling the getBucketTagging operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketTagging(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • TagSet — (Array<map>)
        • Keyrequired — (String) Name of the tag.
        • Valuerequired — (String) Value of the tag.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketVersioning(params = {}, callback) ⇒ AWS.Request

Returns the versioning state of a bucket.

Examples:

Calling the getBucketVersioning operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketVersioning(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Status — (String) The versioning state of the bucket. Possible values include:
        • "Enabled"
        • "Suspended"
      • MFADelete — (String) Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned. Possible values include:
        • "Enabled"
        • "Disabled"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBucketWebsite(params = {}, callback) ⇒ AWS.Request

Returns the website configuration for a bucket.

Examples:

Calling the getBucketWebsite operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.getBucketWebsite(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • RedirectAllRequestsTo — (map)
        • HostNamerequired — (String) Name of the host where requests will be redirected.
        • Protocol — (String) Protocol to use (http, https) when redirecting requests. The default is the protocol that is used in the original request. Possible values include:
          • "http"
          • "https"
      • IndexDocument — (map)
        • Suffixrequired — (String) A suffix that is appended to a request that is for a directory on the website endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ the data that is returned will be for the object with the key name images/index.html) The suffix must not be empty and must not include a slash character.
      • ErrorDocument — (map)
        • Keyrequired — (String) The object key name to use when a 4XX class error occurs.
      • RoutingRules — (Array<map>)
        • Condition — (map) A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the /docs folder, redirect to the /documents folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.
          • HttpErrorCodeReturnedEquals — (String) The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied.
          • KeyPrefixEquals — (String) The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be /docs, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied.
        • Redirectrequired — (map) Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can can specify a different error code to return.
          • HostName — (String) The host name to use in the redirect request.
          • HttpRedirectCode — (String) The HTTP redirect code to use on the response. Not required if one of the siblings is present.
          • Protocol — (String) Protocol to use (http, https) when redirecting requests. The default is the protocol that is used in the original request. Possible values include:
            • "http"
            • "https"
          • ReplaceKeyPrefixWith — (String) The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.
          • ReplaceKeyWith — (String) The specific object key to use in the redirect request. For example, redirect request to error.html. Not required if one of the sibling is present. Can be present only if ReplaceKeyPrefixWith is not provided.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getObject(params = {}, callback) ⇒ AWS.Request

Retrieves objects from Amazon S3.

Examples:

Calling the getObject operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  IfMatch: 'STRING_VALUE',
  IfModifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  IfNoneMatch: 'STRING_VALUE',
  IfUnmodifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  Range: 'STRING_VALUE',
  ResponseCacheControl: 'STRING_VALUE',
  ResponseContentDisposition: 'STRING_VALUE',
  ResponseContentEncoding: 'STRING_VALUE',
  ResponseContentLanguage: 'STRING_VALUE',
  ResponseContentType: 'STRING_VALUE',
  ResponseExpires: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE',
  VersionId: 'STRING_VALUE'
};
s3.getObject(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • IfMatch — (String) Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).
    • IfModifiedSince — (Date) Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).
    • IfNoneMatch — (String) Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).
    • IfUnmodifiedSince — (Date) Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).
    • Key — (String)
    • Range — (String) Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
    • ResponseCacheControl — (String) Sets the Cache-Control header of the response.
    • ResponseContentDisposition — (String) Sets the Content-Disposition header of the response
    • ResponseContentEncoding — (String) Sets the Content-Encoding header of the response.
    • ResponseContentLanguage — (String) Sets the Content-Language header of the response.
    • ResponseContentType — (String) Sets the Content-Type header of the response.
    • ResponseExpires — (Date) Sets the Expires header of the response.
    • VersionId — (String) VersionId used to reference a specific version of the object.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Body — (Buffer, Typed Array, Blob, String, ReadableStream) Object data.
      • DeleteMarker — (Boolean) Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.
      • AcceptRanges — (String)
      • Expiration — (Date) If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
      • Restore — (String) Provides information about object restoration operation and expiration time of the restored object copy.
      • LastModified — (Date) Last modified date of the object
      • ContentLength — (Integer) Size of the body in bytes.
      • ETag — (String) An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL
      • MissingMeta — (Integer) This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
      • VersionId — (String) Version of the object.
      • CacheControl — (String) Specifies caching behavior along the request/reply chain.
      • ContentDisposition — (String) Specifies presentational information for the object.
      • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
      • ContentLanguage — (String) The language the content is in.
      • ContentType — (String) A standard MIME type describing the format of the object data.
      • Expires — (Date) The date and time at which the object is no longer cacheable.
      • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • Metadata — (map<String>) A map of metadata to store with the object in S3.
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getObjectAcl(params = {}, callback) ⇒ AWS.Request

Returns the access control list (ACL) of an object.

Examples:

Calling the getObjectAcl operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  VersionId: 'STRING_VALUE'
};
s3.getObjectAcl(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)
    • VersionId — (String) VersionId used to reference a specific version of the object.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Owner — (map)
        • DisplayName — (String)
        • ID — (String)
      • Grants — (Array<map>) A list of grants.
        • Grantee — (map)
          • DisplayName — (String) Screen name of the grantee.
          • EmailAddress — (String) Email address of the grantee.
          • ID — (String) The canonical user ID of the grantee.
          • Typerequired — (String) Type of grantee Possible values include:
            • "CanonicalUser"
            • "AmazonCustomerByEmail"
            • "Group"
          • URI — (String) URI of the grantee group.
        • Permission — (String) Specifies the permission given to the grantee. Possible values include:
          • "FULL_CONTROL"
          • "WRITE"
          • "WRITE_ACP"
          • "READ"
          • "READ_ACP"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getObjectTorrent(params = {}, callback) ⇒ AWS.Request

Return torrent files from a bucket.

Examples:

Calling the getObjectTorrent operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE' /* required */
};
s3.getObjectTorrent(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Body — (Buffer, Typed Array, Blob, String, ReadableStream)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getSignedUrl(operation, params, callback) ⇒ String?

Note:

You must ensure that you have static or previously resolved credentials if you call this method synchronously (with no callback), otherwise it may not properly sign the request. If you cannot guarantee this (you are using an asynchronous credential provider, i.e., EC2 IAM roles), you should always call this method with an asynchronous callback.

Get a pre-signed URL for a given operation name.

Examples:

Pre-signing a getObject operation (synchronously)

var params = {Bucket: 'bucket', Key: 'key'};
var url = s3.getSignedUrl('getObject', params);
console.log('The URL is', url);

Pre-signing a putObject (asynchronously)

var params = {Bucket: 'bucket', Key: 'key'};
s3.getSignedUrl('putObject', params, function (err, url) {
  console.log('The URL is', url);
});

Pre-signing a putObject operation with a specific payload

var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};
var url = s3.getSignedUrl('putObject', params);
console.log('The URL is', url);

Passing in a 1-minute expiry time for a pre-signed URL

var params = {Bucket: 'bucket', Key: 'key', Expires: 60};
var url = s3.getSignedUrl('getObject', params);
console.log('The URL is', url); // expires in 60 seconds

Parameters:

  • operation (String)

    the name of the operation to call

  • params (map)

    parameters to pass to the operation. See the given operation for the expected operation parameters. In addition, you can also pass the "Expires" parameter to inform S3 how long the URL should work for.

  • callback (Function)

    if a callback is provided, this function will pass the URL as the second parameter (after the error parameter) to the callback function.

Options Hash (params):

  • Expires (Integer) — default: 900

    the number of seconds to expire the pre-signed URL operation in. Defaults to 15 minutes.

Returns:

  • (String)

    if called synchronously (with no callback), returns the signed URL.

  • (null)

    nothing is returned if a callback is provided.

headBucket(params = {}, callback) ⇒ AWS.Request

This operation is useful to determine if a bucket exists and you have permission to access it.

Examples:

Calling the headBucket operation

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.headBucket(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

headObject(params = {}, callback) ⇒ AWS.Request

The HEAD operation retrieves metadata from an object without returning the object itself. This operation is useful if you're only interested in an object's metadata. To use HEAD, you must have READ access to the object.

Examples:

Calling the headObject operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  IfMatch: 'STRING_VALUE',
  IfModifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  IfNoneMatch: 'STRING_VALUE',
  IfUnmodifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  Range: 'STRING_VALUE',
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE',
  VersionId: 'STRING_VALUE'
};
s3.headObject(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • IfMatch — (String) Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).
    • IfModifiedSince — (Date) Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).
    • IfNoneMatch — (String) Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).
    • IfUnmodifiedSince — (Date) Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).
    • Key — (String)
    • Range — (String) Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
    • VersionId — (String) VersionId used to reference a specific version of the object.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DeleteMarker — (Boolean) Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.
      • AcceptRanges — (String)
      • Expiration — (Date) If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
      • Restore — (String) Provides information about object restoration operation and expiration time of the restored object copy.
      • LastModified — (Date) Last modified date of the object
      • ContentLength — (Integer) Size of the body in bytes.
      • ETag — (String) An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL
      • MissingMeta — (Integer) This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
      • VersionId — (String) Version of the object.
      • CacheControl — (String) Specifies caching behavior along the request/reply chain.
      • ContentDisposition — (String) Specifies presentational information for the object.
      • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
      • ContentLanguage — (String) The language the content is in.
      • ContentType — (String) A standard MIME type describing the format of the object data.
      • Expires — (Date) The date and time at which the object is no longer cacheable.
      • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • Metadata — (map<String>) A map of metadata to store with the object in S3.
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

listBuckets(params = {}, callback) ⇒ AWS.Request

Returns a list of all buckets owned by the authenticated sender of the request.

Examples:

Calling the listBuckets operation

s3.listBuckets(function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Buckets — (Array<map>)
        • Name — (String) The name of the bucket.
        • CreationDate — (Date) Date the bucket was created.
      • Owner — (map)
        • DisplayName — (String)
        • ID — (String)

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listMultipartUploads(params = {}, callback) ⇒ AWS.Request

This operation lists in-progress multipart uploads.

Examples:

Calling the listMultipartUploads operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Delimiter: 'STRING_VALUE',
  EncodingType: 'url',
  KeyMarker: 'STRING_VALUE',
  MaxUploads: 0,
  Prefix: 'STRING_VALUE',
  UploadIdMarker: 'STRING_VALUE'
};
s3.listMultipartUploads(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Delimiter — (String) Character you use to group keys.
    • EncodingType — (String) Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. Possible values include:
      • "url"
    • KeyMarker — (String) Together with upload-id-marker, this parameter specifies the multipart upload after which listing should begin.
    • MaxUploads — (Integer) Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the response body. 1,000 is the maximum number of uploads that can be returned in a response.
    • Prefix — (String) Lists in-progress uploads only for those keys that begin with the specified prefix.
    • UploadIdMarker — (String) Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker is not specified, the upload-id-marker parameter is ignored.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Bucket — (String) Name of the bucket to which the multipart upload was initiated.
      • KeyMarker — (String) The key at or after which the listing began.
      • UploadIdMarker — (String) Upload ID after which listing began.
      • NextKeyMarker — (String) When a list is truncated, this element specifies the value that should be used for the key-marker request parameter in a subsequent request.
      • Prefix — (String) When a prefix is provided in the request, this field contains the specified prefix. The result contains only keys starting with the specified prefix.
      • Delimiter — (String)
      • NextUploadIdMarker — (String) When a list is truncated, this element specifies the value that should be used for the upload-id-marker request parameter in a subsequent request.
      • MaxUploads — (Integer) Maximum number of multipart uploads that could have been included in the response.
      • IsTruncated — (Boolean) Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that the list was truncated. The list can be truncated if the number of multipart uploads exceeds the limit allowed or specified by max uploads.
      • Uploads — (Array<map>)
        • UploadId — (String) Upload ID that identifies the multipart upload.
        • Key — (String) Key of the object for which the multipart upload was initiated.
        • Initiated — (Date) Date and time at which the multipart upload was initiated.
        • StorageClass — (String) The class of storage used to store the object. Possible values include:
          • "STANDARD"
          • "REDUCED_REDUNDANCY"
        • Owner — (map)
          • DisplayName — (String)
          • ID — (String)
        • Initiator — (map) Identifies who initiated the multipart upload.
      • CommonPrefixes — (Array<map>)
        • Prefix — (String)
      • EncodingType — (String) Encoding type used by Amazon S3 to encode object keys in the response. Possible values include:
        • "url"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listObjects(params = {}, callback) ⇒ AWS.Request

Returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket.

Examples:

Calling the listObjects operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Delimiter: 'STRING_VALUE',
  EncodingType: 'url',
  Marker: 'STRING_VALUE',
  MaxKeys: 0,
  Prefix: 'STRING_VALUE'
};
s3.listObjects(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Delimiter — (String) A delimiter is a character you use to group keys.
    • EncodingType — (String) Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. Possible values include:
      • "url"
    • Marker — (String) Specifies the key to start with when listing objects in a bucket.
    • MaxKeys — (Integer) Sets the maximum number of keys returned in the response. The response might contain fewer keys but will never contain more.
    • Prefix — (String) Limits the response to keys that begin with the specified prefix.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • IsTruncated — (Boolean) A flag that indicates whether or not Amazon S3 returned all of the results that satisfied the search criteria.
      • Marker — (String)
      • NextMarker — (String) When response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as marker in the subsequent request to get next set of objects. Amazon S3 lists objects in alphabetical order Note: This element is returned only if you have delimiter request parameter specified. If response does not include the NextMaker and it is truncated, you can use the value of the last Key in the response as the marker in the subsequent request to get the next set of object keys.
      • Contents — (Array<map>)
        • Key — (String)
        • LastModified — (Date)
        • ETag — (String)
        • Size — (Integer)
        • StorageClass — (String) The class of storage used to store the object. Possible values include:
          • "STANDARD"
          • "REDUCED_REDUNDANCY"
          • "GLACIER"
        • Owner — (map)
          • DisplayName — (String)
          • ID — (String)
      • Name — (String)
      • Prefix — (String)
      • Delimiter — (String)
      • MaxKeys — (Integer)
      • CommonPrefixes — (Array<map>)
        • Prefix — (String)
      • EncodingType — (String) Encoding type used by Amazon S3 to encode object keys in the response. Possible values include:
        • "url"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listObjectVersions(params = {}, callback) ⇒ AWS.Request

Returns metadata about all of the versions of objects in a bucket.

Examples:

Calling the listObjectVersions operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Delimiter: 'STRING_VALUE',
  EncodingType: 'url',
  KeyMarker: 'STRING_VALUE',
  MaxKeys: 0,
  Prefix: 'STRING_VALUE',
  VersionIdMarker: 'STRING_VALUE'
};
s3.listObjectVersions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Delimiter — (String) A delimiter is a character you use to group keys.
    • EncodingType — (String) Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. Possible values include:
      • "url"
    • KeyMarker — (String) Specifies the key to start with when listing objects in a bucket.
    • MaxKeys — (Integer) Sets the maximum number of keys returned in the response. The response might contain fewer keys but will never contain more.
    • Prefix — (String) Limits the response to keys that begin with the specified prefix.
    • VersionIdMarker — (String) Specifies the object version you want to start listing from.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • IsTruncated — (Boolean) A flag that indicates whether or not Amazon S3 returned all of the results that satisfied the search criteria. If your results were truncated, you can make a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker response parameters as a starting place in another request to return the rest of the results.
      • KeyMarker — (String) Marks the last Key returned in a truncated response.
      • VersionIdMarker — (String)
      • NextKeyMarker — (String) Use this value for the key marker request parameter in a subsequent request.
      • NextVersionIdMarker — (String) Use this value for the next version id marker parameter in a subsequent request.
      • Versions — (Array<map>)
        • ETag — (String)
        • Size — (Integer) Size in bytes of the object.
        • StorageClass — (String) The class of storage used to store the object. Possible values include:
          • "STANDARD"
        • Key — (String) The object key.
        • VersionId — (String) Version ID of an object.
        • IsLatest — (Boolean) Specifies whether the object is (true) or is not (false) the latest version of an object.
        • LastModified — (Date) Date and time the object was last modified.
        • Owner — (map)
          • DisplayName — (String)
          • ID — (String)
      • DeleteMarkers — (Array<map>)
        • Owner — (map)
          • DisplayName — (String)
          • ID — (String)
        • Key — (String) The object key.
        • VersionId — (String) Version ID of an object.
        • IsLatest — (Boolean) Specifies whether the object is (true) or is not (false) the latest version of an object.
        • LastModified — (Date) Date and time the object was last modified.
      • Name — (String)
      • Prefix — (String)
      • Delimiter — (String)
      • MaxKeys — (Integer)
      • CommonPrefixes — (Array<map>)
        • Prefix — (String)
      • EncodingType — (String) Encoding type used by Amazon S3 to encode object keys in the response. Possible values include:
        • "url"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listParts(params = {}, callback) ⇒ AWS.Request

Lists the parts that have been uploaded for a specific multipart upload.

Examples:

Calling the listParts operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  UploadId: 'STRING_VALUE', /* required */
  MaxParts: 0,
  PartNumberMarker: 0
};
s3.listParts(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)
    • MaxParts — (Integer) Sets the maximum number of parts to return.
    • PartNumberMarker — (Integer) Specifies the part after which listing should begin. Only parts with higher part numbers will be listed.
    • UploadId — (String) Upload ID identifying the multipart upload whose parts are being listed.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Bucket — (String) Name of the bucket to which the multipart upload was initiated.
      • Key — (String) Object key for which the multipart upload was initiated.
      • UploadId — (String) Upload ID identifying the multipart upload whose parts are being listed.
      • PartNumberMarker — (Integer) Part number after which listing begins.
      • NextPartNumberMarker — (Integer) When a list is truncated, this element specifies the last part in the list, as well as the value to use for the part-number-marker request parameter in a subsequent request.
      • MaxParts — (Integer) Maximum number of parts that were allowed in the response.
      • IsTruncated — (Boolean) Indicates whether the returned list of parts is truncated.
      • Parts — (Array<map>)
        • PartNumber — (Integer) Part number identifying the part.
        • LastModified — (Date) Date and time at which the part was uploaded.
        • ETag — (String) Entity tag returned when the part was uploaded.
        • Size — (Integer) Size of the uploaded part data.
      • Initiator — (map) Identifies who initiated the multipart upload.
        • ID — (String) If the principal is an AWS account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value.
        • DisplayName — (String) Name of the Principal.
      • Owner — (map)
        • DisplayName — (String)
        • ID — (String)
      • StorageClass — (String) The class of storage used to store the object. Possible values include:
        • "STANDARD"
        • "REDUCED_REDUNDANCY"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketAcl(params = {}, callback) ⇒ AWS.Request

Sets the permissions on a bucket using access control lists (ACL).

Examples:

Calling the putBucketAcl operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  ACL: 'private | public-read | public-read-write | authenticated-read',
  AccessControlPolicy: {
    Grants: [
      {
        Grantee: {
          Type: 'CanonicalUser | AmazonCustomerByEmail | Group', /* required */
          DisplayName: 'STRING_VALUE',
          EmailAddress: 'STRING_VALUE',
          ID: 'STRING_VALUE',
          URI: 'STRING_VALUE'
        },
        Permission: 'FULL_CONTROL | WRITE | WRITE_ACP | READ | READ_ACP'
      },
      /* more items */
    ],
    Owner: {
      DisplayName: 'STRING_VALUE',
      ID: 'STRING_VALUE'
    }
  },
  ContentMD5: 'STRING_VALUE',
  GrantFullControl: 'STRING_VALUE',
  GrantRead: 'STRING_VALUE',
  GrantReadACP: 'STRING_VALUE',
  GrantWrite: 'STRING_VALUE',
  GrantWriteACP: 'STRING_VALUE'
};
s3.putBucketAcl(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ACL — (String) The canned ACL to apply to the bucket. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
    • AccessControlPolicy — (map)
      • Grants — (Array<map>) A list of grants.
        • Grantee — (map)
          • DisplayName — (String) Screen name of the grantee.
          • EmailAddress — (String) Email address of the grantee.
          • ID — (String) The canonical user ID of the grantee.
          • Typerequired — (String) Type of grantee Possible values include:
            • "CanonicalUser"
            • "AmazonCustomerByEmail"
            • "Group"
          • URI — (String) URI of the grantee group.
        • Permission — (String) Specifies the permission given to the grantee. Possible values include:
          • "FULL_CONTROL"
          • "WRITE"
          • "WRITE_ACP"
          • "READ"
          • "READ_ACP"
      • Owner — (map)
    • Bucket — (String)
    • ContentMD5 — (String)
    • GrantFullControl — (String) Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
    • GrantRead — (String) Allows grantee to list the objects in the bucket.
    • GrantReadACP — (String) Allows grantee to read the bucket ACL.
    • GrantWrite — (String) Allows grantee to create, overwrite, and delete any object in the bucket.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable bucket.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketCors(params = {}, callback) ⇒ AWS.Request

Sets the cors configuration for a bucket.

Examples:

Calling the putBucketCors operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  CORSConfiguration: {
    CORSRules: [
      {
        AllowedHeaders: [
          'STRING_VALUE',
          /* more items */
        ],
        AllowedMethods: [
          'STRING_VALUE',
          /* more items */
        ],
        AllowedOrigins: [
          'STRING_VALUE',
          /* more items */
        ],
        ExposeHeaders: [
          'STRING_VALUE',
          /* more items */
        ],
        MaxAgeSeconds: 0
      },
      /* more items */
    ]
  },
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketCors(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • CORSConfiguration — (map)
      • CORSRules — (Array<map>)
        • AllowedHeaders — (Array<String>) Specifies which headers are allowed in a pre-flight OPTIONS request.
        • AllowedMethods — (Array<String>) Identifies HTTP methods that the domain/origin specified in the rule is allowed to execute.
        • AllowedOrigins — (Array<String>) One or more origins you want customers to be able to access the bucket from.
        • ExposeHeaders — (Array<String>) One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript XMLHttpRequest object).
        • MaxAgeSeconds — (Integer) The time in seconds that your browser is to cache the preflight response for the specified resource.
    • ContentMD5 — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketLifecycle(params = {}, callback) ⇒ AWS.Request

Sets lifecycle configuration for your bucket. If a lifecycle configuration exists, it replaces it.

Examples:

Calling the putBucketLifecycle operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  ContentMD5: 'STRING_VALUE',
  LifecycleConfiguration: {
    Rules: [ /* required */
      {
        Prefix: 'STRING_VALUE', /* required */
        Status: 'Enabled | Disabled', /* required */
        Expiration: {
          Date: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
          Days: 0
        },
        ID: 'STRING_VALUE',
        NoncurrentVersionExpiration: {
          NoncurrentDays: 0
        },
        NoncurrentVersionTransition: {
          NoncurrentDays: 0,
          StorageClass: 'GLACIER'
        },
        Transition: {
          Date: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
          Days: 0,
          StorageClass: 'GLACIER'
        }
      },
      /* more items */
    ]
  }
};
s3.putBucketLifecycle(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • LifecycleConfiguration — (map)
      • Rulesrequired — (Array<map>)
        • Expiration — (map)
          • Date — (Date) Indicates at what date the object is to be moved or deleted. Should be in GMT ISO 8601 Format.
          • Days — (Integer) Indicates the lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
        • ID — (String) Unique identifier for the rule. The value cannot be longer than 255 characters.
        • Prefixrequired — (String) Prefix identifying one or more objects to which the rule applies.
        • Statusrequired — (String) If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. Possible values include:
          • "Enabled"
          • "Disabled"
        • Transition — (map)
          • StorageClass — (String) The class of storage used to store the object. Possible values include:
            • "GLACIER"
        • NoncurrentVersionTransition — (map) Container for the transition rule that describes when noncurrent objects transition to the GLACIER storage class. If your bucket is versioning-enabled (or versioning is suspended), you can set this action to request that Amazon S3 transition noncurrent object versions to the GLACIER storage class at a specific period in the object's lifetime.
        • NoncurrentVersionExpiration — (map) Specifies when noncurrent object versions expire. Upon expiration, Amazon S3 permanently deletes the noncurrent object versions. You set this lifecycle configuration action on a bucket that has versioning enabled (or suspended) to request that Amazon S3 delete noncurrent object versions at a specific period in the object's lifetime.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketLogging(params = {}, callback) ⇒ AWS.Request

Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters. To set the logging status of a bucket, you must be the bucket owner.

Examples:

Calling the putBucketLogging operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  BucketLoggingStatus: { /* required */
    LoggingEnabled: {
      TargetBucket: 'STRING_VALUE',
      TargetGrants: [
        {
          Grantee: {
            Type: 'CanonicalUser | AmazonCustomerByEmail | Group', /* required */
            DisplayName: 'STRING_VALUE',
            EmailAddress: 'STRING_VALUE',
            ID: 'STRING_VALUE',
            URI: 'STRING_VALUE'
          },
          Permission: 'FULL_CONTROL | READ | WRITE'
        },
        /* more items */
      ],
      TargetPrefix: 'STRING_VALUE'
    }
  },
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketLogging(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • BucketLoggingStatus — (map)
      • LoggingEnabled — (map)
        • TargetBucket — (String) Specifies the bucket where you want Amazon S3 to store server access logs. You can have your logs delivered to any bucket that you own, including the same bucket that is being logged. You can also configure multiple buckets to deliver their logs to the same target bucket. In this case you should choose a different TargetPrefix for each source bucket so that the delivered log files can be distinguished by key.
        • TargetGrants — (Array<map>)
          • Grantee — (map)
            • DisplayName — (String) Screen name of the grantee.
            • EmailAddress — (String) Email address of the grantee.
            • ID — (String) The canonical user ID of the grantee.
            • Typerequired — (String) Type of grantee Possible values include:
              • "CanonicalUser"
              • "AmazonCustomerByEmail"
              • "Group"
            • URI — (String) URI of the grantee group.
          • Permission — (String) Logging permissions assigned to the Grantee for the bucket. Possible values include:
            • "FULL_CONTROL"
            • "READ"
            • "WRITE"
        • TargetPrefix — (String) This element lets you specify a prefix for the keys that the log files will be stored under.
    • ContentMD5 — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketNotification(params = {}, callback) ⇒ AWS.Request

Enables notifications of specified events for a bucket.

Examples:

Calling the putBucketNotification operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  NotificationConfiguration: { /* required */
    CloudFunctionConfiguration: {
      CloudFunction: 'STRING_VALUE',
      Event: 's3:ReducedRedundancyLostObject | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload',
      Events: [
        's3:ReducedRedundancyLostObject | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload',
        /* more items */
      ],
      Id: 'STRING_VALUE',
      InvocationRole: 'STRING_VALUE'
    },
    QueueConfiguration: {
      Event: 's3:ReducedRedundancyLostObject | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload',
      Events: [
        's3:ReducedRedundancyLostObject | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload',
        /* more items */
      ],
      Id: 'STRING_VALUE',
      Queue: 'STRING_VALUE'
    },
    TopicConfiguration: {
      Event: 's3:ReducedRedundancyLostObject | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload',
      Events: [
        's3:ReducedRedundancyLostObject | s3:ObjectCreated:Put | s3:ObjectCreated:Post | s3:ObjectCreated:Copy | s3:ObjectCreated:CompleteMultipartUpload',
        /* more items */
      ],
      Id: 'STRING_VALUE',
      Topic: 'STRING_VALUE'
    }
  },
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketNotification(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • NotificationConfiguration — (map)
      • TopicConfiguration — (map)
        • Id — (String)
        • Events — (Array<String>)
        • Topic — (String) Amazon SNS topic to which Amazon S3 will publish a message to report the specified events for the bucket.
      • QueueConfiguration — (map)
        • Queue — (String)
      • CloudFunctionConfiguration — (map)
        • CloudFunction — (String)
        • InvocationRole — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketPolicy(params = {}, callback) ⇒ AWS.Request

Replaces a policy on a bucket. If the bucket already has a policy, the one in this request completely replaces it.

Examples:

Calling the putBucketPolicy operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Policy: 'STRING_VALUE', /* required */
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketPolicy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • Policy — (String) The bucket policy as a JSON document.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketRequestPayment(params = {}, callback) ⇒ AWS.Request

Sets the request payment configuration for a bucket. By default, the bucket owner pays for downloads from the bucket. This configuration parameter enables the bucket owner (only) to specify that the person requesting the download will be charged for the download.

Examples:

Calling the putBucketRequestPayment operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  RequestPaymentConfiguration: { /* required */
    Payer: 'Requester | BucketOwner' /* required */
  },
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketRequestPayment(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • RequestPaymentConfiguration — (map)
      • Payerrequired — (String) Specifies who pays for the download and request fees. Possible values include:
        • "Requester"
        • "BucketOwner"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketTagging(params = {}, callback) ⇒ AWS.Request

Sets the tags for a bucket.

Examples:

Calling the putBucketTagging operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Tagging: { /* required */
    TagSet: [ /* required */
      {
        Key: 'STRING_VALUE', /* required */
        Value: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketTagging(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • Tagging — (map)
      • TagSetrequired — (Array<map>)
        • Keyrequired — (String) Name of the tag.
        • Valuerequired — (String) Value of the tag.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketVersioning(params = {}, callback) ⇒ AWS.Request

Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.

Examples:

Calling the putBucketVersioning operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  VersioningConfiguration: { /* required */
    MFADelete: 'Enabled | Disabled',
    Status: 'Enabled | Suspended'
  },
  ContentMD5: 'STRING_VALUE',
  MFA: 'STRING_VALUE'
};
s3.putBucketVersioning(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • MFA — (String) The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
    • VersioningConfiguration — (map)
      • MFADelete — (String) Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is only returned if the bucket has been configured with MFA delete. If the bucket has never been so configured, this element is not returned. Possible values include:
        • "Enabled"
        • "Disabled"
      • Status — (String) The versioning state of the bucket. Possible values include:
        • "Enabled"
        • "Suspended"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putBucketWebsite(params = {}, callback) ⇒ AWS.Request

Set the website configuration for a bucket.

Examples:

Calling the putBucketWebsite operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  WebsiteConfiguration: { /* required */
    ErrorDocument: {
      Key: 'STRING_VALUE' /* required */
    },
    IndexDocument: {
      Suffix: 'STRING_VALUE' /* required */
    },
    RedirectAllRequestsTo: {
      HostName: 'STRING_VALUE', /* required */
      Protocol: 'http | https'
    },
    RoutingRules: [
      {
        Redirect: { /* required */
          HostName: 'STRING_VALUE',
          HttpRedirectCode: 'STRING_VALUE',
          Protocol: 'http | https',
          ReplaceKeyPrefixWith: 'STRING_VALUE',
          ReplaceKeyWith: 'STRING_VALUE'
        },
        Condition: {
          HttpErrorCodeReturnedEquals: 'STRING_VALUE',
          KeyPrefixEquals: 'STRING_VALUE'
        }
      },
      /* more items */
    ]
  },
  ContentMD5: 'STRING_VALUE'
};
s3.putBucketWebsite(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • ContentMD5 — (String)
    • WebsiteConfiguration — (map)
      • ErrorDocument — (map)
        • Keyrequired — (String) The object key name to use when a 4XX class error occurs.
      • IndexDocument — (map)
        • Suffixrequired — (String) A suffix that is appended to a request that is for a directory on the website endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ the data that is returned will be for the object with the key name images/index.html) The suffix must not be empty and must not include a slash character.
      • RedirectAllRequestsTo — (map)
        • HostNamerequired — (String) Name of the host where requests will be redirected.
        • Protocol — (String) Protocol to use (http, https) when redirecting requests. The default is the protocol that is used in the original request. Possible values include:
          • "http"
          • "https"
      • RoutingRules — (Array<map>)
        • Condition — (map) A container for describing a condition that must be met for the specified redirect to apply. For example, 1. If request is for pages in the /docs folder, redirect to the /documents folder. 2. If request results in HTTP error 4xx, redirect request to another host where you might process the error.
          • HttpErrorCodeReturnedEquals — (String) The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied.
          • KeyPrefixEquals — (String) The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be /docs, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied.
        • Redirectrequired — (map) Container for redirect information. You can redirect requests to another host, to another page, or with another protocol. In the event of an error, you can can specify a different error code to return.
          • HttpRedirectCode — (String) The HTTP redirect code to use on the response. Not required if one of the siblings is present.
          • ReplaceKeyPrefixWith — (String) The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.
          • ReplaceKeyWith — (String) The specific object key to use in the redirect request. For example, redirect request to error.html. Not required if one of the sibling is present. Can be present only if ReplaceKeyPrefixWith is not provided.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putObject(params = {}, callback) ⇒ AWS.Request

Adds an object to a bucket.

Examples:

Calling the putObject operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  ACL: 'private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control',
  Body: new Buffer('...') || 'STRING_VALUE' || streamObject,
  CacheControl: 'STRING_VALUE',
  ContentDisposition: 'STRING_VALUE',
  ContentEncoding: 'STRING_VALUE',
  ContentLanguage: 'STRING_VALUE',
  ContentLength: 0,
  ContentMD5: 'STRING_VALUE',
  ContentType: 'STRING_VALUE',
  Expires: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  GrantFullControl: 'STRING_VALUE',
  GrantRead: 'STRING_VALUE',
  GrantReadACP: 'STRING_VALUE',
  GrantWriteACP: 'STRING_VALUE',
  Metadata: {
    someKey: 'STRING_VALUE',
    /* anotherKey: ... */
  },
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE',
  SSEKMSKeyId: 'STRING_VALUE',
  ServerSideEncryption: 'AES256',
  StorageClass: 'STANDARD | REDUCED_REDUNDANCY',
  WebsiteRedirectLocation: 'STRING_VALUE'
};
s3.putObject(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ACL — (String) The canned ACL to apply to the object. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
      • "bucket-owner-read"
      • "bucket-owner-full-control"
    • Body — (Buffer, Typed Array, Blob, String, ReadableStream) Object data.
    • Bucket — (String)
    • CacheControl — (String) Specifies caching behavior along the request/reply chain.
    • ContentDisposition — (String) Specifies presentational information for the object.
    • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    • ContentLanguage — (String) The language the content is in.
    • ContentLength — (Integer) Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.
    • ContentMD5 — (String)
    • ContentType — (String) A standard MIME type describing the format of the object data.
    • Expires — (Date) The date and time at which the object is no longer cacheable.
    • GrantFullControl — (String) Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
    • GrantRead — (String) Allows grantee to read the object data and its metadata.
    • GrantReadACP — (String) Allows grantee to read the object ACL.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable object.
    • Key — (String)
    • Metadata — (map<String>) A map of metadata to store with the object in S3.
    • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
      • "AES256"
    • StorageClass — (String) The type of storage to use for the object. Defaults to 'STANDARD'. Possible values include:
      • "STANDARD"
      • "REDUCED_REDUNDANCY"
    • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.
    • SSEKMSKeyId — (String) Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • Expiration — (Date) If the object expiration is configured, this will contain the expiration date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded.
      • ETag — (String) Entity tag for the uploaded object.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • VersionId — (String) Version of the object.
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putObjectAcl(params = {}, callback) ⇒ AWS.Request

uses the acl subresource to set the access control list (ACL) permissions for an object that already exists in a bucket

Examples:

Calling the putObjectAcl operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  ACL: 'private | public-read | public-read-write | authenticated-read | bucket-owner-read | bucket-owner-full-control',
  AccessControlPolicy: {
    Grants: [
      {
        Grantee: {
          Type: 'CanonicalUser | AmazonCustomerByEmail | Group', /* required */
          DisplayName: 'STRING_VALUE',
          EmailAddress: 'STRING_VALUE',
          ID: 'STRING_VALUE',
          URI: 'STRING_VALUE'
        },
        Permission: 'FULL_CONTROL | WRITE | WRITE_ACP | READ | READ_ACP'
      },
      /* more items */
    ],
    Owner: {
      DisplayName: 'STRING_VALUE',
      ID: 'STRING_VALUE'
    }
  },
  ContentMD5: 'STRING_VALUE',
  GrantFullControl: 'STRING_VALUE',
  GrantRead: 'STRING_VALUE',
  GrantReadACP: 'STRING_VALUE',
  GrantWrite: 'STRING_VALUE',
  GrantWriteACP: 'STRING_VALUE'
};
s3.putObjectAcl(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • ACL — (String) The canned ACL to apply to the object. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
      • "bucket-owner-read"
      • "bucket-owner-full-control"
    • AccessControlPolicy — (map)
      • Grants — (Array<map>) A list of grants.
        • Grantee — (map)
          • DisplayName — (String) Screen name of the grantee.
          • EmailAddress — (String) Email address of the grantee.
          • ID — (String) The canonical user ID of the grantee.
          • Typerequired — (String) Type of grantee Possible values include:
            • "CanonicalUser"
            • "AmazonCustomerByEmail"
            • "Group"
          • URI — (String) URI of the grantee group.
        • Permission — (String) Specifies the permission given to the grantee. Possible values include:
          • "FULL_CONTROL"
          • "WRITE"
          • "WRITE_ACP"
          • "READ"
          • "READ_ACP"
      • Owner — (map)
    • Bucket — (String)
    • ContentMD5 — (String)
    • GrantFullControl — (String) Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
    • GrantRead — (String) Allows grantee to list the objects in the bucket.
    • GrantReadACP — (String) Allows grantee to read the bucket ACL.
    • GrantWrite — (String) Allows grantee to create, overwrite, and delete any object in the bucket.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable bucket.
    • Key — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

restoreObject(params = {}, callback) ⇒ AWS.Request

Restores an archived copy of an object back into Amazon S3

Examples:

Calling the restoreObject operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  RestoreRequest: {
    Days: 0 /* required */
  },
  VersionId: 'STRING_VALUE'
};
s3.restoreObject(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • Key — (String)
    • VersionId — (String)
    • RestoreRequest — (map)
      • Daysrequired — (Integer) Lifetime of the active copy in days

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

upload(params = {}, [options], [callback]) ⇒ AWS.S3.ManagedUpload

Uploads an arbitrarily sized buffer, blob, or stream, using intelligent concurrent handling of parts if the payload is large enough. You can configure the concurrent queue size by setting options.

Examples:

Uploading a stream object

var params = {Bucket: 'bucket', Key: 'key', Body: stream};
s3.upload(params, function(err, data) {
  console.log(err, data);
});

Uploading a stream with concurrency of 1 and partSize of 10mb

var params = {Bucket: 'bucket', Key: 'key', Body: stream};
var options = {partSize: 10 * 1024 * 1024, queueSize: 1};
s3.upload(params, options, function(err, data) {
  console.log(err, data);
});

Parameters:

  • params (Object) (defaults to: {})
    • ACL — (String) The canned ACL to apply to the object. Possible values include:
      • "private"
      • "public-read"
      • "public-read-write"
      • "authenticated-read"
      • "bucket-owner-read"
      • "bucket-owner-full-control"
    • Body — (Buffer, Typed Array, Blob, String, ReadableStream) Object data.
    • Bucket — (String)
    • CacheControl — (String) Specifies caching behavior along the request/reply chain.
    • ContentDisposition — (String) Specifies presentational information for the object.
    • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
    • ContentLanguage — (String) The language the content is in.
    • ContentLength — (Integer) Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.
    • ContentMD5 — (String)
    • ContentType — (String) A standard MIME type describing the format of the object data.
    • Expires — (Date) The date and time at which the object is no longer cacheable.
    • GrantFullControl — (String) Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.
    • GrantRead — (String) Allows grantee to read the object data and its metadata.
    • GrantReadACP — (String) Allows grantee to read the object ACL.
    • GrantWriteACP — (String) Allows grantee to write the ACL for the applicable object.
    • Key — (String)
    • Metadata — (map<String>) A map of metadata to store with the object in S3.
    • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
      • "AES256"
    • StorageClass — (String) The type of storage to use for the object. Defaults to 'STANDARD'. Possible values include:
      • "STANDARD"
      • "REDUCED_REDUNDANCY"
    • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.
    • SSEKMSKeyId — (String) Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version

Returns:

  • (AWS.S3.ManagedUpload)

    the managed upload object that can call send() or track progress.

See Also:

uploadPart(params = {}, callback) ⇒ AWS.Request

Uploads a part in a multipart upload.

Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.

Examples:

Calling the uploadPart operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  PartNumber: 0, /* required */
  UploadId: 'STRING_VALUE', /* required */
  Body: new Buffer('...') || 'STRING_VALUE' || streamObject,
  ContentLength: 0,
  ContentMD5: 'STRING_VALUE',
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE'
};
s3.uploadPart(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Body — (Buffer, Typed Array, Blob, String, ReadableStream)
    • Bucket — (String)
    • ContentLength — (Integer) Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.
    • ContentMD5 — (String)
    • Key — (String)
    • PartNumber — (Integer) Part number of part being uploaded.
    • UploadId — (String) Upload ID identifying the multipart upload whose part is being uploaded.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header. This must be the same encryption key specified in the initiate multipart upload request.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • ETag — (String) Entity tag for the uploaded object.
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

uploadPartCopy(params = {}, callback) ⇒ AWS.Request

Uploads a part by copying data from an existing object as data source.

Examples:

Calling the uploadPartCopy operation

var params = {
  Bucket: 'STRING_VALUE', /* required */
  CopySource: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
  PartNumber: 0, /* required */
  UploadId: 'STRING_VALUE', /* required */
  CopySourceIfMatch: 'STRING_VALUE',
  CopySourceIfModifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  CopySourceIfNoneMatch: 'STRING_VALUE',
  CopySourceIfUnmodifiedSince: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789,
  CopySourceRange: 'STRING_VALUE',
  CopySourceSSECustomerAlgorithm: 'STRING_VALUE',
  CopySourceSSECustomerKey: 'STRING_VALUE',
  CopySourceSSECustomerKeyMD5: 'STRING_VALUE',
  SSECustomerAlgorithm: 'STRING_VALUE',
  SSECustomerKey: 'STRING_VALUE',
  SSECustomerKeyMD5: 'STRING_VALUE'
};
s3.uploadPartCopy(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • Bucket — (String)
    • CopySource — (String) The name of the source bucket and key name of the source object, separated by a slash (/). Must be URL-encoded.
    • CopySourceIfMatch — (String) Copies the object if its entity tag (ETag) matches the specified tag.
    • CopySourceIfModifiedSince — (Date) Copies the object if it has been modified since the specified time.
    • CopySourceIfNoneMatch — (String) Copies the object if its entity tag (ETag) is different than the specified ETag.
    • CopySourceIfUnmodifiedSince — (Date) Copies the object if it hasn't been modified since the specified time.
    • CopySourceRange — (String) The range of bytes to copy from the source object. The range value must use the form bytes=first-last, where the first and last are the zero-based byte offsets to copy. For example, bytes=0-9 indicates that you want to copy the first ten bytes of the source. You can copy a range only if the source object is greater than 5 GB.
    • Key — (String)
    • PartNumber — (Integer) Part number of part being copied.
    • UploadId — (String) Upload ID identifying the multipart upload whose part is being copied.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header. This must be the same encryption key specified in the initiate multipart upload request.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.
    • CopySourceSSECustomerAlgorithm — (String) Specifies the algorithm to use when decrypting the source object (e.g., AES256).
    • CopySourceSSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.
    • CopySourceSSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • CopySourceVersionId — (String) The version of the source object that was copied, if you have enabled versioning on the source bucket.
      • CopyPartResult — (map)
        • ETag — (String) Entity tag of the object.
        • LastModified — (Date) Date and time at which the object was uploaded.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

waitFor(state, params = {}, callback) ⇒ AWS.Request

Waits for a given S3 resource. The final callback or 'complete' event will be fired only when the resource is either in its final state or the waiter has timed out and stopped polling for the final state.

Examples:

Waiting for the bucketExists state

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.waitFor('bucketExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • state (String)

    the resource state to wait for. Available states for this service are listed in "Waiter Resource States" below.

  • params (map) (defaults to: {})

    a list of parameters for the given state. See each waiter resource state for required parameters.

Callback (callback):

  • function(err, data) { ... }

    Callback containing error and data information. See the respective resource state for the expected error or data information.

    If the waiter times out its requests, it will return a ResourceNotReady error.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

Waiter Resource States:

Waiter Resource Details

s3.waitFor('bucketExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the bucketExists state by periodically calling the underlying S3.headBucket() operation every 5 seconds (at most 20 times).

Examples:

Waiting for the bucketExists state

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.waitFor('bucketExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also:

s3.waitFor('bucketNotExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the bucketNotExists state by periodically calling the underlying S3.headBucket() operation every 5 seconds (at most 20 times).

Examples:

Waiting for the bucketNotExists state

var params = {
  Bucket: 'STRING_VALUE' /* required */
};
s3.waitFor('bucketNotExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • Bucket — (String)

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also:

s3.waitFor('objectExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the objectExists state by periodically calling the underlying S3.headObject() operation every 5 seconds (at most 20 times).

Examples:

Waiting for the objectExists state

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
};
s3.waitFor('objectExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • Bucket — (String)
    • IfMatch — (String) Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).
    • IfModifiedSince — (Date) Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).
    • IfNoneMatch — (String) Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).
    • IfUnmodifiedSince — (Date) Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).
    • Key — (String)
    • Range — (String) Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
    • VersionId — (String) VersionId used to reference a specific version of the object.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DeleteMarker — (Boolean) Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.
      • AcceptRanges — (String)
      • Expiration — (Date) If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
      • Restore — (String) Provides information about object restoration operation and expiration time of the restored object copy.
      • LastModified — (Date) Last modified date of the object
      • ContentLength — (Integer) Size of the body in bytes.
      • ETag — (String) An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL
      • MissingMeta — (Integer) This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
      • VersionId — (String) Version of the object.
      • CacheControl — (String) Specifies caching behavior along the request/reply chain.
      • ContentDisposition — (String) Specifies presentational information for the object.
      • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
      • ContentLanguage — (String) The language the content is in.
      • ContentType — (String) A standard MIME type describing the format of the object data.
      • Expires — (Date) The date and time at which the object is no longer cacheable.
      • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • Metadata — (map<String>) A map of metadata to store with the object in S3.
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also:

s3.waitFor('objectNotExists', params = {}, [callback]) ⇒ AWS.Request

Waits for the objectNotExists state by periodically calling the underlying S3.headObject() operation every 5 seconds (at most 20 times).

Examples:

Waiting for the objectNotExists state

var params = {
  Bucket: 'STRING_VALUE', /* required */
  Key: 'STRING_VALUE', /* required */
};
s3.waitFor('objectNotExists', params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object)
    • Bucket — (String)
    • IfMatch — (String) Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).
    • IfModifiedSince — (Date) Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).
    • IfNoneMatch — (String) Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).
    • IfUnmodifiedSince — (Date) Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).
    • Key — (String)
    • Range — (String) Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
    • VersionId — (String) VersionId used to reference a specific version of the object.
    • SSECustomerAlgorithm — (String) Specifies the algorithm to use to when encrypting the object (e.g., AES256, aws:kms).
    • SSECustomerKey — (String) Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.
    • SSECustomerKeyMD5 — (String) Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • DeleteMarker — (Boolean) Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.
      • AcceptRanges — (String)
      • Expiration — (Date) If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.
      • Restore — (String) Provides information about object restoration operation and expiration time of the restored object copy.
      • LastModified — (Date) Last modified date of the object
      • ContentLength — (Integer) Size of the body in bytes.
      • ETag — (String) An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL
      • MissingMeta — (Integer) This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.
      • VersionId — (String) Version of the object.
      • CacheControl — (String) Specifies caching behavior along the request/reply chain.
      • ContentDisposition — (String) Specifies presentational information for the object.
      • ContentEncoding — (String) Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.
      • ContentLanguage — (String) The language the content is in.
      • ContentType — (String) A standard MIME type describing the format of the object data.
      • Expires — (Date) The date and time at which the object is no longer cacheable.
      • WebsiteRedirectLocation — (String) If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.
      • ServerSideEncryption — (String) The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms). Possible values include:
        • "AES256"
      • Metadata — (map<String>) A map of metadata to store with the object in S3.
      • SSECustomerAlgorithm — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.
      • SSECustomerKeyMD5 — (String) If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.
      • SSEKMSKeyId — (String) If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

See Also: