UNPKG

@aws-sdk/client-s3

Version:

AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native

652 lines 384 kB
import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; import { AbortMultipartUploadCommandInput, AbortMultipartUploadCommandOutput } from "./commands/AbortMultipartUploadCommand"; import { CompleteMultipartUploadCommandInput, CompleteMultipartUploadCommandOutput } from "./commands/CompleteMultipartUploadCommand"; import { CopyObjectCommandInput, CopyObjectCommandOutput } from "./commands/CopyObjectCommand"; import { CreateBucketCommandInput, CreateBucketCommandOutput } from "./commands/CreateBucketCommand"; import { CreateMultipartUploadCommandInput, CreateMultipartUploadCommandOutput } from "./commands/CreateMultipartUploadCommand"; import { DeleteBucketAnalyticsConfigurationCommandInput, DeleteBucketAnalyticsConfigurationCommandOutput } from "./commands/DeleteBucketAnalyticsConfigurationCommand"; import { DeleteBucketCommandInput, DeleteBucketCommandOutput } from "./commands/DeleteBucketCommand"; import { DeleteBucketCorsCommandInput, DeleteBucketCorsCommandOutput } from "./commands/DeleteBucketCorsCommand"; import { DeleteBucketEncryptionCommandInput, DeleteBucketEncryptionCommandOutput } from "./commands/DeleteBucketEncryptionCommand"; import { DeleteBucketIntelligentTieringConfigurationCommandInput, DeleteBucketIntelligentTieringConfigurationCommandOutput } from "./commands/DeleteBucketIntelligentTieringConfigurationCommand"; import { DeleteBucketInventoryConfigurationCommandInput, DeleteBucketInventoryConfigurationCommandOutput } from "./commands/DeleteBucketInventoryConfigurationCommand"; import { DeleteBucketLifecycleCommandInput, DeleteBucketLifecycleCommandOutput } from "./commands/DeleteBucketLifecycleCommand"; import { DeleteBucketMetricsConfigurationCommandInput, DeleteBucketMetricsConfigurationCommandOutput } from "./commands/DeleteBucketMetricsConfigurationCommand"; import { DeleteBucketOwnershipControlsCommandInput, DeleteBucketOwnershipControlsCommandOutput } from "./commands/DeleteBucketOwnershipControlsCommand"; import { DeleteBucketPolicyCommandInput, DeleteBucketPolicyCommandOutput } from "./commands/DeleteBucketPolicyCommand"; import { DeleteBucketReplicationCommandInput, DeleteBucketReplicationCommandOutput } from "./commands/DeleteBucketReplicationCommand"; import { DeleteBucketTaggingCommandInput, DeleteBucketTaggingCommandOutput } from "./commands/DeleteBucketTaggingCommand"; import { DeleteBucketWebsiteCommandInput, DeleteBucketWebsiteCommandOutput } from "./commands/DeleteBucketWebsiteCommand"; import { DeleteObjectCommandInput, DeleteObjectCommandOutput } from "./commands/DeleteObjectCommand"; import { DeleteObjectsCommandInput, DeleteObjectsCommandOutput } from "./commands/DeleteObjectsCommand"; import { DeleteObjectTaggingCommandInput, DeleteObjectTaggingCommandOutput } from "./commands/DeleteObjectTaggingCommand"; import { DeletePublicAccessBlockCommandInput, DeletePublicAccessBlockCommandOutput } from "./commands/DeletePublicAccessBlockCommand"; import { GetBucketAccelerateConfigurationCommandInput, GetBucketAccelerateConfigurationCommandOutput } from "./commands/GetBucketAccelerateConfigurationCommand"; import { GetBucketAclCommandInput, GetBucketAclCommandOutput } from "./commands/GetBucketAclCommand"; import { GetBucketAnalyticsConfigurationCommandInput, GetBucketAnalyticsConfigurationCommandOutput } from "./commands/GetBucketAnalyticsConfigurationCommand"; import { GetBucketCorsCommandInput, GetBucketCorsCommandOutput } from "./commands/GetBucketCorsCommand"; import { GetBucketEncryptionCommandInput, GetBucketEncryptionCommandOutput } from "./commands/GetBucketEncryptionCommand"; import { GetBucketIntelligentTieringConfigurationCommandInput, GetBucketIntelligentTieringConfigurationCommandOutput } from "./commands/GetBucketIntelligentTieringConfigurationCommand"; import { GetBucketInventoryConfigurationCommandInput, GetBucketInventoryConfigurationCommandOutput } from "./commands/GetBucketInventoryConfigurationCommand"; import { GetBucketLifecycleConfigurationCommandInput, GetBucketLifecycleConfigurationCommandOutput } from "./commands/GetBucketLifecycleConfigurationCommand"; import { GetBucketLocationCommandInput, GetBucketLocationCommandOutput } from "./commands/GetBucketLocationCommand"; import { GetBucketLoggingCommandInput, GetBucketLoggingCommandOutput } from "./commands/GetBucketLoggingCommand"; import { GetBucketMetricsConfigurationCommandInput, GetBucketMetricsConfigurationCommandOutput } from "./commands/GetBucketMetricsConfigurationCommand"; import { GetBucketNotificationConfigurationCommandInput, GetBucketNotificationConfigurationCommandOutput } from "./commands/GetBucketNotificationConfigurationCommand"; import { GetBucketOwnershipControlsCommandInput, GetBucketOwnershipControlsCommandOutput } from "./commands/GetBucketOwnershipControlsCommand"; import { GetBucketPolicyCommandInput, GetBucketPolicyCommandOutput } from "./commands/GetBucketPolicyCommand"; import { GetBucketPolicyStatusCommandInput, GetBucketPolicyStatusCommandOutput } from "./commands/GetBucketPolicyStatusCommand"; import { GetBucketReplicationCommandInput, GetBucketReplicationCommandOutput } from "./commands/GetBucketReplicationCommand"; import { GetBucketRequestPaymentCommandInput, GetBucketRequestPaymentCommandOutput } from "./commands/GetBucketRequestPaymentCommand"; import { GetBucketTaggingCommandInput, GetBucketTaggingCommandOutput } from "./commands/GetBucketTaggingCommand"; import { GetBucketVersioningCommandInput, GetBucketVersioningCommandOutput } from "./commands/GetBucketVersioningCommand"; import { GetBucketWebsiteCommandInput, GetBucketWebsiteCommandOutput } from "./commands/GetBucketWebsiteCommand"; import { GetObjectAclCommandInput, GetObjectAclCommandOutput } from "./commands/GetObjectAclCommand"; import { GetObjectAttributesCommandInput, GetObjectAttributesCommandOutput } from "./commands/GetObjectAttributesCommand"; import { GetObjectCommandInput, GetObjectCommandOutput } from "./commands/GetObjectCommand"; import { GetObjectLegalHoldCommandInput, GetObjectLegalHoldCommandOutput } from "./commands/GetObjectLegalHoldCommand"; import { GetObjectLockConfigurationCommandInput, GetObjectLockConfigurationCommandOutput } from "./commands/GetObjectLockConfigurationCommand"; import { GetObjectRetentionCommandInput, GetObjectRetentionCommandOutput } from "./commands/GetObjectRetentionCommand"; import { GetObjectTaggingCommandInput, GetObjectTaggingCommandOutput } from "./commands/GetObjectTaggingCommand"; import { GetObjectTorrentCommandInput, GetObjectTorrentCommandOutput } from "./commands/GetObjectTorrentCommand"; import { GetPublicAccessBlockCommandInput, GetPublicAccessBlockCommandOutput } from "./commands/GetPublicAccessBlockCommand"; import { HeadBucketCommandInput, HeadBucketCommandOutput } from "./commands/HeadBucketCommand"; import { HeadObjectCommandInput, HeadObjectCommandOutput } from "./commands/HeadObjectCommand"; import { ListBucketAnalyticsConfigurationsCommandInput, ListBucketAnalyticsConfigurationsCommandOutput } from "./commands/ListBucketAnalyticsConfigurationsCommand"; import { ListBucketIntelligentTieringConfigurationsCommandInput, ListBucketIntelligentTieringConfigurationsCommandOutput } from "./commands/ListBucketIntelligentTieringConfigurationsCommand"; import { ListBucketInventoryConfigurationsCommandInput, ListBucketInventoryConfigurationsCommandOutput } from "./commands/ListBucketInventoryConfigurationsCommand"; import { ListBucketMetricsConfigurationsCommandInput, ListBucketMetricsConfigurationsCommandOutput } from "./commands/ListBucketMetricsConfigurationsCommand"; import { ListBucketsCommandInput, ListBucketsCommandOutput } from "./commands/ListBucketsCommand"; import { ListMultipartUploadsCommandInput, ListMultipartUploadsCommandOutput } from "./commands/ListMultipartUploadsCommand"; import { ListObjectsCommandInput, ListObjectsCommandOutput } from "./commands/ListObjectsCommand"; import { ListObjectsV2CommandInput, ListObjectsV2CommandOutput } from "./commands/ListObjectsV2Command"; import { ListObjectVersionsCommandInput, ListObjectVersionsCommandOutput } from "./commands/ListObjectVersionsCommand"; import { ListPartsCommandInput, ListPartsCommandOutput } from "./commands/ListPartsCommand"; import { PutBucketAccelerateConfigurationCommandInput, PutBucketAccelerateConfigurationCommandOutput } from "./commands/PutBucketAccelerateConfigurationCommand"; import { PutBucketAclCommandInput, PutBucketAclCommandOutput } from "./commands/PutBucketAclCommand"; import { PutBucketAnalyticsConfigurationCommandInput, PutBucketAnalyticsConfigurationCommandOutput } from "./commands/PutBucketAnalyticsConfigurationCommand"; import { PutBucketCorsCommandInput, PutBucketCorsCommandOutput } from "./commands/PutBucketCorsCommand"; import { PutBucketEncryptionCommandInput, PutBucketEncryptionCommandOutput } from "./commands/PutBucketEncryptionCommand"; import { PutBucketIntelligentTieringConfigurationCommandInput, PutBucketIntelligentTieringConfigurationCommandOutput } from "./commands/PutBucketIntelligentTieringConfigurationCommand"; import { PutBucketInventoryConfigurationCommandInput, PutBucketInventoryConfigurationCommandOutput } from "./commands/PutBucketInventoryConfigurationCommand"; import { PutBucketLifecycleConfigurationCommandInput, PutBucketLifecycleConfigurationCommandOutput } from "./commands/PutBucketLifecycleConfigurationCommand"; import { PutBucketLoggingCommandInput, PutBucketLoggingCommandOutput } from "./commands/PutBucketLoggingCommand"; import { PutBucketMetricsConfigurationCommandInput, PutBucketMetricsConfigurationCommandOutput } from "./commands/PutBucketMetricsConfigurationCommand"; import { PutBucketNotificationConfigurationCommandInput, PutBucketNotificationConfigurationCommandOutput } from "./commands/PutBucketNotificationConfigurationCommand"; import { PutBucketOwnershipControlsCommandInput, PutBucketOwnershipControlsCommandOutput } from "./commands/PutBucketOwnershipControlsCommand"; import { PutBucketPolicyCommandInput, PutBucketPolicyCommandOutput } from "./commands/PutBucketPolicyCommand"; import { PutBucketReplicationCommandInput, PutBucketReplicationCommandOutput } from "./commands/PutBucketReplicationCommand"; import { PutBucketRequestPaymentCommandInput, PutBucketRequestPaymentCommandOutput } from "./commands/PutBucketRequestPaymentCommand"; import { PutBucketTaggingCommandInput, PutBucketTaggingCommandOutput } from "./commands/PutBucketTaggingCommand"; import { PutBucketVersioningCommandInput, PutBucketVersioningCommandOutput } from "./commands/PutBucketVersioningCommand"; import { PutBucketWebsiteCommandInput, PutBucketWebsiteCommandOutput } from "./commands/PutBucketWebsiteCommand"; import { PutObjectAclCommandInput, PutObjectAclCommandOutput } from "./commands/PutObjectAclCommand"; import { PutObjectCommandInput, PutObjectCommandOutput } from "./commands/PutObjectCommand"; import { PutObjectLegalHoldCommandInput, PutObjectLegalHoldCommandOutput } from "./commands/PutObjectLegalHoldCommand"; import { PutObjectLockConfigurationCommandInput, PutObjectLockConfigurationCommandOutput } from "./commands/PutObjectLockConfigurationCommand"; import { PutObjectRetentionCommandInput, PutObjectRetentionCommandOutput } from "./commands/PutObjectRetentionCommand"; import { PutObjectTaggingCommandInput, PutObjectTaggingCommandOutput } from "./commands/PutObjectTaggingCommand"; import { PutPublicAccessBlockCommandInput, PutPublicAccessBlockCommandOutput } from "./commands/PutPublicAccessBlockCommand"; import { RestoreObjectCommandInput, RestoreObjectCommandOutput } from "./commands/RestoreObjectCommand"; import { SelectObjectContentCommandInput, SelectObjectContentCommandOutput } from "./commands/SelectObjectContentCommand"; import { UploadPartCommandInput, UploadPartCommandOutput } from "./commands/UploadPartCommand"; import { UploadPartCopyCommandInput, UploadPartCopyCommandOutput } from "./commands/UploadPartCopyCommand"; import { WriteGetObjectResponseCommandInput, WriteGetObjectResponseCommandOutput } from "./commands/WriteGetObjectResponseCommand"; import { S3Client } from "./S3Client"; /** * <p></p> */ export declare class S3 extends S3Client { /** * <p>This action aborts a multipart upload. After a multipart upload is aborted, no * additional parts can be uploaded using that upload ID. The storage consumed by any * previously uploaded parts will be freed. However, if any part uploads are currently in * progress, those part uploads might or might not succeed. As a result, it might be necessary * to abort a given multipart upload multiple times in order to completely free all storage * consumed by all parts. </p> * <p>To verify that all parts have been removed, so you don't get charged for the part * storage, you should call the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> action and ensure that * the parts list is empty.</p> * <p>For information about permissions required to use the multipart upload, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload and * Permissions</a>.</p> * <p>The following operations are related to <code>AbortMultipartUpload</code>:</p> * <ul> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html">CreateMultipartUpload</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html">CompleteMultipartUpload</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html">ListMultipartUploads</a> * </p> * </li> * </ul> */ abortMultipartUpload(args: AbortMultipartUploadCommandInput, options?: __HttpHandlerOptions): Promise<AbortMultipartUploadCommandOutput>; abortMultipartUpload(args: AbortMultipartUploadCommandInput, cb: (err: any, data?: AbortMultipartUploadCommandOutput) => void): void; abortMultipartUpload(args: AbortMultipartUploadCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: AbortMultipartUploadCommandOutput) => void): void; /** * <p>Completes a multipart upload by assembling previously uploaded parts.</p> * <p>You first initiate the multipart upload and then upload all parts using the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a> * operation. After successfully uploading all relevant parts of an upload, you call this * action to complete the upload. Upon receiving this request, Amazon S3 concatenates all * the parts in ascending order by part number to create a new object. In the Complete * Multipart Upload request, you must provide the parts list. You must ensure that the parts * list is complete. This action concatenates the parts that you provide in the list. For * each part in the list, you must provide the part number and the <code>ETag</code> value, * returned after that part was uploaded.</p> * <p>Processing of a Complete Multipart Upload request could take several minutes to * complete. After Amazon S3 begins processing the request, it sends an HTTP response header that * specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white * space characters to keep the connection from timing out. Because a request could fail after * the initial 200 OK response has been sent, it is important that you check the response body * to determine whether the request succeeded.</p> * <p>Note that if <code>CompleteMultipartUpload</code> fails, applications should be prepared * to retry the failed requests. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html">Amazon S3 Error Best Practices</a>.</p> * <important> * <p>You cannot use <code>Content-Type: application/x-www-form-urlencoded</code> with Complete * Multipart Upload requests. Also, if you do not provide a <code>Content-Type</code> header, <code>CompleteMultipartUpload</code> returns a 200 OK response.</p> * </important> * <p>For more information about multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html">Uploading Objects Using Multipart * Upload</a>.</p> * <p>For information about permissions required to use the multipart upload API, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload and * Permissions</a>.</p> * * * <p> * <code>CompleteMultipartUpload</code> has the following special errors:</p> * <ul> * <li> * <p>Error code: <code>EntityTooSmall</code> * </p> * <ul> * <li> * <p>Description: Your proposed upload is smaller than the minimum allowed object * size. Each part must be at least 5 MB in size, except the last part.</p> * </li> * <li> * <p>400 Bad Request</p> * </li> * </ul> * </li> * <li> * <p>Error code: <code>InvalidPart</code> * </p> * <ul> * <li> * <p>Description: One or more of the specified parts could not be found. The part * might not have been uploaded, or the specified entity tag might not have * matched the part's entity tag.</p> * </li> * <li> * <p>400 Bad Request</p> * </li> * </ul> * </li> * <li> * <p>Error code: <code>InvalidPartOrder</code> * </p> * <ul> * <li> * <p>Description: The list of parts was not in ascending order. The parts list * must be specified in order by part number.</p> * </li> * <li> * <p>400 Bad Request</p> * </li> * </ul> * </li> * <li> * <p>Error code: <code>NoSuchUpload</code> * </p> * <ul> * <li> * <p>Description: The specified multipart upload does not exist. The upload ID * might be invalid, or the multipart upload might have been aborted or * completed.</p> * </li> * <li> * <p>404 Not Found</p> * </li> * </ul> * </li> * </ul> * * <p>The following operations are related to <code>CompleteMultipartUpload</code>:</p> * <ul> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html">CreateMultipartUpload</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html">AbortMultipartUpload</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html">ListParts</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html">ListMultipartUploads</a> * </p> * </li> * </ul> */ completeMultipartUpload(args: CompleteMultipartUploadCommandInput, options?: __HttpHandlerOptions): Promise<CompleteMultipartUploadCommandOutput>; completeMultipartUpload(args: CompleteMultipartUploadCommandInput, cb: (err: any, data?: CompleteMultipartUploadCommandOutput) => void): void; completeMultipartUpload(args: CompleteMultipartUploadCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CompleteMultipartUploadCommandOutput) => void): void; /** * <p>Creates a copy of an object that is already stored in Amazon S3.</p> * <note> * <p>You can store individual objects of up to 5 TB in Amazon S3. You create a copy of your * object up to 5 GB in size in a single atomic action using this API. However, to copy an * object greater than 5 GB, you must use the multipart upload Upload Part - Copy * (UploadPartCopy) API. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html">Copy Object Using the * REST Multipart Upload API</a>.</p> * </note> * <p>All copy requests must be authenticated. Additionally, you must have * <i>read</i> access to the source object and <i>write</i> * access to the destination bucket. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html">REST Authentication</a>. Both the Region * that you want to copy the object from and the Region that you want to copy the object to * must be enabled for your account.</p> * <p>A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 * is copying the files. If the error occurs before the copy action starts, you receive a * standard Amazon S3 error. If the error occurs during the copy operation, the error response is * embedded in the <code>200 OK</code> response. This means that a <code>200 OK</code> * response can contain either a success or an error. Design your application to parse the * contents of the response and handle it appropriately.</p> * <p>If the copy is successful, you receive a response with information about the copied * object.</p> * <note> * <p>If the request is an HTTP 1.1 request, the response is chunk encoded. If it were not, * it would not contain the content-length, and you would need to read the entire * body.</p> * </note> * <p>The copy request charge is based on the storage class and Region that you specify for * the destination object. For pricing information, see <a href="http://aws.amazon.com/s3/pricing/">Amazon S3 pricing</a>.</p> * <important> * <p>Amazon S3 transfer acceleration does not support cross-Region copies. If you request a * cross-Region copy using a transfer acceleration endpoint, you get a 400 <code>Bad * Request</code> error. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html">Transfer Acceleration</a>.</p> * </important> * <p> * <b>Metadata</b> * </p> * <p>When copying an object, you can preserve all metadata (default) or specify new metadata. * However, the ACL is not preserved and is set to private for the user making the request. To * override the default ACL setting, specify a new ACL when generating a copy request. For * more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html">Using ACLs</a>. </p> * <p>To specify whether you want the object metadata copied from the source object or * replaced with metadata provided in the request, you can optionally add the * <code>x-amz-metadata-directive</code> header. When you grant permissions, you can use * the <code>s3:x-amz-metadata-directive</code> condition key to enforce certain metadata * behavior when objects are uploaded. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html">Specifying Conditions in a * Policy</a> in the <i>Amazon S3 User Guide</i>. For a complete list of * Amazon S3-specific condition keys, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html">Actions, Resources, and Condition Keys for * Amazon S3</a>.</p> * <p> * <b>x-amz-copy-source-if Headers</b> * </p> * <p>To only copy an object under certain conditions, such as whether the <code>Etag</code> * matches or whether the object was modified before or after a specified date, use the * following request parameters:</p> * <ul> * <li> * <p> * <code>x-amz-copy-source-if-match</code> * </p> * </li> * <li> * <p> * <code>x-amz-copy-source-if-none-match</code> * </p> * </li> * <li> * <p> * <code>x-amz-copy-source-if-unmodified-since</code> * </p> * </li> * <li> * <p> * <code>x-amz-copy-source-if-modified-since</code> * </p> * </li> * </ul> * <p> If both the <code>x-amz-copy-source-if-match</code> and * <code>x-amz-copy-source-if-unmodified-since</code> headers are present in the request * and evaluate as follows, Amazon S3 returns <code>200 OK</code> and copies the data:</p> * <ul> * <li> * <p> * <code>x-amz-copy-source-if-match</code> condition evaluates to true</p> * </li> * <li> * <p> * <code>x-amz-copy-source-if-unmodified-since</code> condition evaluates to * false</p> * </li> * </ul> * * <p>If both the <code>x-amz-copy-source-if-none-match</code> and * <code>x-amz-copy-source-if-modified-since</code> headers are present in the request and * evaluate as follows, Amazon S3 returns the <code>412 Precondition Failed</code> response * code:</p> * <ul> * <li> * <p> * <code>x-amz-copy-source-if-none-match</code> condition evaluates to false</p> * </li> * <li> * <p> * <code>x-amz-copy-source-if-modified-since</code> condition evaluates to * true</p> * </li> * </ul> * * <note> * <p>All headers with the <code>x-amz-</code> prefix, including * <code>x-amz-copy-source</code>, must be signed.</p> * </note> * <p> * <b>Server-side encryption</b> * </p> * <p>When you perform a CopyObject operation, you can optionally use the appropriate encryption-related * headers to encrypt the object using server-side encryption with Amazon Web Services managed encryption keys * (SSE-S3 or SSE-KMS) or a customer-provided encryption key. With server-side encryption, Amazon S3 * encrypts your data as it writes it to disks in its data centers and decrypts the data when * you access it. For more information about server-side encryption, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html">Using * Server-Side Encryption</a>.</p> * <p>If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. For more * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html">Amazon S3 Bucket Keys</a> in the <i>Amazon S3 User Guide</i>.</p> * <p> * <b>Access Control List (ACL)-Specific Request * Headers</b> * </p> * <p>When copying an object, you can optionally use headers to grant ACL-based permissions. * By default, all objects are private. Only the owner has full access control. When adding a * new object, you can grant permissions to individual Amazon Web Services accounts or to predefined groups * defined by Amazon S3. These permissions are then added to the ACL on the object. For more * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html">Access Control List (ACL) Overview</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html">Managing ACLs Using the REST * API</a>. </p> * <p>If the bucket that you're copying objects to uses the bucket owner enforced setting for * S3 Object Ownership, ACLs are disabled and no longer affect permissions. Buckets that * use this setting only accept PUT requests that don't specify an ACL or PUT requests that * specify bucket owner full control ACLs, such as the <code>bucket-owner-full-control</code> canned * ACL or an equivalent form of this ACL expressed in the XML format.</p> * <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html"> Controlling ownership of * objects and disabling ACLs</a> in the <i>Amazon S3 User Guide</i>.</p> * <note> * <p>If your bucket uses the bucket owner enforced setting for Object Ownership, * all objects written to the bucket by any account will be owned by the bucket owner.</p> * </note> * <p> * <b>Checksums</b> * </p> * <p>When copying an object, if it has a checksum, that checksum will be copied to the new object * by default. When you copy the object over, you may optionally specify a different checksum * algorithm to use with the <code>x-amz-checksum-algorithm</code> header.</p> * <p> * <b>Storage Class Options</b> * </p> * <p>You can use the <code>CopyObject</code> action to change the storage class of an * object that is already stored in Amazon S3 using the <code>StorageClass</code> parameter. For * more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html">Storage * Classes</a> in the <i>Amazon S3 User Guide</i>.</p> * <p> * <b>Versioning</b> * </p> * <p>By default, <code>x-amz-copy-source</code> identifies the current version of an object * to copy. If the current version is a delete marker, Amazon S3 behaves as if the object was * deleted. To copy a different version, use the <code>versionId</code> subresource.</p> * <p>If you enable versioning on the target bucket, Amazon S3 generates a unique version ID for * the object being copied. This version ID is different from the version ID of the source * object. Amazon S3 returns the version ID of the copied object in the * <code>x-amz-version-id</code> response header in the response.</p> * <p>If you do not enable versioning or suspend it on the target bucket, the version ID that * Amazon S3 generates is always null.</p> * <p>If the source object's storage class is GLACIER, you must restore a copy of this object * before you can use it as a source object for the copy operation. For more information, see * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html">RestoreObject</a>.</p> * <p>The following operations are related to <code>CopyObject</code>:</p> * <ul> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html">GetObject</a> * </p> * </li> * </ul> * <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html">Copying * Objects</a>.</p> */ copyObject(args: CopyObjectCommandInput, options?: __HttpHandlerOptions): Promise<CopyObjectCommandOutput>; copyObject(args: CopyObjectCommandInput, cb: (err: any, data?: CopyObjectCommandOutput) => void): void; copyObject(args: CopyObjectCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CopyObjectCommandOutput) => void): void; /** * <p>Creates a new S3 bucket. To create a bucket, you must register with Amazon S3 and have a * valid Amazon Web Services Access Key ID to authenticate requests. Anonymous requests are never allowed to * create buckets. By creating the bucket, you become the bucket owner.</p> * <p>Not every string is an acceptable bucket name. For information about bucket naming * restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Bucket naming rules</a>.</p> * <p>If you want to create an Amazon S3 on Outposts bucket, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html">Create Bucket</a>. </p> * <p>By default, the bucket is created in the US East (N. Virginia) Region. You can * optionally specify a Region in the request body. You might choose a Region to optimize * latency, minimize costs, or address regulatory requirements. For example, if you reside in * Europe, you will probably find it advantageous to create buckets in the Europe (Ireland) * Region. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro">Accessing a * bucket</a>.</p> * <note> * <p>If you send your create bucket request to the <code>s3.amazonaws.com</code> endpoint, * the request goes to the us-east-1 Region. Accordingly, the signature calculations in * Signature Version 4 must use us-east-1 as the Region, even if the location constraint in * the request specifies another Region where the bucket is to be created. If you create a * bucket in a Region other than US East (N. Virginia), your application must be able to * handle 307 redirect. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html">Virtual hosting of buckets</a>.</p> * </note> * <p> * <b>Access control lists (ACLs)</b> * </p> * <p>When creating a bucket using this operation, you can optionally configure the bucket ACL to specify the accounts or * groups that should be granted specific permissions on the bucket.</p> * <important> * <p>If your CreateBucket request sets bucket owner enforced for S3 Object Ownership and * specifies a bucket ACL that provides access to an external Amazon Web Services account, your request * fails with a <code>400</code> error and returns the * <code>InvalidBucketAclWithObjectOwnership</code> error code. For more information, * see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling object * ownership</a> in the <i>Amazon S3 User Guide</i>.</p> * </important> * <p>There are two ways to grant the appropriate permissions using the request headers.</p> * <ul> * <li> * <p>Specify a canned ACL using the <code>x-amz-acl</code> request header. Amazon S3 * supports a set of predefined ACLs, known as <i>canned ACLs</i>. Each * canned ACL has a predefined set of grantees and permissions. For more information, * see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL">Canned ACL</a>.</p> * </li> * <li> * <p>Specify access permissions explicitly using the <code>x-amz-grant-read</code>, * <code>x-amz-grant-write</code>, <code>x-amz-grant-read-acp</code>, * <code>x-amz-grant-write-acp</code>, and <code>x-amz-grant-full-control</code> * headers. These headers map to the set of permissions Amazon S3 supports in an ACL. For * more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html">Access control list * (ACL) overview</a>.</p> * <p>You specify each grantee as a type=value pair, where the type is one of the * following:</p> * <ul> * <li> * <p> * <code>id</code> – if the value specified is the canonical user ID of an Amazon Web Services account</p> * </li> * <li> * <p> * <code>uri</code> – if you are granting permissions to a predefined * group</p> * </li> * <li> * <p> * <code>emailAddress</code> – if the value specified is the email address of * an Amazon Web Services account</p> * <note> * <p>Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: </p> * <ul> * <li> * <p>US East (N. Virginia)</p> * </li> * <li> * <p>US West (N. California)</p> * </li> * <li> * <p> US West (Oregon)</p> * </li> * <li> * <p> Asia Pacific (Singapore)</p> * </li> * <li> * <p>Asia Pacific (Sydney)</p> * </li> * <li> * <p>Asia Pacific (Tokyo)</p> * </li> * <li> * <p>Europe (Ireland)</p> * </li> * <li> * <p>South America (São Paulo)</p> * </li> * </ul> * <p>For a list of all the Amazon S3 supported Regions and endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p> * </note> * </li> * </ul> * <p>For example, the following <code>x-amz-grant-read</code> header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata:</p> * <p> * <code>x-amz-grant-read: id="11112222333", id="444455556666" </code> * </p> * </li> * </ul> * <note> * <p>You can use either a canned ACL or specify access permissions explicitly. You cannot * do both.</p> * </note> * * <p> * <b>Permissions</b> * </p> * <p>In addition to <code>s3:CreateBucket</code>, the following permissions are required when your CreateBucket includes specific headers:</p> * <ul> * <li> * <p> * <b>ACLs</b> - If your <code>CreateBucket</code> request specifies ACL permissions and the ACL is public-read, public-read-write, * authenticated-read, or if you specify access permissions explicitly through any other ACL, both * <code>s3:CreateBucket</code> and <code>s3:PutBucketAcl</code> permissions are needed. If the ACL the * <code>CreateBucket</code> request is private or doesn't specify any ACLs, only <code>s3:CreateBucket</code> permission is needed. </p> * </li> * <li> * <p> * <b>Object Lock</b> - If * <code>ObjectLockEnabledForBucket</code> is set to true in your * <code>CreateBucket</code> request, * <code>s3:PutBucketObjectLockConfiguration</code> and * <code>s3:PutBucketVersioning</code> permissions are required.</p> * </li> * <li> * <p> * <b>S3 Object Ownership</b> - If your CreateBucket * request includes the the <code>x-amz-object-ownership</code> header, * <code>s3:PutBucketOwnershipControls</code> permission is required.</p> * </li> * </ul> * <p>The following operations are related to <code>CreateBucket</code>:</p> * <ul> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a> * </p> * </li> * <li> * <p> * <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html">DeleteBucket</a> * </p> * </li> * </ul> */ createBucket(args: CreateBucketCommandInput, options?: __HttpHandlerOptions): Promise<CreateBucketCommandOutput>; createBucket(args: CreateBucketCommandInput, cb: (err: any, data?: CreateBucketCommandOutput) => void): void; createBucket(args: CreateBucketCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateBucketCommandOutput) => void): void; /** * <p>This action initiates a multipart upload and returns an upload ID. This upload ID is * used to associate all of the parts in the specific multipart upload. You specify this * upload ID in each of your subsequent upload part requests (see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a>). You also include this * upload ID in the final request to either complete or abort the multipart upload * request.</p> * * <p>For more information about multipart uploads, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html">Multipart Upload Overview</a>.</p> * * <p>If you have configured a lifecycle rule to abort incomplete multipart uploads, the * upload must complete within the number of days specified in the bucket lifecycle * configuration. Otherwise, the incomplete multipart upload becomes eligible for an abort * action and Amazon S3 aborts the multipart upload. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config">Aborting * Incomplete Multipart Uploads Using a Bucket Lifecycle Policy</a>.</p> * * <p>For information about the permissions required to use the multipart upload API, see * <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html">Multipart Upload and * Permissions</a>.</p> * * <p>For request signing, multipart upload is just a series of regular requests. You initiate * a multipart upload, send one or more requests to upload parts, and then complete the * multipart upload process. You sign each request individually. There is nothing special * about signing multipart upload requests. For more information about signing, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html">Authenticating * Requests (Amazon Web Services Signature Version 4)</a>.</p> * * <note> * <p> After you initiate a multipart upload and upload one or more parts, to stop being * charged for storing the uploaded parts, you must either complete or abort the multipart * upload. Amazon S3 frees up the space used to store the parts and stop charging you for * storing them only after you either complete or abort a multipart upload. </p> * </note> * * <p>You can optionally request server-side encryption. For server-side encryption, Amazon S3 * encrypts your data as it writes it to disks in its data centers and decrypts it when you * access it. You can provide your own encryption key, or use Amazon Web Services KMS keys or Amazon S3-managed encryption keys. If you choose to provide * your own encryption key, the request headers you provide in <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html">UploadPart</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html">UploadPartCopy</a> requests must match the headers you used in the request to * initiate the upload by using <code>CreateMultipartUpload</code>. </p> * <p>To perform a multipart upload with encryption using an Amazon Web Services KMS key, the requester must * have permission to the <code>kms:Decrypt</code> and <code>kms:GenerateDataKey*</code> * actions on the key. These permissions are required because Amazon S3 must decrypt and read data * from the encrypted file parts before it completes the multipart upload. For more * information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions">Multipart upload API * and permissions</a> in the <i>Amazon S3 User Guide</i>.</p> * * <p>If your Identity and Access Management (IAM) user or role is in the same Amazon Web Services account * as the KMS key, then you must have these permissions on the key policy. If your IAM * user or role belongs to a different account