S3 ** Client ====== class S3.Client A low-level client representing Amazon Simple Storage Service (S3) import boto3 client = boto3.client('s3') These are the available methods: * abort_multipart_upload * can_paginate * close * complete_multipart_upload * copy * copy_object * create_bucket * create_bucket_metadata_configuration * create_bucket_metadata_table_configuration * create_multipart_upload * create_session * delete_bucket * delete_bucket_analytics_configuration * delete_bucket_cors * delete_bucket_encryption * delete_bucket_intelligent_tiering_configuration * delete_bucket_inventory_configuration * delete_bucket_lifecycle * delete_bucket_metadata_configuration * delete_bucket_metadata_table_configuration * delete_bucket_metrics_configuration * delete_bucket_ownership_controls * delete_bucket_policy * delete_bucket_replication * delete_bucket_tagging * delete_bucket_website * delete_object * delete_object_tagging * delete_objects * delete_public_access_block * download_file * download_fileobj * generate_presigned_post * generate_presigned_url * get_bucket_accelerate_configuration * get_bucket_acl * get_bucket_analytics_configuration * get_bucket_cors * get_bucket_encryption * get_bucket_intelligent_tiering_configuration * get_bucket_inventory_configuration * get_bucket_lifecycle * get_bucket_lifecycle_configuration * get_bucket_location * get_bucket_logging * get_bucket_metadata_configuration * get_bucket_metadata_table_configuration * get_bucket_metrics_configuration * get_bucket_notification * get_bucket_notification_configuration * get_bucket_ownership_controls * get_bucket_policy * get_bucket_policy_status * get_bucket_replication * get_bucket_request_payment * get_bucket_tagging * get_bucket_versioning * get_bucket_website * get_object * get_object_acl * get_object_attributes * get_object_legal_hold * get_object_lock_configuration * get_object_retention * get_object_tagging * get_object_torrent * get_paginator * get_public_access_block * get_waiter * head_bucket * head_object * list_bucket_analytics_configurations * list_bucket_intelligent_tiering_configurations * list_bucket_inventory_configurations * list_bucket_metrics_configurations * list_buckets * list_directory_buckets * list_multipart_uploads * list_object_versions * list_objects * list_objects_v2 * list_parts * put_bucket_accelerate_configuration * put_bucket_acl * put_bucket_analytics_configuration * put_bucket_cors * put_bucket_encryption * put_bucket_intelligent_tiering_configuration * put_bucket_inventory_configuration * put_bucket_lifecycle * put_bucket_lifecycle_configuration * put_bucket_logging * put_bucket_metrics_configuration * put_bucket_notification * put_bucket_notification_configuration * put_bucket_ownership_controls * put_bucket_policy * put_bucket_replication * put_bucket_request_payment * put_bucket_tagging * put_bucket_versioning * put_bucket_website * put_object * put_object_acl * put_object_legal_hold * put_object_lock_configuration * put_object_retention * put_object_tagging * put_public_access_block * rename_object * restore_object * select_object_content * update_bucket_metadata_inventory_table_configuration * update_bucket_metadata_journal_table_configuration * upload_file * upload_fileobj * upload_part * upload_part_copy * write_get_object_response Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListBuckets * ListDirectoryBuckets * ListMultipartUploads * ListObjectVersions * ListObjects * ListObjectsV2 * ListParts Waiters ======= Waiters are available on a client instance via the "get_waiter" method. For more detailed instructions and examples on the usage or waiters, see the waiters user guide. The available waiters are: * BucketExists * BucketNotExists * ObjectExists * ObjectNotExists Resources ========= Resources are available in boto3 via the "resource" method. For more detailed instructions and examples on the usage of resources, see the resources user guide. The available resources are: * Service Resource * Bucket * BucketAcl * BucketCors * BucketLifecycle * BucketLifecycleConfiguration * BucketLogging * BucketNotification * BucketPolicy * BucketRequestPayment * BucketTagging * BucketVersioning * BucketWebsite * MultipartUpload * MultipartUploadPart * Object * ObjectAcl * ObjectSummary * ObjectVersion Examples ======== List objects in an Amazon S3 bucket ----------------------------------- The following example shows how to use an Amazon S3 bucket resource to list the objects in the bucket. import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('amzn-s3-demo-bucket') for obj in bucket.objects.all(): print(obj.key) List top-level common prefixes in Amazon S3 bucket -------------------------------------------------- This example shows how to list all of the top-level common prefixes in an Amazon S3 bucket: import boto3 client = boto3.client('s3') paginator = client.get_paginator('list_objects') result = paginator.paginate(Bucket='amzn-s3-demo-bucket', Delimiter='/') for prefix in result.search('CommonPrefixes'): print(prefix.get('Prefix')) Restore Glacier objects in an Amazon S3 bucket ---------------------------------------------- The following example shows how to initiate restoration of glacier objects in an Amazon S3 bucket, determine if a restoration is on- going, and determine if a restoration is finished. import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('amzn-s3-demo-bucket') for obj_sum in bucket.objects.all(): obj = s3.Object(obj_sum.bucket_name, obj_sum.key) if obj.storage_class == 'GLACIER': # Try to restore the object if the storage class is glacier and # the object does not have a completed or ongoing restoration # request. if obj.restore is None: print('Submitting restoration request: %s' % obj.key) obj.restore_object(RestoreRequest={'Days': 1}) # Print out objects whose restoration is on-going elif 'ongoing-request="true"' in obj.restore: print('Restoration in-progress: %s' % obj.key) # Print out objects whose restoration is complete elif 'ongoing-request="false"' in obj.restore: print('Restoration complete: %s' % obj.key) Uploading/downloading files using SSE KMS ----------------------------------------- This example shows how to use SSE-KMS to upload objects using server side encryption with a key managed by KMS. We can either use the default KMS master key, or create a custom key in AWS and use it to encrypt the object by passing in its key id. With KMS, nothing else needs to be provided for getting the object; S3 already knows how to decrypt the object. import boto3 import os BUCKET = 'amzn-s3-demo-bucket' s3 = boto3.client('s3') keyid = '' print("Uploading S3 object with SSE-KMS") s3.put_object(Bucket=BUCKET, Key='encrypt-key', Body=b'foobar', ServerSideEncryption='aws:kms', # Optional: SSEKMSKeyId SSEKMSKeyId=keyid) print("Done") # Getting the object: print("Getting S3 object...") response = s3.get_object(Bucket=BUCKET, Key='encrypt-key') print("Done, response body:") print(response['Body'].read()) Uploading/downloading files using SSE Customer Keys --------------------------------------------------- This example shows how to use SSE-C to upload objects using server side encryption with a customer provided key. First, we'll need a 32 byte key. For this example, we'll randomly generate a key but you can use any 32 byte key you want. Remember, you must the same key to download the object. If you lose the encryption key, you lose the object. Also note how we don't have to provide the SSECustomerKeyMD5. Boto3 will automatically compute this value for us. import boto3 import os BUCKET = 'amzn-s3-demo-bucket' KEY = os.urandom(32) s3 = boto3.client('s3') print("Uploading S3 object with SSE-C") s3.put_object(Bucket=BUCKET, Key='encrypt-key', Body=b'foobar', SSECustomerKey=KEY, SSECustomerAlgorithm='AES256') print("Done") # Getting the object: print("Getting S3 object...") # Note how we're using the same ``KEY`` we # created earlier. response = s3.get_object(Bucket=BUCKET, Key='encrypt-key', SSECustomerKey=KEY, SSECustomerAlgorithm='AES256') print("Done, response body:") print(response['Body'].read()) Downloading a specific version of an S3 object ---------------------------------------------- This example shows how to download a specific version of an S3 object. import boto3 s3 = boto3.client('s3') s3.download_file( "amzn-s3-demo-bucket", "key-name", "tmp.txt", ExtraArgs={"VersionId": "my-version-id"} ) Filter objects by last modified time using JMESPath --------------------------------------------------- This example shows how to filter objects by last modified time using JMESPath. import boto3 s3 = boto3.client("s3") s3_paginator = s3.get_paginator('list_objects_v2') s3_iterator = s3_paginator.paginate(Bucket='amzn-s3-demo-bucket') filtered_iterator = s3_iterator.search( "Contents[?to_string(LastModified)>='\"2022-01-05 08:05:37+00:00\"'].Key" ) for key_data in filtered_iterator: print(key_data) Client Context Parameters ========================= Client context parameters are configurable on a client instance via the "client_context_params" parameter in the "Config" object. For more detailed instructions and examples on the exact usage of context params see the configuration guide. The available "s3" client context params are: * "disable_s3_express_session_auth" (boolean) - Disables this client's usage of Session Auth for S3Express buckets and reverts to using conventional SigV4 for those. BucketCors / Action / get_available_subresources get_available_subresources ************************** S3.BucketCors.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketCors / Action / put put *** S3.BucketCors.put(**kwargs) Note: This operation is not supported for directory buckets. Sets the "cors" configuration for your bucket. If the configuration exists, Amazon S3 replaces it. To use this operation, you must be allowed to perform the "s3:PutBucketCORS" action. By default, the bucket owner has this permission and can grant it to others. You set this configuration on a bucket so that the bucket can service cross-origin requests. For example, you might want to enable a request whose origin is "http://www.example.com" to access your Amazon S3 bucket at "my.example.bucket.com" by using the browser's "XMLHttpRequest" capability. To enable cross-origin resource sharing (CORS) on a bucket, you add the "cors" subresource to the bucket. The "cors" subresource is an XML document in which you configure rules that identify origins and the HTTP methods that can be executed on your bucket. The document is limited to 64 KB in size. When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS request) against a bucket, it evaluates the "cors" configuration on the bucket and uses the first "CORSRule" rule that matches the incoming browser request to enable a cross-origin request. For a rule to match, the following conditions must be met: * The request's "Origin" header must match "AllowedOrigin" elements. * The request method (for example, GET, PUT, HEAD, and so on) or the "Access-Control-Request-Method" header in case of a pre- flight "OPTIONS" request must be one of the "AllowedMethod" elements. * Every header specified in the "Access-Control-Request-Headers" request header of a pre-flight request must match an "AllowedHeader" element. For more information about CORS, go to Enabling Cross-Origin Resource Sharing in the *Amazon S3 User Guide*. The following operations are related to "PutBucketCors": * GetBucketCors * DeleteBucketCors * RESTOPTIONSobject See also: AWS API Documentation **Request Syntax** response = bucket_cors.put( CORSConfiguration={ 'CORSRules': [ { 'ID': 'string', 'AllowedHeaders': [ 'string', ], 'AllowedMethods': [ 'string', ], 'AllowedOrigins': [ 'string', ], 'ExposeHeaders': [ 'string', ], 'MaxAgeSeconds': 123 }, ] }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **CORSConfiguration** (*dict*) -- **[REQUIRED]** Describes the cross-origin access configuration for objects in an Amazon S3 bucket. For more information, see Enabling Cross- Origin Resource Sharing in the *Amazon S3 User Guide*. * **CORSRules** *(list) --* **[REQUIRED]** A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration. * *(dict) --* Specifies a cross-origin access rule for an Amazon S3 bucket. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **AllowedHeaders** *(list) --* Headers that are specified in the "Access-Control- Request-Headers" header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed. * *(string) --* * **AllowedMethods** *(list) --* **[REQUIRED]** An HTTP method that you allow the origin to execute. Valid values are "GET", "PUT", "HEAD", "POST", and "DELETE". * *(string) --* * **AllowedOrigins** *(list) --* **[REQUIRED]** One or more origins you want customers to be able to access the bucket from. * *(string) --* * **ExposeHeaders** *(list) --* 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). * *(string) --* * **MaxAgeSeconds** *(integer) --* The time in seconds that your browser is to cache the preflight response for the specified resource. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketCors / Action / load load **** S3.BucketCors.load() Calls "S3.Client.get_bucket_cors()" to update the attributes of the BucketCors resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_cors.load() Returns: None S3 / Resource / BucketCors BucketCors ********** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketCors(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketCors: import boto3 s3 = boto3.resource('s3') bucket_cors = s3.BucketCors('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketCors's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * cors_rules Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketCors / Identifier / bucket_name bucket_name *********** S3.BucketCors.bucket_name *(string)* The BucketCors's bucket_name identifier. This **must** be set. BucketCors / Sub-Resource / Bucket Bucket ****** S3.BucketCors.Bucket() Creates a Bucket resource.: bucket = bucket_cors.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketCors / Action / reload reload ****** S3.BucketCors.reload() Calls "S3.Client.get_bucket_cors()" to update the attributes of the BucketCors resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_cors.reload() Returns: None BucketCors / Action / delete delete ****** S3.BucketCors.delete(**kwargs) Note: This operation is not supported for directory buckets. Deletes the "cors" configuration information set for the bucket. To use this operation, you must have permission to perform the "s3:PutBucketCORS" action. The bucket owner has this permission by default and can grant this permission to others. For information about "cors", see Enabling Cross-Origin Resource Sharing in the *Amazon S3 User Guide*. **Related Resources** * PutBucketCors * RESTOPTIONSobject See also: AWS API Documentation **Request Syntax** response = bucket_cors.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketCors / Attribute / cors_rules cors_rules ********** S3.BucketCors.cors_rules * *(list) --* A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration. * *(dict) --* Specifies a cross-origin access rule for an Amazon S3 bucket. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **AllowedHeaders** *(list) --* Headers that are specified in the "Access-Control-Request- Headers" header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed. * *(string) --* * **AllowedMethods** *(list) --* An HTTP method that you allow the origin to execute. Valid values are "GET", "PUT", "HEAD", "POST", and "DELETE". * *(string) --* * **AllowedOrigins** *(list) --* One or more origins you want customers to be able to access the bucket from. * *(string) --* * **ExposeHeaders** *(list) --* 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). * *(string) --* * **MaxAgeSeconds** *(integer) --* The time in seconds that your browser is to cache the preflight response for the specified resource. BucketLifecycleConfiguration / Action / get_available_subresources get_available_subresources ************************** S3.BucketLifecycleConfiguration.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketLifecycleConfiguration / Action / put put *** S3.BucketLifecycleConfiguration.put(**kwargs) Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. Keep in mind that this will overwrite an existing lifecycle configuration, so if you want to retain any configuration details, they must be included in the new lifecycle configuration. For information about lifecycle configuration, see Managing your storage lifecycle. Note: Bucket lifecycle configuration now supports specifying a lifecycle rule using an object key name prefix, one or more object tags, object size, or any combination of these. Accordingly, this section describes the latest API. The previous version of the API supported filtering based only on an object key name prefix, which is supported for backward compatibility. For the related API description, see PutBucketLifecycle.Rules Permissions HTTP Host header syntax You specify the lifecycle configuration in your request body. The lifecycle configuration is specified as XML consisting of one or more rules. An Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not adjustable. Bucket lifecycle configuration supports specifying a lifecycle rule using an object key name prefix, one or more object tags, object size, or any combination of these. Accordingly, this section describes the latest API. The previous version of the API supported filtering based only on an object key name prefix, which is supported for backward compatibility for general purpose buckets. For the related API description, see PutBucketLifecycle. Note: Lifecyle configurations for directory buckets only support expiring objects and cancelling multipart uploads. Expiring of versioned objects,transitions and tag filters are not supported. A lifecycle rule consists of the following: * A filter identifying a subset of objects to which the rule applies. The filter can be based on a key name prefix, object tags, object size, or any combination of these. * A status indicating whether the rule is in effect. * One or more lifecycle transition and expiration actions that you want Amazon S3 to perform on the objects identified by the filter. If the state of your bucket is versioning-enabled or versioning-suspended, you can have many versions of the same object (one current version and zero or more noncurrent versions). Amazon S3 provides predefined actions that you can specify for current and noncurrent object versions. For more information, see Object Lifecycle Management and Lifecycle Configuration Elements. * **General purpose bucket permissions** - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the "s3:PutLifecycleConfiguration" permission. You can also explicitly deny permissions. An explicit deny also supersedes any other permissions. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them permissions for the following actions: * "s3:DeleteObject" * "s3:DeleteObjectVersion" * "s3:PutLifecycleConfiguration" For more information about permissions, see Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - You must have the "s3express:PutLifecycleConfiguration" permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource. For more information about directory bucket policies and permissions, see Authorizing Regional endpoint APIs with IAM in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". The following operations are related to "PutBucketLifecycleConfiguration": * GetBucketLifecycleConfiguration * DeleteBucketLifecycle See also: AWS API Documentation **Request Syntax** response = bucket_lifecycle_configuration.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', LifecycleConfiguration={ 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Prefix': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 } }, 'Status': 'Enabled'|'Disabled', 'Transitions': [ { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR' }, ], 'NoncurrentVersionTransitions': [ { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'NewerNoncurrentVersions': 123 }, ], 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] }, ExpectedBucketOwner='string', TransitionDefaultMinimumObjectSize='varies_by_storage_class'|'all_storage_classes_128K' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **LifecycleConfiguration** (*dict*) -- Container for lifecycle rules. You can add as many as 1,000 rules. * **Rules** *(list) --* **[REQUIRED]** A lifecycle rule for individual objects in an Amazon S3 bucket. * *(dict) --* A lifecycle rule for individual objects in an Amazon S3 bucket. For more information see, Managing your storage lifecycle in the *Amazon S3 User Guide*. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. This is no longer used; use "Filter" instead. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Filter** *(dict) --* The "Filter" is used to identify objects that a Lifecycle Rule applies to. A "Filter" must have exactly one of "Prefix", "Tag", "ObjectSizeGreaterThan", "ObjectSizeLessThan", or "And" specified. "Filter" is required if the "LifecycleRule" does not contain a "Prefix" element. For more information about "Tag" filters, see Adding filters to Lifecycle rules in the *Amazon S3 User Guide*. Note: "Tag" filters are not supported for directory buckets. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* This tag must exist in the object's tag set in order for the rule to apply. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **And** *(dict) --* This is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates. The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the rule to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **Status** *(string) --* **[REQUIRED]** If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. * **Transitions** *(list) --* Specifies when an Amazon S3 object transitions to a specified storage class. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransitions** *(list) --* Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific 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 a specific storage class at a set period in the object's lifetime. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **TransitionDefaultMinimumObjectSize** (*string*) -- Indicates which default minimum object size behavior is applied to the lifecycle configuration. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * "all_storage_classes_128K" - Objects smaller than 128 KB will not transition to any storage class by default. * "varies_by_storage_class" - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom "ObjectSizeGreaterThan" or "ObjectSizeLessThan" in the body of your transition rule. Custom filters always take precedence over the default transition behavior. Return type: dict Returns: **Response Syntax** { 'TransitionDefaultMinimumObjectSize': 'varies_by_storage_class'|'all_storage_classes_128K' } **Response Structure** * *(dict) --* * **TransitionDefaultMinimumObjectSize** *(string) --* Indicates which default minimum object size behavior is applied to the lifecycle configuration. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * "all_storage_classes_128K" - Objects smaller than 128 KB will not transition to any storage class by default. * "varies_by_storage_class" - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom "ObjectSizeGreaterThan" or "ObjectSizeLessThan" in the body of your transition rule. Custom filters always take precedence over the default transition behavior. BucketLifecycleConfiguration / Attribute / rules rules ***** S3.BucketLifecycleConfiguration.rules * *(list) --* Container for a lifecycle rule. * *(dict) --* A lifecycle rule for individual objects in an Amazon S3 bucket. For more information see, Managing your storage lifecycle in the *Amazon S3 User Guide*. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. This is no longer used; use "Filter" instead. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Filter** *(dict) --* The "Filter" is used to identify objects that a Lifecycle Rule applies to. A "Filter" must have exactly one of "Prefix", "Tag", "ObjectSizeGreaterThan", "ObjectSizeLessThan", or "And" specified. "Filter" is required if the "LifecycleRule" does not contain a "Prefix" element. For more information about "Tag" filters, see Adding filters to Lifecycle rules in the *Amazon S3 User Guide*. Note: "Tag" filters are not supported for directory buckets. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* This tag must exist in the object's tag set in order for the rule to apply. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **And** *(dict) --* This is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates. The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the rule to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **Status** *(string) --* If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. * **Transitions** *(list) --* Specifies when an Amazon S3 object transitions to a specified storage class. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransitions** *(list) --* Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific 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 a specific storage class at a set period in the object's lifetime. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. BucketLifecycleConfiguration / Action / load load **** S3.BucketLifecycleConfiguration.load() Calls "S3.Client.get_bucket_lifecycle_configuration()" to update the attributes of the BucketLifecycleConfiguration resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_lifecycle_configuration.load() Returns: None S3 / Resource / BucketLifecycleConfiguration BucketLifecycleConfiguration **************************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketLifecycleConfiguration(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketLifecycleConfiguration: import boto3 s3 = boto3.resource('s3') bucket_lifecycle_configuration = s3.BucketLifecycleConfiguration('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketLifecycleConfiguration's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * rules * transition_default_minimum_object_size Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketLifecycleConfiguration / Identifier / bucket_name bucket_name *********** S3.BucketLifecycleConfiguration.bucket_name *(string)* The BucketLifecycleConfiguration's bucket_name identifier. This **must** be set. BucketLifecycleConfiguration / Sub-Resource / Bucket Bucket ****** S3.BucketLifecycleConfiguration.Bucket() Creates a Bucket resource.: bucket = bucket_lifecycle_configuration.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketLifecycleConfiguration / Attribute / transition_default_minimum_object_size transition_default_minimum_object_size ************************************** S3.BucketLifecycleConfiguration.transition_default_minimum_object_size * *(string) --* Indicates which default minimum object size behavior is applied to the lifecycle configuration. Note: This parameter applies to general purpose buckets only. It isn't supported for directory bucket lifecycle configurations. * "all_storage_classes_128K" - Objects smaller than 128 KB will not transition to any storage class by default. * "varies_by_storage_class" - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom "ObjectSizeGreaterThan" or "ObjectSizeLessThan" in the body of your transition rule. Custom filters always take precedence over the default transition behavior. BucketLifecycleConfiguration / Action / reload reload ****** S3.BucketLifecycleConfiguration.reload() Calls "S3.Client.get_bucket_lifecycle_configuration()" to update the attributes of the BucketLifecycleConfiguration resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_lifecycle_configuration.reload() Returns: None BucketLifecycleConfiguration / Action / delete delete ****** S3.BucketLifecycleConfiguration.delete(**kwargs) Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration. Permissions * **General purpose bucket permissions** - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the "s3:PutLifecycleConfiguration" permission. For more information about permissions, see Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - You must have the "s3express:PutLifecycleConfiguration" permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource. For more information about directory bucket policies and permissions, see Authorizing Regional endpoint APIs with IAM in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". For more information about the object expiration, see Elements to Describe Lifecycle Actions. Related actions include: * PutBucketLifecycleConfiguration * GetBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = bucket_lifecycle_configuration.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. Returns: None MultipartUpload / Action / get_available_subresources get_available_subresources ************************** S3.MultipartUpload.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str MultipartUpload / Attribute / storage_class storage_class ************* S3.MultipartUpload.storage_class * *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. MultipartUpload / Attribute / owner owner ***** S3.MultipartUpload.owner * *(dict) --* Specifies the owner of the object that is part of the multipart upload. Note: **Directory buckets** - The bucket owner is returned as the object owner for all the objects. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. MultipartUpload / Action / complete complete ******** S3.MultipartUpload.complete(**kwargs) Completes a multipart upload by assembling previously uploaded parts. You first initiate the multipart upload and then upload all parts using the UploadPart operation or the UploadPartCopy operation. After successfully uploading all relevant parts of an upload, you call this "CompleteMultipartUpload" operation 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 CompleteMultipartUpload request, you must provide the parts list and ensure that the parts list is complete. The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list, you must provide the "PartNumber" value and the "ETag" value that are returned after that part was uploaded. The processing of a CompleteMultipartUpload request could take several minutes to finalize. 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. A request could fail after the initial "200 OK" response has been sent. This means that a "200 OK" response can contain either a success or an error. The error response might be embedded in the "200 OK" response. If you call this API operation directly, make sure to design your application to parse the contents of the response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply error handling per your configuration settings (including automatically retrying the request as appropriate). If the condition persists, the SDKs throw an exception (or, for the SDKs that don't use exceptions, they return an error). Note that if "CompleteMultipartUpload" fails, applications should be prepared to retry any failed requests (including 500 error responses). For more information, see Amazon S3 Error Best Practices. Warning: You can't use "Content-Type: application/x-www-form-urlencoded" for the CompleteMultipartUpload requests. Also, if you don't provide a "Content-Type" header, "CompleteMultipartUpload" can still return a "200 OK" response. For more information about multipart uploads, see Uploading Objects Using Multipart Upload in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions in the *Amazon S3 User Guide*. If you provide an additional checksum value in your "MultipartUpload" requests and the object is encrypted with Key Management Service, you must have permission to use the "kms:Decrypt" action for the "CompleteMultipartUpload" request to succeed. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Special errors * Error Code: "EntityTooSmall" * 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. * HTTP Status Code: 400 Bad Request * Error Code: "InvalidPart" * Description: One or more of the specified parts could not be found. The part might not have been uploaded, or the specified ETag might not have matched the uploaded part's ETag. * HTTP Status Code: 400 Bad Request * Error Code: "InvalidPartOrder" * Description: The list of parts was not in ascending order. The parts list must be specified in order by part number. * HTTP Status Code: 400 Bad Request * Error Code: "NoSuchUpload" * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * HTTP Status Code: 404 Not Found HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "CompleteMultipartUpload": * CreateMultipartUpload * UploadPart * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** object = multipart_upload.complete( MultipartUpload={ 'Parts': [ { 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'PartNumber': 123 }, ] }, ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', ChecksumType='COMPOSITE'|'FULL_OBJECT', MpuObjectSize=123, RequestPayer='requester', ExpectedBucketOwner='string', IfMatch='string', IfNoneMatch='string', SSECustomerAlgorithm='string', SSECustomerKey='string', ) Parameters: * **MultipartUpload** (*dict*) -- The container for the multipart upload request information. * **Parts** *(list) --* Array of CompletedPart data types. If you do not supply a valid "Part" with your request, the service sends back an HTTP 400 response. * *(dict) --* Details of the parts that were uploaded. * **ETag** *(string) --* Entity tag returned when the part was uploaded. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC32" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC32C" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" checksum of the part. This checksum is present if the multipart upload request was created with the "SHA1" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" checksum of the part. This checksum is present if the multipart upload request was created with the "SHA256" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **PartNumber** *(integer) --* Part number that identifies the part. This is a positive integer between 1 and 10,000. Note: * **General purpose buckets** - In "CompleteMultipartUpload", when a additional checksum (including "x-amz-checksum-crc32", "x-amz- checksum-crc32c", "x-amz-checksum-sha1", or "x-amz- checksum-sha256") is applied to each part, the "PartNumber" must start at 1 and the part numbers must be consecutive. Otherwise, Amazon S3 generates an HTTP "400 Bad Request" status code and an "InvalidPartOrder" error code. * **Directory buckets** - In "CompleteMultipartUpload", the "PartNumber" must start at 1 and the part numbers must be consecutive. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** (*string*) -- This header specifies the checksum type of the object, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum that was specified. If the checksum type doesn’t match the checksum type that was specified for the object during the "CreateMultipartUpload" request, it’ll result in a "BadDigest" error. For more information, see Checking object integrity in the Amazon S3 User Guide. * **MpuObjectSize** (*integer*) -- The expected total object size of the multipart upload request. If there’s a mismatch between the specified object size value and the actual object size value, it results in an "HTTP 400 InvalidRequest" error. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatch** (*string*) -- Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should fetch the object's ETag, re-initiate the multipart upload with "CreateMultipartUpload", and re-upload each part. Expects the ETag value as a string. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **IfNoneMatch** (*string*) -- Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should re-initiate the multipart upload with "CreateMultipartUpload" and re-upload each part. Expects the '*' (asterisk) character. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **SSECustomerAlgorithm** (*string*) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is required only when the object was created using a checksum algorithm or if your bucket policy requires the use of SSE-C. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required Return type: "s3.Object" Returns: Object resource MultipartUpload / Attribute / checksum_type checksum_type ************* S3.MultipartUpload.checksum_type * *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. S3 / Resource / MultipartUpload MultipartUpload *************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.MultipartUpload(bucket_name, object_key, id) A resource representing an Amazon Simple Storage Service (S3) MultipartUpload: import boto3 s3 = boto3.resource('s3') multipart_upload = s3.MultipartUpload('bucket_name','object_key','id') Parameters: * **bucket_name** (*string*) -- The MultipartUpload's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The MultipartUpload's object_key identifier. This **must** be set. * **id** (*string*) -- The MultipartUpload's id identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name * object_key * id Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * checksum_algorithm * checksum_type * initiated * initiator * key * owner * storage_class * upload_id Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * abort * complete * get_available_subresources Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Object * Part Collections =========== Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide. These are the resource's available collections: * parts MultipartUpload / Identifier / bucket_name bucket_name *********** S3.MultipartUpload.bucket_name *(string)* The MultipartUpload's bucket_name identifier. This **must** be set. MultipartUpload / Attribute / key key *** S3.MultipartUpload.key * *(string) --* Key of the object for which the multipart upload was initiated. MultipartUpload / Attribute / checksum_algorithm checksum_algorithm ****************** S3.MultipartUpload.checksum_algorithm * *(string) --* The algorithm that was used to create a checksum of the object. MultipartUpload / Attribute / initiator initiator ********* S3.MultipartUpload.initiator * *(dict) --* Identifies who initiated the multipart upload. * **ID** *(string) --* If the principal is an Amazon Web Services account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value. Note: **Directory buckets** - If the principal is an Amazon Web Services account, it provides the Amazon Web Services account ID. If the principal is an IAM User, it provides a user ARN value. * **DisplayName** *(string) --* Name of the Principal. Note: This functionality is not supported for directory buckets. MultipartUpload / Sub-Resource / Part Part **** S3.MultipartUpload.Part(part_number) Creates a MultipartUploadPart resource.: multipart_upload_part = multipart_upload.Part('part_number') Parameters: **part_number** (*string*) -- The Part's part_number identifier. This **must** be set. Return type: "S3.MultipartUploadPart" Returns: A MultipartUploadPart resource MultipartUpload / Sub-Resource / Object Object ****** S3.MultipartUpload.Object() Creates a Object resource.: object = multipart_upload.Object() Return type: "S3.Object" Returns: A Object resource MultipartUpload / Collection / parts parts ***** S3.MultipartUpload.parts A collection of MultipartUploadPart resources.A MultipartUploadPart Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources. all() Creates an iterable of all MultipartUploadPart resources in the collection. See also: AWS API Documentation **Request Syntax** multipart_upload_part_iterator = multipart_upload.parts.all() Return type: list("s3.MultipartUploadPart") Returns: A list of MultipartUploadPart resources filter(**kwargs) Creates an iterable of all MultipartUploadPart resources in the collection filtered by kwargs passed to method. A MultipartUploadPart collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources. See also: AWS API Documentation **Request Syntax** multipart_upload_part_iterator = multipart_upload.parts.filter( MaxParts=123, PartNumberMarker=123, RequestPayer='requester', ExpectedBucketOwner='string', SSECustomerAlgorithm='string', SSECustomerKey='string', ) Parameters: * **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. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **SSECustomerAlgorithm** (*string*) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required Return type: list("s3.MultipartUploadPart") Returns: A list of MultipartUploadPart resources limit(**kwargs) Creates an iterable up to a specified amount of MultipartUploadPart resources in the collection. See also: AWS API Documentation **Request Syntax** multipart_upload_part_iterator = multipart_upload.parts.limit( count=123 ) Parameters: **count** (*integer*) -- The limit to the number of resources in the iterable. Return type: list("s3.MultipartUploadPart") Returns: A list of MultipartUploadPart resources page_size(**kwargs) Creates an iterable of all MultipartUploadPart resources in the collection, but limits the number of items returned by each service call by the specified amount. See also: AWS API Documentation **Request Syntax** multipart_upload_part_iterator = multipart_upload.parts.page_size( count=123 ) Parameters: **count** (*integer*) -- The number of items returned by each service call Return type: list("s3.MultipartUploadPart") Returns: A list of MultipartUploadPart resources MultipartUpload / Identifier / object_key object_key ********** S3.MultipartUpload.object_key *(string)* The MultipartUpload's object_key identifier. This **must** be set. MultipartUpload / Attribute / upload_id upload_id ********* S3.MultipartUpload.upload_id * *(string) --* Upload ID that identifies the multipart upload. MultipartUpload / Identifier / id id ** S3.MultipartUpload.id *(string)* The MultipartUpload's id identifier. This **must** be set. MultipartUpload / Attribute / initiated initiated ********* S3.MultipartUpload.initiated * *(datetime) --* Date and time at which the multipart upload was initiated. MultipartUpload / Action / abort abort ***** S3.MultipartUpload.abort(**kwargs) This operation 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. To verify that all parts have been removed and prevent getting charged for the part storage, you should call the ListParts API operation and ensure that the parts list is empty. Note: * **Directory buckets** - If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed. To delete these in-progress multipart uploads, use the "ListMultipartUploads" operation to list the in-progress multipart uploads in the bucket and use the "AbortMultipartUpload" operation to abort all the in-progress multipart uploads. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - For information about permissions required to use the multipart upload, see Multipart Upload and Permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "AbortMultipartUpload": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = multipart_upload.abort( RequestPayer='requester', ExpectedBucketOwner='string', IfMatchInitiatedTime=datetime(2015, 1, 1) ) Parameters: * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatchInitiatedTime** (*datetime*) -- If present, this header aborts an in progress multipart upload only if it was initiated on the provided timestamp. If the initiated timestamp of the multipart upload does not match the provided value, the operation returns a "412 Precondition Failed" error. If the initiated timestamp matches or if the multipart upload doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. BucketLogging / Action / get_available_subresources get_available_subresources ************************** S3.BucketLogging.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketLogging / Attribute / logging_enabled logging_enabled *************** S3.BucketLogging.logging_enabled * *(dict) --* Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For more information, see PUT Bucket logging in the *Amazon S3 API Reference*. * **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** *(list) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions for server access log delivery in the *Amazon S3 User Guide*. * *(dict) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions server access log delivery in the *Amazon S3 User Guide*. * **Grantee** *(dict) --* Container for the person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Logging permissions assigned to the grantee for the bucket. * **TargetPrefix** *(string) --* A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. * **TargetObjectKeyFormat** *(dict) --* Amazon S3 key format for log objects. * **SimplePrefix** *(dict) --* To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}. * **PartitionedPrefix** *(dict) --* Partitioned S3 key for log objects. * **PartitionDateSource** *(string) --* Specifies the partition date source for the partitioned prefix. "PartitionDateSource" can be "EventTime" or "DeliveryTime". For "DeliveryTime", the time in the log file names corresponds to the delivery time for the log files. For "EventTime", The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key. BucketLogging / Action / put put *** S3.BucketLogging.put(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters. All logs are saved to buckets in the same Amazon Web Services Region as the source bucket. To set the logging status of a bucket, you must be the bucket owner. The bucket owner is automatically granted FULL_CONTROL to all logs. You use the "Grantee" request element to grant access to other people. The "Permissions" request element specifies the kind of access the grantee has to the logs. Warning: If the target bucket for log delivery uses the bucket owner enforced setting for S3 Object Ownership, you can't use the "Grantee" request element to grant access to others. Permissions can only be granted using policies. For more information, see Permissions for server access log delivery in the *Amazon S3 User Guide*.Grantee Values You can specify the person (grantee) to whom you're assigning access rights (by using request elements) in the following ways. For examples of how to specify these grantee values in JSON format, see the Amazon Web Services CLI example in Enabling Amazon S3 server access logging in the *Amazon S3 User Guide*. * By the person's ID: "<>ID<><>GranteesEmail<> " "DisplayName" is optional and ignored in the request. * By Email address: "<>Grantees@email.com<>" The grantee is resolved to the "CanonicalUser" and, in a response to a "GETObjectAcl" request, appears as the CanonicalUser. * By URI: "<>http://acs.amazonaws.com/group s/global/AuthenticatedUsers<>" To enable logging, you use "LoggingEnabled" and its children request elements. To disable logging, you use an empty "BucketLoggingStatus" request element: "" For more information about server access logging, see Server Access Logging in the *Amazon S3 User Guide*. For more information about creating a bucket, see CreateBucket. For more information about returning the logging status of a bucket, see GetBucketLogging. The following operations are related to "PutBucketLogging": * PutObject * DeleteBucket * CreateBucket * GetBucketLogging See also: AWS API Documentation **Request Syntax** response = bucket_logging.put( BucketLoggingStatus={ 'LoggingEnabled': { 'TargetBucket': 'string', 'TargetGrants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE' }, ], 'TargetPrefix': 'string', 'TargetObjectKeyFormat': { 'SimplePrefix': {} , 'PartitionedPrefix': { 'PartitionDateSource': 'EventTime'|'DeliveryTime' } } } }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **BucketLoggingStatus** (*dict*) -- **[REQUIRED]** Container for logging status information. * **LoggingEnabled** *(dict) --* Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For more information, see PUT Bucket logging in the *Amazon S3 API Reference*. * **TargetBucket** *(string) --* **[REQUIRED]** 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** *(list) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions for server access log delivery in the *Amazon S3 User Guide*. * *(dict) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions server access log delivery in the *Amazon S3 User Guide*. * **Grantee** *(dict) --* Container for the person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Logging permissions assigned to the grantee for the bucket. * **TargetPrefix** *(string) --* **[REQUIRED]** A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. * **TargetObjectKeyFormat** *(dict) --* Amazon S3 key format for log objects. * **SimplePrefix** *(dict) --* To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}. * **PartitionedPrefix** *(dict) --* Partitioned S3 key for log objects. * **PartitionDateSource** *(string) --* Specifies the partition date source for the partitioned prefix. "PartitionDateSource" can be "EventTime" or "DeliveryTime". For "DeliveryTime", the time in the log file names corresponds to the delivery time for the log files. For "EventTime", The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketLogging / Action / load load **** S3.BucketLogging.load() Calls "S3.Client.get_bucket_logging()" to update the attributes of the BucketLogging resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_logging.load() Returns: None S3 / Resource / BucketLogging BucketLogging ************* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketLogging(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketLogging: import boto3 s3 = boto3.resource('s3') bucket_logging = s3.BucketLogging('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketLogging's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * logging_enabled Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketLogging / Identifier / bucket_name bucket_name *********** S3.BucketLogging.bucket_name *(string)* The BucketLogging's bucket_name identifier. This **must** be set. BucketLogging / Sub-Resource / Bucket Bucket ****** S3.BucketLogging.Bucket() Creates a Bucket resource.: bucket = bucket_logging.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketLogging / Action / reload reload ****** S3.BucketLogging.reload() Calls "S3.Client.get_bucket_logging()" to update the attributes of the BucketLogging resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_logging.reload() Returns: None BucketNotification / Attribute / lambda_function_configurations lambda_function_configurations ****************************** S3.BucketNotification.lambda_function_configurations * *(list) --* Describes the Lambda functions to invoke and the events for which to invoke them. * *(dict) --* A container for specifying the configuration for Lambda notifications. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **LambdaFunctionArn** *(string) --* The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes when the specified event type occurs. * **Events** *(list) --* The Amazon S3 bucket event for which to invoke the Lambda function. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. BucketNotification / Action / get_available_subresources get_available_subresources ************************** S3.BucketNotification.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketNotification / Action / put put *** S3.BucketNotification.put(**kwargs) Note: This operation is not supported for directory buckets. Enables notifications of specified events for a bucket. For more information about event notifications, see Configuring Event Notifications. Using this API, you can replace an existing notification configuration. The configuration is an XML file that defines the event types that you want Amazon S3 to publish and the destination where you want Amazon S3 to publish an event notification when it detects an event of the specified type. By default, your bucket has no event notifications configured. That is, the notification configuration will be an empty "NotificationConfiguration". "" "" This action replaces the existing notification configuration with the configuration you include in the request body. After Amazon S3 receives this request, it first verifies that any Amazon Simple Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon SQS) destination exists, and that the bucket owner has permission to publish to it by sending a test notification. In the case of Lambda destinations, Amazon S3 verifies that the Lambda function permissions grant Amazon S3 permission to invoke the function from the Amazon S3 bucket. For more information, see Configuring Notifications for Amazon S3 Events. You can disable notifications by adding the empty NotificationConfiguration element. For more information about the number of event notification configurations that you can create per bucket, see Amazon S3 service quotas in *Amazon Web Services General Reference*. By default, only the bucket owner can configure notifications on a bucket. However, bucket owners can use a bucket policy to grant permission to other users to set this configuration with the required "s3:PutBucketNotification" permission. Note: The PUT notification is an atomic operation. For example, suppose your notification configuration includes SNS topic, SQS queue, and Lambda function configurations. When you send a PUT request with this configuration, Amazon S3 sends test messages to your SNS topic. If the message fails, the entire PUT action will fail, and Amazon S3 will not add the configuration to your bucket. If the configuration in the request body includes only one "TopicConfiguration" specifying only the "s3:ReducedRedundancyLostObject" event type, the response will also include the "x-amz-sns-test-message-id" header containing the message ID of the test notification sent to the topic. The following action is related to "PutBucketNotificationConfiguration": * GetBucketNotificationConfiguration See also: AWS API Documentation **Request Syntax** response = bucket_notification.put( NotificationConfiguration={ 'TopicConfigurations': [ { 'Id': 'string', 'TopicArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'QueueConfigurations': [ { 'Id': 'string', 'QueueArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'LambdaFunctionConfigurations': [ { 'Id': 'string', 'LambdaFunctionArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'EventBridgeConfiguration': {} }, ExpectedBucketOwner='string', SkipDestinationValidation=True|False ) Parameters: * **NotificationConfiguration** (*dict*) -- **[REQUIRED]** A container for specifying the notification configuration of the bucket. If this element is empty, notifications are turned off for the bucket. * **TopicConfigurations** *(list) --* The topic to which notifications are sent and the events for which notifications are generated. * *(dict) --* A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **TopicArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* **[REQUIRED]** The Amazon S3 bucket event about which to send notifications. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **QueueConfigurations** *(list) --* The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. * *(dict) --* Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **QueueArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* **[REQUIRED]** A collection of bucket events for which to send notifications * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **LambdaFunctionConfigurations** *(list) --* Describes the Lambda functions to invoke and the events for which to invoke them. * *(dict) --* A container for specifying the configuration for Lambda notifications. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **LambdaFunctionArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes when the specified event type occurs. * **Events** *(list) --* **[REQUIRED]** The Amazon S3 bucket event for which to invoke the Lambda function. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **EventBridgeConfiguration** *(dict) --* Enables delivery of events to Amazon EventBridge. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **SkipDestinationValidation** (*boolean*) -- Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or false value. Returns: None BucketNotification / Action / load load **** S3.BucketNotification.load() Calls "S3.Client.get_bucket_notification_configuration()" to update the attributes of the BucketNotification resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_notification.load() Returns: None S3 / Resource / BucketNotification BucketNotification ****************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketNotification(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketNotification: import boto3 s3 = boto3.resource('s3') bucket_notification = s3.BucketNotification('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketNotification's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * event_bridge_configuration * lambda_function_configurations * queue_configurations * topic_configurations Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketNotification / Identifier / bucket_name bucket_name *********** S3.BucketNotification.bucket_name *(string)* The BucketNotification's bucket_name identifier. This **must** be set. BucketNotification / Attribute / topic_configurations topic_configurations ******************** S3.BucketNotification.topic_configurations * *(list) --* The topic to which notifications are sent and the events for which notifications are generated. * *(dict) --* A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **TopicArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* The Amazon S3 bucket event about which to send notifications. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. BucketNotification / Attribute / event_bridge_configuration event_bridge_configuration ************************** S3.BucketNotification.event_bridge_configuration * *(dict) --* Enables delivery of events to Amazon EventBridge. BucketNotification / Sub-Resource / Bucket Bucket ****** S3.BucketNotification.Bucket() Creates a Bucket resource.: bucket = bucket_notification.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketNotification / Action / reload reload ****** S3.BucketNotification.reload() Calls "S3.Client.get_bucket_notification_configuration()" to update the attributes of the BucketNotification resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_notification.reload() Returns: None BucketNotification / Attribute / queue_configurations queue_configurations ******************** S3.BucketNotification.queue_configurations * *(list) --* The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. * *(dict) --* Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **QueueArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* A collection of bucket events for which to send notifications * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. BucketVersioning / Action / get_available_subresources get_available_subresources ************************** S3.BucketVersioning.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketVersioning / Action / put put *** S3.BucketVersioning.put(**kwargs) Note: This operation is not supported for directory buckets. Note: When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. While this change is propagating, you might encounter intermittent "HTTP 404 NoSuchKey" errors for requests to objects created or updated after enabling versioning. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations ( "PUT" or "DELETE") on objects in the bucket. Sets the versioning state of an existing bucket. You can set the versioning state with one of the following values: **Enabled**—Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID. **Suspended**—Disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null. If the versioning state has never been set on a bucket, it has no versioning state; a GetBucketVersioning request does not return a versioning state value. In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner and want to enable MFA Delete in the bucket versioning configuration, you must include the "x-amz-mfa request" header and the "Status" and the "MfaDelete" request elements in a request to set the versioning state of the bucket. Warning: If you have an object expiration lifecycle configuration in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle configuration will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle and Versioning. The following operations are related to "PutBucketVersioning": * CreateBucket * DeleteBucket * GetBucketVersioning See also: AWS API Documentation **Request Syntax** response = bucket_versioning.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', MFA='string', VersioningConfiguration={ 'MFADelete': 'Enabled'|'Disabled', 'Status': 'Enabled'|'Suspended' }, ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. * **VersioningConfiguration** (*dict*) -- **[REQUIRED]** Container for setting the versioning state. * **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. * **Status** *(string) --* The versioning state of the bucket. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketVersioning / Action / suspend suspend ******* S3.BucketVersioning.suspend(**kwargs) Note: This operation is not supported for directory buckets. Note: When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. While this change is propagating, you might encounter intermittent "HTTP 404 NoSuchKey" errors for requests to objects created or updated after enabling versioning. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations ( "PUT" or "DELETE") on objects in the bucket. Sets the versioning state of an existing bucket. You can set the versioning state with one of the following values: **Enabled**—Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID. **Suspended**—Disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null. If the versioning state has never been set on a bucket, it has no versioning state; a GetBucketVersioning request does not return a versioning state value. In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner and want to enable MFA Delete in the bucket versioning configuration, you must include the "x-amz-mfa request" header and the "Status" and the "MfaDelete" request elements in a request to set the versioning state of the bucket. Warning: If you have an object expiration lifecycle configuration in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle configuration will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle and Versioning. The following operations are related to "PutBucketVersioning": * CreateBucket * DeleteBucket * GetBucketVersioning See also: AWS API Documentation **Request Syntax** response = bucket_versioning.suspend( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', MFA='string', ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketVersioning / Action / enable enable ****** S3.BucketVersioning.enable(**kwargs) Note: This operation is not supported for directory buckets. Note: When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. While this change is propagating, you might encounter intermittent "HTTP 404 NoSuchKey" errors for requests to objects created or updated after enabling versioning. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations ( "PUT" or "DELETE") on objects in the bucket. Sets the versioning state of an existing bucket. You can set the versioning state with one of the following values: **Enabled**—Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID. **Suspended**—Disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null. If the versioning state has never been set on a bucket, it has no versioning state; a GetBucketVersioning request does not return a versioning state value. In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner and want to enable MFA Delete in the bucket versioning configuration, you must include the "x-amz-mfa request" header and the "Status" and the "MfaDelete" request elements in a request to set the versioning state of the bucket. Warning: If you have an object expiration lifecycle configuration in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle configuration will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle and Versioning. The following operations are related to "PutBucketVersioning": * CreateBucket * DeleteBucket * GetBucketVersioning See also: AWS API Documentation **Request Syntax** response = bucket_versioning.enable( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', MFA='string', ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketVersioning / Action / load load **** S3.BucketVersioning.load() Calls "S3.Client.get_bucket_versioning()" to update the attributes of the BucketVersioning resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_versioning.load() Returns: None S3 / Resource / BucketVersioning BucketVersioning **************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketVersioning(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketVersioning: import boto3 s3 = boto3.resource('s3') bucket_versioning = s3.BucketVersioning('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketVersioning's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * mfa_delete * status Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * enable * get_available_subresources * load * put * reload * suspend Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketVersioning / Identifier / bucket_name bucket_name *********** S3.BucketVersioning.bucket_name *(string)* The BucketVersioning's bucket_name identifier. This **must** be set. BucketVersioning / Sub-Resource / Bucket Bucket ****** S3.BucketVersioning.Bucket() Creates a Bucket resource.: bucket = bucket_versioning.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketVersioning / Attribute / mfa_delete mfa_delete ********** S3.BucketVersioning.mfa_delete * *(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. BucketVersioning / Action / reload reload ****** S3.BucketVersioning.reload() Calls "S3.Client.get_bucket_versioning()" to update the attributes of the BucketVersioning resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_versioning.reload() Returns: None BucketVersioning / Attribute / status status ****** S3.BucketVersioning.status * *(string) --* The versioning state of the bucket. MultipartUploadPart / Attribute / checksum_crc32_c checksum_crc32_c **************** S3.MultipartUploadPart.checksum_crc32_c * *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the part. This checksum is present if the object was uploaded with the "CRC32C" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. MultipartUploadPart / Identifier / multipart_upload_id multipart_upload_id ******************* S3.MultipartUploadPart.multipart_upload_id *(string)* The MultipartUploadPart's multipart_upload_id identifier. This **must** be set. MultipartUploadPart / Action / get_available_subresources get_available_subresources ************************** S3.MultipartUploadPart.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str MultipartUploadPart / Attribute / checksum_crc32 checksum_crc32 ************** S3.MultipartUploadPart.checksum_crc32 * *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the part. This checksum is present if the object was uploaded with the "CRC32" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. MultipartUploadPart / Identifier / part_number part_number *********** S3.MultipartUploadPart.part_number *(string)* The MultipartUploadPart's part_number identifier. This **must** be set. MultipartUploadPart / Sub-Resource / MultipartUpload MultipartUpload *************** S3.MultipartUploadPart.MultipartUpload() Creates a MultipartUpload resource.: multipart_upload = multipart_upload_part.MultipartUpload() Return type: "S3.MultipartUpload" Returns: A MultipartUpload resource S3 / Resource / MultipartUploadPart MultipartUploadPart ******************* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.MultipartUploadPart(bucket_name, object_key, multipart_upload_id, part_number) A resource representing an Amazon Simple Storage Service (S3) MultipartUploadPart: import boto3 s3 = boto3.resource('s3') multipart_upload_part = s3.MultipartUploadPart('bucket_name','object_key','multipart_upload_id','part_number') Parameters: * **bucket_name** (*string*) -- The MultipartUploadPart's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The MultipartUploadPart's object_key identifier. This **must** be set. * **multipart_upload_id** (*string*) -- The MultipartUploadPart's multipart_upload_id identifier. This **must** be set. * **part_number** (*string*) -- The MultipartUploadPart's part_number identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name * object_key * multipart_upload_id * part_number Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * checksum_crc32 * checksum_crc32_c * checksum_crc64_nvme * checksum_sha1 * checksum_sha256 * e_tag * last_modified * size Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * copy_from * get_available_subresources * upload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * MultipartUpload MultipartUploadPart / Identifier / bucket_name bucket_name *********** S3.MultipartUploadPart.bucket_name *(string)* The MultipartUploadPart's bucket_name identifier. This **must** be set. MultipartUploadPart / Attribute / size size **** S3.MultipartUploadPart.size * *(integer) --* Size in bytes of the uploaded part data. MultipartUploadPart / Attribute / checksum_crc64_nvme checksum_crc64_nvme ******************* S3.MultipartUploadPart.checksum_crc64_nvme * *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. MultipartUploadPart / Attribute / checksum_sha1 checksum_sha1 ************* S3.MultipartUploadPart.checksum_sha1 * *(string) --* The Base64 encoded, 160-bit "SHA1" checksum of the part. This checksum is present if the object was uploaded with the "SHA1" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. MultipartUploadPart / Action / copy_from copy_from ********* S3.MultipartUploadPart.copy_from(**kwargs) Uploads a part by copying data from an existing object as data source. To specify the data source, you add the request header "x -amz-copy-source" in your request. To specify a byte range, you add the request header "x-amz-copy-source-range" in your request. For information about maximum and minimum part sizes and other multipart upload specifications, see Multipart upload limits in the *Amazon S3 User Guide*. Note: Instead of copying data from an existing object as part data, you might use the UploadPart action to upload new data as a part of an object in your request. You must initiate a multipart upload before you can upload any part. In response to your initiate request, Amazon S3 returns the upload ID, a unique identifier that you must include in your upload part request. For conceptual information about multipart uploads, see Uploading Objects Using Multipart Upload in the *Amazon S3 User Guide*. For information about copying objects using a single atomic action vs. a multipart upload, see Operations on Objects in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Authentication and authorization All "UploadPartCopy" requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the "x-amz-" prefix, including "x -amz-copy-source", must be signed. For more information, see REST Authentication. **Directory buckets** - You must use IAM credentials to authenticate and authorize your access to the "UploadPartCopy" API operation, instead of using the temporary security credentials through the "CreateSession" API operation. Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. Permissions You must have "READ" access to the source object and "WRITE" access to the destination bucket. * **General purpose bucket permissions** - You must have the permissions in a policy based on the bucket types of your source bucket and destination bucket in an "UploadPartCopy" operation. * If the source object is in a general purpose bucket, you must have the "s3:GetObject" permission to read the source object that is being copied. * If the destination bucket is a general purpose bucket, you must have the "s3:PutObject" permission to write the object copy to the destination bucket. * To perform a multipart upload with encryption using an Key Management Service key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 about KMS permissions, see Protecting data using server-side encryption with KMS in the *Amazon S3 User Guide*. For information about the permissions required to use the multipart upload API, see Multipart upload and permissions and Multipart upload API and permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - You must have permissions in a bucket policy or an IAM identity-based policy based on the source and destination bucket types in an "UploadPartCopy" operation. * If the source object that you want to copy is in a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to read the object. By default, the session is in the "ReadWrite" mode. If you want to restrict the access, you can explicitly set the "s3express:SessionMode" condition key to "ReadOnly" on the copy source bucket. * If the copy destination is a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to write the object to the destination. The "s3express:SessionMode" condition key cannot be set to "ReadOnly" on the copy destination. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. Encryption * **General purpose buckets** - For information about using server- side encryption with customer-provided encryption keys with the "UploadPartCopy" operation, see CopyObject and UploadPart. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. Note: For directory buckets, when you perform a "CreateMultipartUpload" operation and an "UploadPartCopy" operation, the request headers you provide in the "CreateMultipartUpload" request must match the default encryption configuration of the destination bucket. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through UploadPartCopy. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. Special errors * Error Code: "NoSuchUpload" * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * HTTP Status Code: 404 Not Found * Error Code: "InvalidRequest" * Description: The specified copy source is not supported as a byte-range copy source. * HTTP Status Code: 400 Bad Request HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "UploadPartCopy": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = multipart_upload_part.copy_from( CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}, CopySourceIfMatch='string', CopySourceIfModifiedSince=datetime(2015, 1, 1), CopySourceIfNoneMatch='string', CopySourceIfUnmodifiedSince=datetime(2015, 1, 1), CopySourceRange='string', SSECustomerAlgorithm='string', SSECustomerKey='string', CopySourceSSECustomerAlgorithm='string', CopySourceSSECustomerKey='string', RequestPayer='requester', ExpectedBucketOwner='string', ExpectedSourceBucketOwner='string' ) Parameters: * **CopySource** (*str** or **dict*) -- **[REQUIRED]** The name of the source bucket, key name of the source object, and optional version ID of the source object. You can either provide this value as a string or a dictionary. The string form is {bucket}/{key} or {bucket}/{key}?versionId={versionId} if you want to copy a specific version. You can also provide this value as a dictionary. The dictionary format is recommended over the string format because it is more explicit. The dictionary format is: {'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}. Note that the VersionId key is optional and may be omitted. To specify an S3 access point, provide the access point ARN for the "Bucket" key in the copy source dictionary. If you want to provide the copy source for an S3 access point as a string instead of a dictionary, the ARN provided must be the full S3 access point object ARN (i.e. {accesspoint_arn}/object/{key}) * **CopySourceIfMatch** (*string*) -- Copies the object if its entity tag (ETag) matches the specified tag. If both of the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request as follows: "x-amz-copy-source-if-match" condition evaluates to "true", and; "x-amz-copy-source-if-unmodified-since" condition evaluates to "false"; Amazon S3 returns "200 OK" and copies the data. * **CopySourceIfModifiedSince** (*datetime*) -- Copies the object if it has been modified since the specified time. If both of the "x-amz-copy-source-if-none-match" and "x-amz- copy-source-if-modified-since" headers are present in the request as follows: "x-amz-copy-source-if-none-match" condition evaluates to "false", and; "x-amz-copy-source-if-modified-since" condition evaluates to "true"; Amazon S3 returns "412 Precondition Failed" response code. * **CopySourceIfNoneMatch** (*string*) -- Copies the object if its entity tag (ETag) is different than the specified ETag. If both of the "x-amz-copy-source-if-none-match" and "x-amz- copy-source-if-modified-since" headers are present in the request as follows: "x-amz-copy-source-if-none-match" condition evaluates to "false", and; "x-amz-copy-source-if-modified-since" condition evaluates to "true"; Amazon S3 returns "412 Precondition Failed" response code. * **CopySourceIfUnmodifiedSince** (*datetime*) -- Copies the object if it hasn't been modified since the specified time. If both of the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request as follows: "x-amz-copy-source-if-match" condition evaluates to "true", and; "x-amz-copy-source-if-unmodified-since" condition evaluates to "false"; Amazon S3 returns "200 OK" and copies the data. * **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 10 bytes of the source. You can copy a range only if the source object is greater than 5 MB. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 S3 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. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the destination bucket is a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **CopySourceSSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the source object (for example, "AES256"). Note: This functionality is not supported when the source object is in a directory bucket. * **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. Note: This functionality is not supported when the source object is in a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the source object is in a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ExpectedSourceBucketOwner** (*string*) -- The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'CopySourceVersionId': 'string', 'CopyPartResult': { 'ETag': 'string', 'LastModified': datetime(2015, 1, 1), 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **CopySourceVersionId** *(string) --* The version of the source object that was copied, if you have enabled versioning on the source bucket. Note: This functionality is not supported when the source object is in a directory bucket. * **CopyPartResult** *(dict) --* Container for all response elements. * **ETag** *(string) --* Entity tag of the object. * **LastModified** *(datetime) --* Date and time at which the object was uploaded. * **ChecksumCRC32** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. MultipartUploadPart / Identifier / object_key object_key ********** S3.MultipartUploadPart.object_key *(string)* The MultipartUploadPart's object_key identifier. This **must** be set. MultipartUploadPart / Attribute / e_tag e_tag ***** S3.MultipartUploadPart.e_tag * *(string) --* Entity tag returned when the part was uploaded. MultipartUploadPart / Action / upload upload ****** S3.MultipartUploadPart.upload(**kwargs) Uploads a part in a multipart upload. Note: In this operation, you provide new data as a part of an object in your request. However, you have an option to specify your existing Amazon S3 object as a data source for the part you are uploading. To upload a part from an existing object, you use the UploadPartCopy operation. You must initiate a multipart upload (see CreateMultipartUpload) before you can upload any part. In response to your initiate request, Amazon S3 returns an upload ID, a unique identifier that you must include in your upload part request. Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being created. If you upload a new part using the same part number that was used with a previous part, the previously uploaded part is overwritten. For information about maximum and minimum part sizes and other multipart upload specifications, see Multipart upload limits in the *Amazon S3 User Guide*. 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. For more information on multipart uploads, go to Multipart Upload Overview in the >>*<>*<<. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - To perform a multipart upload with encryption using an Key Management Service key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 about KMS permissions, see Protecting data using server-side encryption with KMS in the *Amazon S3 User Guide*. For information about the permissions required to use the multipart upload API, see Multipart upload and permissions and Multipart upload API and permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Data integrity **General purpose bucket** - To ensure that data is not corrupted traversing the network, specify the "Content-MD5" header in the upload part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match, Amazon S3 returns an error. If the upload request is signed with Signature Version 4, then Amazon Web Services S3 uses the "x-amz-content-sha256" header as a checksum instead of "Content-MD5". For more information see Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4). Note: **Directory buckets** - MD5 is not supported by directory buckets. You can use checksum algorithms to check object integrity.Encryption * **General purpose bucket** - Server-side encryption is for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts it when you access it. You have mutually exclusive options to protect data using server- side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest using server-side encryption with other key options. The option you use depends on whether you want to use KMS keys (SSE-KMS) or provide your own encryption key (SSE-C). Server-side encryption is supported by the S3 Multipart Upload operations. Unless you are using a customer-provided encryption key (SSE-C), you don't need to specify the encryption parameters in each UploadPart request. Instead, you only need to specify the server-side encryption parameters in the initial Initiate Multipart request. For more information, see CreateMultipartUpload. If you request server-side encryption using a customer-provided encryption key (SSE-C) in your initiate multipart upload request, you must provide identical encryption information in each part upload using the following request headers. * x-amz-server-side-encryption-customer-algorithm * x-amz-server-side-encryption-customer-key * x-amz-server-side-encryption-customer-key-MD5 For more information, see Using Server-Side Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). Special errors * Error Code: "NoSuchUpload" * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * HTTP Status Code: 404 Not Found * SOAP Fault Code Prefix: Client HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "UploadPart": * CreateMultipartUpload * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = multipart_upload_part.upload( Body=b'bytes'|file, ContentLength=123, ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', ExpectedBucketOwner='string' ) Parameters: * **Body** (*bytes** or **seekable file-like object*) -- Object data. * **ContentLength** (*integer*) -- Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. * **ContentMD5** (*string*) -- The Base64 encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command from the CLI. This parameter is required if object lock parameters are specified. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. This checksum algorithm must be the same for all parts and it match the checksum value supplied in the "CreateMultipartUpload" request. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **ETag** *(string) --* Entity tag for the uploaded object. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. MultipartUploadPart / Attribute / checksum_sha256 checksum_sha256 *************** S3.MultipartUploadPart.checksum_sha256 * *(string) --* The Base64 encoded, 256-bit "SHA256" checksum of the part. This checksum is present if the object was uploaded with the "SHA256" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. MultipartUploadPart / Attribute / last_modified last_modified ************* S3.MultipartUploadPart.last_modified * *(datetime) --* Date and time at which the part was uploaded. ObjectSummary / Attribute / restore_status restore_status ************** S3.ObjectSummary.restore_status * *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" ObjectSummary / Action / restore_object restore_object ************** S3.ObjectSummary.restore_object(**kwargs) Note: This operation is not supported for directory buckets. Restores an archived copy of an object back into Amazon S3 This functionality is not supported for Amazon S3 on Outposts. This action performs the following types of requests: * "restore an archive" - Restore an archived object For more information about the "S3" structure in the request body, see the following: * PutObject * Managing Access with ACLs in the *Amazon S3 User Guide* * Protecting Data Using Server-Side Encryption in the *Amazon S3 User Guide* Permissions To use this operation, you must have permissions to perform the "s3:RestoreObject" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources in the *Amazon S3 User Guide*. Restoring objects Objects that you archive to the S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive storage class, and S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep Archive tiers, are not accessible in real time. For objects in the S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive storage classes, you must first initiate a restore request, and then wait until a temporary copy of the object is available. If you want a permanent copy of the object, create a copy of it in the Amazon S3 Standard storage class in your S3 bucket. To access an archived object, you must restore the object for the duration (number of days) that you specify. For objects in the Archive Access or Deep Archive Access tiers of S3 Intelligent-Tiering, you must first initiate a restore request, and then wait until the object is moved into the Frequent Access tier. To restore a specific object version, you can provide a version ID. If you don't provide a version ID, Amazon S3 restores the current version. When restoring an archived object, you can specify one of the following data access tier options in the "Tier" element of the request body: * "Expedited" - Expedited retrievals allow you to quickly access your data stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier when occasional urgent requests for restoring archives are required. For all but the largest archived objects (250 MB+), data accessed using Expedited retrievals is typically made available within 1–5 minutes. Provisioned capacity ensures that retrieval capacity for Expedited retrievals is available when you need it. Expedited retrievals and provisioned capacity are not available for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. * "Standard" - Standard retrievals allow you to access any of your archived objects within several hours. This is the default option for retrieval requests that do not specify the retrieval option. Standard retrievals typically finish within 3–5 hours for objects stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. They typically finish within 12 hours for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. Standard retrievals are free for objects stored in S3 Intelligent-Tiering. * "Bulk" - Bulk retrievals free for objects stored in the S3 Glacier Flexible Retrieval and S3 Intelligent-Tiering storage classes, enabling you to retrieve large amounts, even petabytes, of data at no cost. Bulk retrievals typically finish within 5–12 hours for objects stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. Bulk retrievals are also the lowest-cost retrieval option when restoring objects from S3 Glacier Deep Archive. They typically finish within 48 hours for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. For more information about archive retrieval options and provisioned capacity for "Expedited" data access, see Restoring Archived Objects in the *Amazon S3 User Guide*. You can use Amazon S3 restore speed upgrade to change the restore speed to a faster speed while it is in progress. For more information, see Upgrading the speed of an in-progress restore in the *Amazon S3 User Guide*. To get the status of object restoration, you can send a "HEAD" request. Operations return the "x-amz-restore" header, which provides information about the restoration status, in the response. You can use Amazon S3 event notifications to notify you when a restore is initiated or completed. For more information, see Configuring Amazon S3 Event Notifications in the *Amazon S3 User Guide*. After restoring an archived object, you can update the restoration period by reissuing the request with a new period. Amazon S3 updates the restoration period relative to the current time and charges only for the request-there are no data transfer charges. You cannot update the restoration period when Amazon S3 is actively processing your current restore request for the object. If your bucket has a lifecycle configuration with a rule that includes an expiration action, the object expiration overrides the life span that you specify in a restore request. For example, if you restore an object copy for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the object in 3 days. For more information about lifecycle configuration, see PutBucketLifecycleConfiguration and Object Lifecycle Management in *Amazon S3 User Guide*. Responses A successful action returns either the "200 OK" or "202 Accepted" status code. * If the object is not previously restored, then Amazon S3 returns "202 Accepted" in the response. * If the object is previously restored, Amazon S3 returns "200 OK" in the response. * Special errors: * *Code: RestoreAlreadyInProgress* * *Cause: Object restore is already in progress.* * *HTTP Status Code: 409 Conflict* * *SOAP Fault Code Prefix: Client* * * *Code: GlacierExpeditedRetrievalNotAvailable* * *Cause: expedited retrievals are currently not available. Try again later. (Returned if there is insufficient capacity to process the Expedited request. This error applies only to Expedited retrievals and not to S3 Standard or Bulk retrievals.)* * *HTTP Status Code: 503* * *SOAP Fault Code Prefix: N/A* The following operations are related to "RestoreObject": * PutBucketLifecycleConfiguration * GetBucketNotificationConfiguration See also: AWS API Documentation **Request Syntax** response = object_summary.restore_object( VersionId='string', RestoreRequest={ 'Days': 123, 'GlacierJobParameters': { 'Tier': 'Standard'|'Bulk'|'Expedited' }, 'Type': 'SELECT', 'Tier': 'Standard'|'Bulk'|'Expedited', 'Description': 'string', 'SelectParameters': { 'InputSerialization': { 'CSV': { 'FileHeaderInfo': 'USE'|'IGNORE'|'NONE', 'Comments': 'string', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string', 'AllowQuotedRecordDelimiter': True|False }, 'CompressionType': 'NONE'|'GZIP'|'BZIP2', 'JSON': { 'Type': 'DOCUMENT'|'LINES' }, 'Parquet': {} }, 'ExpressionType': 'SQL', 'Expression': 'string', 'OutputSerialization': { 'CSV': { 'QuoteFields': 'ALWAYS'|'ASNEEDED', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string' }, 'JSON': { 'RecordDelimiter': 'string' } } }, 'OutputLocation': { 'S3': { 'BucketName': 'string', 'Prefix': 'string', 'Encryption': { 'EncryptionType': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'KMSKeyId': 'string', 'KMSContext': 'string' }, 'CannedACL': 'private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', 'AccessControlList': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Tagging': { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, 'UserMetadata': [ { 'Name': 'string', 'Value': 'string' }, ], 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS' } } }, RequestPayer='requester', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **VersionId** (*string*) -- VersionId used to reference a specific version of the object. * **RestoreRequest** (*dict*) -- Container for restore job parameters. * **Days** *(integer) --* Lifetime of the active copy in days. Do not use with restores that specify "OutputLocation". The Days element is required for regular restores, and must not be provided for select requests. * **GlacierJobParameters** *(dict) --* S3 Glacier related parameters pertaining to this job. Do not use with restores that specify "OutputLocation". * **Tier** *(string) --* **[REQUIRED]** Retrieval tier at which the restore will be processed. * **Type** *(string) --* Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more Type of restore request. * **Tier** *(string) --* Retrieval tier at which the restore will be processed. * **Description** *(string) --* The optional description for the job. * **SelectParameters** *(dict) --* Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more Describes the parameters for Select job types. * **InputSerialization** *(dict) --* **[REQUIRED]** Describes the serialization format of the object. * **CSV** *(dict) --* Describes the serialization of a CSV-encoded object. * **FileHeaderInfo** *(string) --* Describes the first line of input. Valid values are: * "NONE": First line is not a header. * "IGNORE": First line is a header, but you can't use the header values to indicate the column in an expression. You can use column position (such as _1, _2, …) to indicate the column ( "SELECT s._1 FROM OBJECT s"). * "Use": First line is a header, and you can use the header value to identify a column in an expression ( "SELECT "name" FROM OBJECT"). * **Comments** *(string) --* A single character used to indicate that a row should be ignored when the character is present at the start of that row. You can specify any character to indicate a comment line. The default character is "#". Default: "#" * **QuoteEscapeCharacter** *(string) --* A single character used for escaping the quotation mark character inside an already escaped value. For example, the value """" a , b """" is parsed as "" a , b "". * **RecordDelimiter** *(string) --* A single character used to separate individual records in the input. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* A single character used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". Type: String Default: """ Ancestors: "CSV" * **AllowQuotedRecordDelimiter** *(boolean) --* Specifies that CSV field values may contain quoted record delimiters and such records should be allowed. Default value is FALSE. Setting this value to TRUE may lower performance. * **CompressionType** *(string) --* Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default Value: NONE. * **JSON** *(dict) --* Specifies JSON as object's input serialization format. * **Type** *(string) --* The type of JSON. Valid values: Document, Lines. * **Parquet** *(dict) --* Specifies Parquet as object's input serialization format. * **ExpressionType** *(string) --* **[REQUIRED]** The type of the provided expression (for example, SQL). * **Expression** *(string) --* **[REQUIRED]** Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more The expression that is used to query the object. * **OutputSerialization** *(dict) --* **[REQUIRED]** Describes how the results of the Select job are serialized. * **CSV** *(dict) --* Describes the serialization of CSV-encoded Select results. * **QuoteFields** *(string) --* Indicates whether to use quotation marks around output fields. * "ALWAYS": Always use quotation marks for output fields. * "ASNEEDED": Use quotation marks for output fields when needed. * **QuoteEscapeCharacter** *(string) --* The single character used for escaping the quote character inside an already escaped value. * **RecordDelimiter** *(string) --* A single character used to separate individual records in the output. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* The value used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". * **JSON** *(dict) --* Specifies JSON as request's output serialization format. * **RecordDelimiter** *(string) --* The value used to separate individual records in the output. If no value is specified, Amazon S3 uses a newline character ('n'). * **OutputLocation** *(dict) --* Describes the location where the restore job's output is stored. * **S3** *(dict) --* Describes an S3 location that will receive the results of the restore request. * **BucketName** *(string) --* **[REQUIRED]** The name of the bucket where the restore results will be placed. * **Prefix** *(string) --* **[REQUIRED]** The prefix that is prepended to the restore results for this request. * **Encryption** *(dict) --* Contains the type of server-side encryption used. * **EncryptionType** *(string) --* **[REQUIRED]** The server-side encryption algorithm used when storing job results in Amazon S3 (for example, AES256, "aws:kms"). * **KMSKeyId** *(string) --* If the encryption type is "aws:kms", this optional value specifies the ID of the symmetric encryption customer managed key to use for encryption of job results. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in KMS in the *Amazon Web Services Key Management Service Developer Guide*. * **KMSContext** *(string) --* If the encryption type is "aws:kms", this optional value can be used to specify the encryption context for the restore results. * **CannedACL** *(string) --* The canned ACL to apply to the restore results. * **AccessControlList** *(list) --* A list of grants that control access to the staged results. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Tagging** *(dict) --* The tag-set that is applied to the restore results. * **TagSet** *(list) --* **[REQUIRED]** A collection for a set of tags * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **UserMetadata** *(list) --* A list of metadata to store with the restore results in S3. * *(dict) --* A metadata key-value pair to store with an object. * **Name** *(string) --* Name of the object. * **Value** *(string) --* Value of the object. * **StorageClass** *(string) --* The class of storage used to store the restore results. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester', 'RestoreOutputPath': 'string' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **RestoreOutputPath** *(string) --* Indicates the path in the provided S3 output location where Select results will be restored to. ObjectSummary / Action / get_available_subresources get_available_subresources ************************** S3.ObjectSummary.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str ObjectSummary / Action / put put *** S3.ObjectSummary.put(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Adds an object to a bucket. Note: * Amazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the entire object to the bucket. You cannot use "PutObject" to only update a single piece of metadata for an existing object. You must put the entire object with updated metadata if you want to update some values. * If your bucket uses the bucket owner enforced setting for Object Ownership, ACLs are disabled and no longer affect permissions. All objects written to the bucket by any account will be owned by the bucket owner. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Amazon S3 is a distributed system. If it receives multiple write requests for the same object simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior: * **S3 Object Lock** - To prevent objects from being deleted or overwritten, you can use Amazon S3 Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **If-None-Match** - Uploads the object only if the object key name does not already exist in the specified bucket. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload, S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure, retry the upload. Expects the * character (asterisk). For more information, see Add preconditions to S3 operations with conditional requests in the *Amazon S3 User Guide* or RFC 7232. Note: This functionality is not supported for S3 on Outposts. * **S3 Versioning** - When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all versions of the objects. For each write request that is made to the same object, Amazon S3 automatically generates a unique version ID of that object being stored in Amazon S3. You can retrieve, replace, or delete any version of the object. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "PutObject" request includes specific headers. * "s3:PutObject" - To successfully complete the "PutObject" request, you must always have the "s3:PutObject" permission on a bucket to add an object to it. * "s3:PutObjectAcl" - To successfully change the objects ACL of your "PutObject" request, you must have the "s3:PutObjectAcl". * "s3:PutObjectTagging" - To successfully set the tag-set with your "PutObject" request, you must have the "s3:PutObjectTagging". * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Data integrity with Content-MD5 * **General purpose bucket** - To ensure that data is not corrupted traversing the network, use the "Content-MD5" header. When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 digest, you can calculate the MD5 while putting the object to Amazon S3 and compare the returned ETag to the calculated MD5 value. * **Directory bucket** - This functionality is not supported for directory buckets. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". For more information about related Amazon S3 APIs, see the following: * CopyObject * DeleteObject See also: AWS API Documentation **Request Syntax** response = object_summary.put( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Body=b'bytes'|file, CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentLength=123, ContentMD5='string', ContentType='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', Expires=datetime(2015, 1, 1), IfMatch='string', IfNoneMatch='string', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', WriteOffsetBytes=123, Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. For more information, see Canned ACL in the *Amazon S3 User Guide*. When adding a new object, you can use headers to grant ACL- based 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. By default, all objects are private. Only the owner has full access control. For more information, see Access Control List (ACL) Overview and Managing ACLs Using the REST API in the *Amazon S3 User Guide*. If the bucket that you're uploading 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. PUT requests that contain other ACLs (for example, custom grants to certain Amazon Web Services accounts) fail and return a "400" error with the error code "AccessControlListNotSupported". For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Body** (*bytes** or **seekable file-like object*) -- Object data. * **CacheControl** (*string*) -- Can be used to specify caching behavior along the request/reply chain. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#se c14.9. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. For more information, see https://www.rfc-editor.org/rfc/rfc6266#section-4. * **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. For more information, see https://www.rfc- editor.org/rfc/rfc9110.html#field.content-encoding. * **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. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content- length. * **ContentMD5** (*string*) -- The Base64 encoded 128-bit "MD5" digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ContentType** (*string*) -- A standard MIME type describing the format of the contents. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3. * **IfMatch** (*string*) -- Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should fetch the object's ETag and retry the upload. Expects the ETag value as a string. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **IfNoneMatch** (*string*) -- Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should retry the upload. Expects the '*' (asterisk) character. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **GrantFullControl** (*string*) -- Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **WriteOffsetBytes** (*integer*) -- Specifies the offset for appending data to existing objects in bytes. The offset must be equal to the size of the existing object being appended to. If no object exists, setting this header to 0 will create a new object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm that was used when you store this object in Amazon S3 or Amazon FSx. * **General purpose buckets** - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer- provided keys (SSE-C). Amazon S3 encrypts data with server- side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. For information about object metadata, see Object Key and Metadata in the *Amazon S3 User Guide*. In the following example, the request header sets the redirect to an object (anotherPage.html) in the same bucket: "x-amz-website-redirect-location: /anotherPage.html" In the following example, the request header sets the object redirect to another website: "x-amz-website-redirect-location: http://www.example.com/" For more information about website hosting in Amazon S3, see Hosting Websites on Amazon S3 and How to Configure Website Page Redirects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key- value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. **General purpose buckets** - This value must be explicitly added during "CopyObject" operations if you want an additional encryption context for your object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want this object's Object Lock to expire. Must be formatted as a timestamp parameter. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Expiration': 'string', 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'VersionId': 'string', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'Size': 123, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Expiration** *(string) --* If the expiration is configured for the object (see PutBucketLifecycleConfiguration) in the *Amazon S3 User Guide*, the response includes this header. It includes the "expiry-date" and "rule-id" key-value pairs that provide information about object expiration. The value of the "rule- id" is URL-encoded. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **ETag** *(string) --* Entity tag for the uploaded object. **General purpose buckets** - To ensure that data is not corrupted traversing the network, for objects where the ETag is the MD5 digest of the object, you can calculate the MD5 while putting an object to Amazon S3 and compare the returned ETag to the calculated MD5 value. **Directory buckets** - The ETag for the object in a directory bucket isn't the MD5 digest of the object. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This header is present if the object was uploaded with the "CRC64NVME" checksum algorithm, or if it was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* This header specifies the checksum type of the object, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. For "PutObject" uploads, the checksum type is always "FULL_OBJECT". You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum that was specified. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **VersionId** *(string) --* Version ID of the object. If you enable versioning for a bucket, Amazon S3 automatically generates a unique version ID for the object being stored. Amazon S3 returns this ID in the response. When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of the objects. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. * **BucketKeyEnabled** *(boolean) --* Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **Size** *(integer) --* The size of the object in bytes. This value is only be present if you append to an object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. ObjectSummary / Attribute / storage_class storage_class ************* S3.ObjectSummary.storage_class * *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. ObjectSummary / Waiter / wait_until_exists wait_until_exists ***************** S3.ObjectSummary.wait_until_exists(**kwargs) Waits until this ObjectSummary is exists. This method calls "S3.Waiter.object_exists.wait()" which polls "S3.Client.head_object()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** object_summary.wait_until_exists( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Returns: None ObjectSummary / Attribute / owner owner ***** S3.ObjectSummary.owner * *(dict) --* The owner of the object Note: **Directory buckets** - The bucket owner is returned as the object owner. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. ObjectSummary / Attribute / checksum_type checksum_type ************* S3.ObjectSummary.checksum_type * *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. ObjectSummary / Action / load load **** S3.ObjectSummary.load(*args, **kwargs) Calls s3.Client.head_object to update the attributes of the ObjectSummary resource. ObjectSummary / Sub-Resource / MultipartUpload MultipartUpload *************** S3.ObjectSummary.MultipartUpload(id) Creates a MultipartUpload resource.: multipart_upload = object_summary.MultipartUpload('id') Parameters: **id** (*string*) -- The MultipartUpload's id identifier. This **must** be set. Return type: "S3.MultipartUpload" Returns: A MultipartUpload resource S3 / Resource / ObjectSummary ObjectSummary ************* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.ObjectSummary(bucket_name, key) A resource representing an Amazon Simple Storage Service (S3) ObjectSummary: import boto3 s3 = boto3.resource('s3') object_summary = s3.ObjectSummary('bucket_name','key') Parameters: * **bucket_name** (*string*) -- The ObjectSummary's bucket_name identifier. This **must** be set. * **key** (*string*) -- The ObjectSummary's key identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name * key Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * checksum_algorithm * checksum_type * e_tag * last_modified * owner * restore_status * size * storage_class Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * copy_from * delete * get * get_available_subresources * initiate_multipart_upload * load * put * restore_object Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Acl * Bucket * MultipartUpload * Object * Version Waiters ======= Waiters provide an interface to wait for a resource to reach a specific state. For more information about waiters refer to the Resources Introduction Guide. These are the resource's available waiters: * wait_until_exists * wait_until_not_exists ObjectSummary / Identifier / bucket_name bucket_name *********** S3.ObjectSummary.bucket_name *(string)* The ObjectSummary's bucket_name identifier. This **must** be set. ObjectSummary / Waiter / wait_until_not_exists wait_until_not_exists ********************* S3.ObjectSummary.wait_until_not_exists(**kwargs) Waits until this ObjectSummary is not exists. This method calls "S3.Waiter.object_not_exists.wait()" which polls "S3.Client.head_object()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** object_summary.wait_until_not_exists( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Returns: None ObjectSummary / Attribute / size size **** S3.ObjectSummary.size * *(integer) --* Size in bytes of the object ObjectSummary / Action / get get *** S3.ObjectSummary.get(**kwargs) Retrieves an object from Amazon S3. In the "GetObject" request, specify the full key name for the object. **General purpose buckets** - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg", specify the object key name as "/photos/2006/February/sample.jpg". For a path-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "examplebucket", specify the object key name as "/examplebucket/photos/2006/February/sample.jpg". For more information about request types, see HTTP Host Header Bucket Specification in the *Amazon S3 User Guide*. **Directory buckets** - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "amzn-s3-demo-bucket--usw2-az1--x-s3", specify the object key name as "/photos/2006/February/sample.jpg". Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - You must have the required permissions in a policy. To use "GetObject", you must have the "READ" access to the object (or version). If you grant "READ" access to the anonymous user, the "GetObject" operation returns the object without using an authorization header. For more information, see Specifying permissions in a policy in the *Amazon S3 User Guide*. If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. If the object that you request doesn’t exist, the error that Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" error. * If you don’t have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Access Denied" error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted using SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Storage classes If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a copy using RestoreObject. Otherwise, this operation returns an "InvalidObjectState" error. For information about restoring archived objects, see Restoring Archived Objects in the *Amazon S3 User Guide*. **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". Encryption Encryption request headers, like "x-amz-server-side-encryption", should not be sent for the "GetObject" requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your "GetObject" requests for the object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. Overriding response header values through the request There are times when you want to override certain response header values of a "GetObject" response. For example, you might override the "Content-Disposition" response header value through your "GetObject" request. You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code "200 OK" is returned. The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. The response headers that you can override for the "GetObject" response are "Cache-Control", "Content-Disposition", "Content- Encoding", "Content-Language", "Content-Type", and "Expires". To override values for a set of response headers in the "GetObject" response, you can use the following query parameters in the request. * "response-cache-control" * "response-content-disposition" * "response-content-encoding" * "response-content-language" * "response-content-type" * "response-expires" Note: When you use these parameters, you must sign the request by using either an Authorization header or a presigned URL. These parameters cannot be used with an unsigned (anonymous) request.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "GetObject": * ListBuckets * GetObjectAcl See also: AWS API Documentation **Request Syntax** response = object_summary.get( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified in this header; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" status code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified in this header; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" HTTP status code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- Downloads the specified byte range of an object. For more information about the HTTP Range header, see https://www.rfc- editor.org/rfc/rfc9110.html#name-range. Note: Amazon S3 doesn't support retrieving multiple ranges of data per "GET" request. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. By default, the "GetObject" operation returns the current version of an object. To return a different version, use the "versionId" subresource. Note: * If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. * If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. For more information about versioning, see PutBucketVersioning. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the object (for example, "AES256"). If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- Specifies the customer-provided encryption key that you originally provided for Amazon S3 to encrypt the data before storing it. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the "x-amz-server-side-encryption-customer- algorithm" header. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. Useful for downloading just a part of an object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this mode must be enabled. Return type: dict Returns: **Response Syntax** { 'Body': StreamingBody(), 'DeleteMarker': True|False, 'AcceptRanges': 'string', 'Expiration': 'string', 'Restore': 'string', 'LastModified': datetime(2015, 1, 1), 'ContentLength': 123, 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'MissingMeta': 123, 'VersionId': 'string', 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'ContentRange': 'string', 'ContentType': 'string', 'Expires': datetime(2015, 1, 1), 'ExpiresString': 'string', 'WebsiteRedirectLocation': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'Metadata': { 'string': 'string' }, 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', 'PartsCount': 123, 'TagCount': 123, 'ObjectLockMode': 'GOVERNANCE'|'COMPLIANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'ObjectLockLegalHoldStatus': 'ON'|'OFF' } **Response Structure** * *(dict) --* * **Body** ("StreamingBody") -- Object data. * **DeleteMarker** *(boolean) --* Indicates whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response. Note: * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes "x-amz-delete-marker: true" in the response. * If the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **AcceptRanges** *(string) --* Indicates that a range of bytes was specified in the request. * **Expiration** *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **Restore** *(string) --* Provides information about object restoration action and expiration time of the restored object copy. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **LastModified** *(datetime) --* Date and time when the object was last modified. **General purpose buckets** - When you specify a "versionId" of the object in your request, if the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **ContentLength** *(integer) --* Size of the body in bytes. * **ETag** *(string) --* An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in the "CreateMultipartUpload" request. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **MissingMeta** *(integer) --* This is set to the number of metadata entries not returned in the headers that are prefixed with "x-amz-meta-". 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. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. * **CacheControl** *(string) --* Specifies caching behavior along the request/reply chain. * **ContentDisposition** *(string) --* Specifies presentational information for the object. * **ContentEncoding** *(string) --* Indicates 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. * **ContentRange** *(string) --* The portion of the object returned in the response. * **ContentType** *(string) --* A standard MIME type describing the format of the object data. * **Expires** *(datetime) --* The date and time at which the object is no longer cacheable. Note: This member has been deprecated. Please use "ExpiresString" instead. * **ExpiresString** *(string) --* The raw, unparsed value of the "Expires" field. * **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. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **Metadata** *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **StorageClass** *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ReplicationStatus** *(string) --* Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule. Note: This functionality is not supported for directory buckets. * **PartsCount** *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. * **TagCount** *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** *(string) --* The Object Lock mode that's currently in place for this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date and time when this object's Object Lock will expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** *(string) --* Indicates whether this object has an active legal hold. This field is only returned if you have permission to view an object's legal hold status. Note: This functionality is not supported for directory buckets. ObjectSummary / Identifier / key key *** S3.ObjectSummary.key *(string)* The ObjectSummary's key identifier. This **must** be set. ObjectSummary / Sub-Resource / Bucket Bucket ****** S3.ObjectSummary.Bucket() Creates a Bucket resource.: bucket = object_summary.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource ObjectSummary / Attribute / checksum_algorithm checksum_algorithm ****************** S3.ObjectSummary.checksum_algorithm * *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* ObjectSummary / Action / initiate_multipart_upload initiate_multipart_upload ************************* S3.ObjectSummary.initiate_multipart_upload(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. 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 UploadPart). You also include this upload ID in the final request to either complete or abort the multipart upload request. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. Note: 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 stops charging you for storing them only after you either complete or abort a multipart upload. If you have configured a lifecycle rule to abort incomplete multipart uploads, the created multipart upload must be completed 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 Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration. Note: * **Directory buckets** - S3 Lifecycle is not supported by directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Request signing 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 Authenticating Requests (Amazon Web Services Signature Version 4) in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - To perform a multipart upload with encryption using an Key Management Service (KMS) KMS key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 Multipart upload API and permissions and Protecting data using server-side encryption with Amazon Web Services KMS in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Encryption * **General purpose buckets** - Server-side encryption is for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts it when you access it. Amazon S3 automatically encrypts all new objects that are uploaded to an S3 bucket. When doing a multipart upload, if you don't specify encryption information in your request, the encryption setting of the uploaded parts is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with an Key Management Service (KMS) key (SSE-KMS), or a customer-provided encryption key (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer- provided key to encrypt the uploaded parts. When you perform a CreateMultipartUpload operation, if you want to use a different type of encryption setting for the uploaded parts, you can request that Amazon S3 encrypts the object with a different encryption key (such as an Amazon S3 managed key, a KMS key, or a customer-provided key). When the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. If you choose to provide your own encryption key, the request headers you provide in UploadPart and UploadPartCopy requests must match the headers you used in the "CreateMultipartUpload" request. * Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key ( "aws/s3") and KMS customer managed keys stored in Key Management Service (KMS) – If you want Amazon Web Services to manage the keys used to encrypt data, specify the following headers in the request. * "x-amz-server-side-encryption" * "x-amz-server-side-encryption-aws-kms-key-id" * "x-amz-server-side-encryption-context" Note: * If you specify "x-amz-server-side-encryption:aws:kms", but don't provide "x-amz-server-side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3" key) in KMS to protect the data. * To perform a multipart upload with encryption by using an Amazon Web Services KMS key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey*" 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 Multipart upload API and permissions and Protecting data using server-side encryption with Amazon Web Services KMS in the *Amazon S3 User Guide*. * 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 is in a different account from the key, then you must have the permissions on both the key policy and your IAM user or role. * All "GET" and "PUT" requests for an object protected by KMS fail if you don't make them by using Secure Sockets Layer (SSL), Transport Layer Security (TLS), or Signature Version 4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the *Amazon S3 User Guide*. For more information about server-side encryption with KMS keys (SSE-KMS), see Protecting Data Using Server-Side Encryption with KMS keys in the *Amazon S3 User Guide*. * Use customer-provided encryption keys (SSE-C) – If you want to manage your own encryption keys, provide all the following headers in the request. * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about server-side encryption with customer- provided encryption keys (SSE-C), see Protecting data using server-side encryption with customer-provided encryption keys (SSE-C) in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz- server-side-encryption", "x-amz-server-side-encryption-aws-kms- key-id", "x-amz-server-side-encryption-context", and "x-amz- server-side-encryption-bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. Note: For directory buckets, when you perform a "CreateMultipartUpload" operation and an "UploadPartCopy" operation, the request headers you provide in the "CreateMultipartUpload" request must match the default encryption configuration of the destination bucket.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "CreateMultipartUpload": * UploadPart * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** multipart_upload = object_summary.initiate_multipart_upload( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentType='string', Expires=datetime(2015, 1, 1), GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumType='COMPOSITE'|'FULL_OBJECT' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. Amazon S3 supports a set of predefined ACLs, known as *canned ACLs*. Each canned ACL has a predefined set of grantees and permissions. For more information, see Canned ACL in the *Amazon S3 User Guide*. By default, all objects are private. Only the owner has full access control. When uploading an object, you can grant access permissions to individual Amazon Web Services accounts or to predefined groups defined by Amazon S3. These permissions are then added to the access control list (ACL) on the new object. For more information, see Using ACLs. One way to grant the permissions using the request headers is to specify a canned ACL with the "x-amz-acl" request header. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **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. Note: For directory buckets, only the "aws-chunked" value is supported in this header field. * **ContentLanguage** (*string*) -- The language that the content is in. * **ContentType** (*string*) -- A standard MIME type describing the format of the object data. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. * **GrantFullControl** (*string*) -- Specify access permissions explicitly to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Specify access permissions explicitly to allow grantee to read the object data and its metadata. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Specify access permissions explicitly to allows grantee to read the object ACL. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Specify access permissions explicitly to allows grantee to allow grantee to write the ACL for the applicable object. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- Specifies the Object Lock mode that you want to apply to the uploaded object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- Specifies the date and time when you want the Object Lock to expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether you want to apply a legal hold to the uploaded object. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** (*string*) -- Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide. Return type: "s3.MultipartUpload" Returns: MultipartUpload resource ObjectSummary / Action / copy_from copy_from ********* S3.ObjectSummary.copy_from(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Creates a copy of an object that is already stored in Amazon S3. Note: 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 Copy Object Using the REST Multipart Upload API. You can copy individual objects between general purpose buckets, between directory buckets, and between general purpose buckets and directory buckets. Note: * Amazon S3 supports copy operations using Multi-Region Access Points only as a destination when using the Multi-Region Access Point ARN. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. * VPC endpoints don't support cross-Region requests (including copies). If you're using VPC endpoints, your source and destination buckets should be in the same Amazon Web Services Region as your VPC endpoint. 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. For more information about how to enable a Region for your account, see Enable or disable a Region for standalone accounts in the *Amazon Web Services Account Management Guide*. Warning: 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 Bad Request" error. For more information, see Transfer Acceleration.Authentication and authorization All "CopyObject" requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the "x-amz-" prefix, including "x -amz-copy-source", must be signed. For more information, see REST Authentication. **Directory buckets** - You must use the IAM credentials to authenticate and authorize your access to the "CopyObject" API operation, instead of using the temporary security credentials through the "CreateSession" API operation. Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. Permissions You must have *read* access to the source object and *write* access to the destination bucket. * **General purpose bucket permissions** - You must have permissions in an IAM policy based on the source and destination bucket types in a "CopyObject" operation. * If the source object is in a general purpose bucket, you must have "s3:GetObject" permission to read the source object that is being copied. * If the destination bucket is a general purpose bucket, you must have "s3:PutObject" permission to write the object copy to the destination bucket. * **Directory bucket permissions** - You must have permissions in a bucket policy or an IAM identity-based policy based on the source and destination bucket types in a "CopyObject" operation. * If the source object that you want to copy is in a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to read the object. By default, the session is in the "ReadWrite" mode. If you want to restrict the access, you can explicitly set the "s3express:SessionMode" condition key to "ReadOnly" on the copy source bucket. * If the copy destination is a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to write the object to the destination. The "s3express:SessionMode" condition key can't be set to "ReadOnly" on the copy destination bucket. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. Response and special errors When the request is an HTTP 1.1 request, the response is chunk encoded. When the request is not an HTTP 1.1 request, the response would not contain the "Content-Length". You always need to read the entire response body to check if the copy succeeds. * If the copy is successful, you receive a response with information about the copied object. * A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the files. A "200 OK" response can contain either a success or an error. * 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 "200 OK" response. For example, in a cross-region copy, you may encounter throttling and receive a "200 OK" response. For more information, see Resolve the Error 200 response when copying objects to Amazon S3. The "200 OK" status code means the copy was accepted, but it doesn't mean the copy is complete. Another example is when you disconnect from Amazon S3 before the copy is complete, Amazon S3 might cancel the copy and you may receive a "200 OK" response. You must stay connected to Amazon S3 until the entire response is successfully received and processed. If you call this API operation directly, make sure to design your application to parse the content of the response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply error handling per your configuration settings (including automatically retrying the request as appropriate). If the condition persists, the SDKs throw an exception (or, for the SDKs that don't use exceptions, they return an error). Charge The copy request charge is based on the storage class and Region that you specify for the destination object. The request can also result in a data retrieval charge for the source if the source storage class bills for data retrieval. If the copy source is in a different region, the data transfer is billed to the copy source account. For pricing information, see Amazon S3 pricing. HTTP Host header syntax * **Directory buckets** - The HTTP Host header syntax is "Bucket- name.s3express-zone-id.region-code.amazonaws.com". * **Amazon S3 on Outposts** - When you use this action with S3 on Outposts through the REST API, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". The hostname isn't required when you use the Amazon Web Services CLI or SDKs. The following operations are related to "CopyObject": * PutObject * GetObject See also: AWS API Documentation **Request Syntax** response = object_summary.copy_from( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', CacheControl='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentType='string', CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}, CopySourceIfMatch='string', CopySourceIfModifiedSince=datetime(2015, 1, 1), CopySourceIfNoneMatch='string', CopySourceIfUnmodifiedSince=datetime(2015, 1, 1), Expires=datetime(2015, 1, 1), GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Metadata={ 'string': 'string' }, MetadataDirective='COPY'|'REPLACE', TaggingDirective='COPY'|'REPLACE', ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, CopySourceSSECustomerAlgorithm='string', CopySourceSSECustomerKey='string', RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string', ExpectedSourceBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned access control list (ACL) to apply to the object. When you copy an object, the ACL metadata is not preserved and is set to "private" by default. Only the owner has full access control. To override the default ACL setting, specify a new ACL when you generate a copy request. For more information, see Using ACLs. If the destination 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * If your destination 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. * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **CacheControl** (*string*) -- Specifies the caching behavior along the request/reply chain. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. When you copy an object, if the source object has a checksum, that checksum value will be copied to the new object by default. If the "CopyObject" request does not include this "x -amz-checksum-algorithm" header, the checksum algorithm will be copied from the source object to the destination object (if it's present on the source object). You can optionally specify a different checksum algorithm to use with the "x-amz- checksum-algorithm" header. Unrecognized or unsupported values will respond with the HTTP status code "400 Bad Request". Note: For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. Indicates whether an object should be displayed in a web browser or downloaded as a file. It allows specifying the desired filename for the downloaded file. * **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. Note: For directory buckets, only the "aws-chunked" value is supported in this header field. * **ContentLanguage** (*string*) -- The language the content is in. * **ContentType** (*string*) -- A standard MIME type that describes the format of the object data. * **CopySource** (*str** or **dict*) -- **[REQUIRED]** The name of the source bucket, key name of the source object, and optional version ID of the source object. You can either provide this value as a string or a dictionary. The string form is {bucket}/{key} or {bucket}/{key}?versionId={versionId} if you want to copy a specific version. You can also provide this value as a dictionary. The dictionary format is recommended over the string format because it is more explicit. The dictionary format is: {'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}. Note that the VersionId key is optional and may be omitted. To specify an S3 access point, provide the access point ARN for the "Bucket" key in the copy source dictionary. If you want to provide the copy source for an S3 access point as a string instead of a dictionary, the ARN provided must be the full S3 access point object ARN (i.e. {accesspoint_arn}/object/{key}) * **CopySourceIfMatch** (*string*) -- Copies the object if its entity tag (ETag) matches the specified tag. If both the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request and evaluate as follows, Amazon S3 returns "200 OK" and copies the data: * "x-amz-copy-source-if-match" condition evaluates to true * "x-amz-copy-source-if-unmodified-since" condition evaluates to false * **CopySourceIfModifiedSince** (*datetime*) -- Copies the object if it has been modified since the specified time. If both the "x-amz-copy-source-if-none-match" and "x-amz-copy- source-if-modified-since" headers are present in the request and evaluate as follows, Amazon S3 returns the "412 Precondition Failed" response code: * "x-amz-copy-source-if-none-match" condition evaluates to false * "x-amz-copy-source-if-modified-since" condition evaluates to true * **CopySourceIfNoneMatch** (*string*) -- Copies the object if its entity tag (ETag) is different than the specified ETag. If both the "x-amz-copy-source-if-none-match" and "x-amz-copy- source-if-modified-since" headers are present in the request and evaluate as follows, Amazon S3 returns the "412 Precondition Failed" response code: * "x-amz-copy-source-if-none-match" condition evaluates to false * "x-amz-copy-source-if-modified-since" condition evaluates to true * **CopySourceIfUnmodifiedSince** (*datetime*) -- Copies the object if it hasn't been modified since the specified time. If both the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request and evaluate as follows, Amazon S3 returns "200 OK" and copies the data: * "x-amz-copy-source-if-match" condition evaluates to true * "x-amz-copy-source-if-unmodified-since" condition evaluates to false * **Expires** (*datetime*) -- 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. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **MetadataDirective** (*string*) -- Specifies whether the metadata is copied from the source object or replaced with metadata that's provided in the request. When copying an object, you can preserve all metadata (the default) or specify new metadata. If this header isn’t specified, "COPY" is the default behavior. **General purpose bucket** - For general purpose buckets, when you grant permissions, you can use the "s3:x-amz-metadata- directive" condition key to enforce certain metadata behavior when objects are uploaded. For more information, see Amazon S3 condition key examples in the *Amazon S3 User Guide*. Note: "x-amz-website-redirect-location" is unique to each object and is not copied when using the "x-amz-metadata-directive" header. To copy the value, you must specify "x-amz-website- redirect-location" in the request header. * **TaggingDirective** (*string*) -- Specifies whether the object tag-set is copied from the source object or replaced with the tag-set that's provided in the request. The default value is "COPY". Note: **Directory buckets** - For directory buckets in a "CopyObject" operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a "501 Not Implemented" status code. When the destination bucket is a directory bucket, you will receive a "501 Not Implemented" response in any of the following situations: * When you attempt to "COPY" the tag-set from an S3 source object that has non-empty tags. * When you attempt to "REPLACE" the tag-set of a source object and set a non-empty value to "x-amz-tagging". * When you don't set the "x-amz-tagging-directive" header and the source object has non-empty tags. This is because the default value of "x-amz-tagging-directive" is "COPY". Because only the empty tag-set is supported for directory buckets in a "CopyObject" operation, the following situations are allowed: * When you attempt to "COPY" the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a general purpose bucket source object that has non-empty tags and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and don't set the "x-amz-tagging" value of the directory bucket destination object. This is because the default value of "x-amz-tagging" is the empty value. * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a "400 Bad Request" response. Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy. With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the *Amazon S3 User Guide*. **General purpose buckets** * For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy. * When you perform a "CopyObject" operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. **Directory buckets** * For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. * To encrypt new object copies to a directory bucket with SSE- KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key ( "aws/s3") isn't supported. Your SSE- KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a "CopyObject" operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- If the "x-amz-storage-class" header is not used, the copied object will be stored in the "STANDARD" Storage Class by default. The "STANDARD" storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Note: * **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". * **Amazon S3 on Outposts** - S3 on Outposts only uses the "OUTPOSTS" Storage Class. You can use the "CopyObject" action to change the storage class of an object that is already stored in Amazon S3 by using the "x-amz-storage-class" header. For more information, see Storage Classes in the *Amazon S3 User Guide*. Before using an object as a source object for the copy operation, you must restore a copy of it if it meets any of the following conditions: * The storage class of the source object is "GLACIER" or "DEEP_ARCHIVE". * The storage class of the source object is "INTELLIGENT_TIERING" and it's S3 Intelligent-Tiering access tier is "Archive Access" or "Deep Archive Access". For more information, see RestoreObject and Copying Objects in the *Amazon S3 User Guide*. * **WebsiteRedirectLocation** (*string*) -- If the destination bucket is configured as a website, redirects requests for this object copy to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. This value is unique to each object and is not copied when using the "x-amz- metadata-directive" header. Instead, you may opt to provide this header in combination with the "x-amz-metadata-directive" header. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). When you perform a "CopyObject" operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 S3 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. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the destination bucket is a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the *Amazon S3 User Guide*. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. **General purpose buckets** - This value must be explicitly added to specify encryption context for "CopyObject" requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key. For more information, see Amazon S3 Bucket Keys in the *Amazon S3 User Guide*. Note: **Directory buckets** - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **CopySourceSSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the source object (for example, "AES256"). If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. * **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 the same one that was used when the source object was created. If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. * **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 that the encryption key was transmitted without error. If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object copy in the destination bucket. This value must be used in conjunction with the "x-amz- tagging-directive" if you choose "REPLACE" for the "x-amz- tagging-directive". If you choose "COPY" for the "x-amz- tagging-directive", you don't need to set the "x-amz-tagging" header, because the tag-set will be copied from the source object directly. The tag-set must be encoded as URL Query parameters. The default value is the empty value. Note: **Directory buckets** - For directory buckets in a "CopyObject" operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a "501 Not Implemented" status code. When the destination bucket is a directory bucket, you will receive a "501 Not Implemented" response in any of the following situations: * When you attempt to "COPY" the tag-set from an S3 source object that has non-empty tags. * When you attempt to "REPLACE" the tag-set of a source object and set a non-empty value to "x-amz-tagging". * When you don't set the "x-amz-tagging-directive" header and the source object has non-empty tags. This is because the default value of "x-amz-tagging-directive" is "COPY". Because only the empty tag-set is supported for directory buckets in a "CopyObject" operation, the following situations are allowed: * When you attempt to "COPY" the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a general purpose bucket source object that has non-empty tags and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and don't set the "x-amz-tagging" value of the directory bucket destination object. This is because the default value of "x-amz-tagging" is the empty value. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to the object copy. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want the Object Lock of the object copy to expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether you want to apply a legal hold to the object copy. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ExpectedSourceBucketOwner** (*string*) -- The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'CopyObjectResult': { 'ETag': 'string', 'LastModified': datetime(2015, 1, 1), 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, 'Expiration': 'string', 'CopySourceVersionId': 'string', 'VersionId': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **CopyObjectResult** *(dict) --* Container for all response elements. * **ETag** *(string) --* Returns the ETag of the new object. The ETag reflects only changes to the contents of an object, not its metadata. * **LastModified** *(datetime) --* Creation date of the object. * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This checksum is present if the object being copied was uploaded with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expiration** *(string) --* If the object expiration is configured, the response includes this header. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **CopySourceVersionId** *(string) --* Version ID of the source object that was copied. Note: This functionality is not supported when the source object is in a directory bucket. * **VersionId** *(string) --* Version ID of the newly created copy. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs. * **BucketKeyEnabled** *(boolean) --* Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. ObjectSummary / Sub-Resource / Object Object ****** S3.ObjectSummary.Object() Creates a Object resource.: object = object_summary.Object() Return type: "S3.Object" Returns: A Object resource ObjectSummary / Attribute / e_tag e_tag ***** S3.ObjectSummary.e_tag * *(string) --* The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below: * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data. * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data. * If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest. Note: **Directory buckets** - MD5 is not supported by directory buckets. ObjectSummary / Sub-Resource / Version Version ******* S3.ObjectSummary.Version(id) Creates a ObjectVersion resource.: object_version = object_summary.Version('id') Parameters: **id** (*string*) -- The Version's id identifier. This **must** be set. Return type: "S3.ObjectVersion" Returns: A ObjectVersion resource ObjectSummary / Sub-Resource / Acl Acl *** S3.ObjectSummary.Acl() Creates a ObjectAcl resource.: object_acl = object_summary.Acl() Return type: "S3.ObjectAcl" Returns: A ObjectAcl resource ObjectSummary / Attribute / last_modified last_modified ************* S3.ObjectSummary.last_modified * *(datetime) --* Creation date of the object. ObjectSummary / Action / delete delete ****** S3.ObjectSummary.delete(**kwargs) Removes an object from a bucket. The behavior depends on the bucket's versioning state: * If bucket versioning is not enabled, the operation permanently deletes the object. * If bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the object. To permanently delete an object in a versioned bucket, you must include the object’s "versionId" in the request. For more information about versioning-enabled buckets, see Deleting object versions from a versioning-enabled bucket. * If bucket versioning is suspended, the operation removes the object that has a null "versionId", if there is one, and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null "versionId", and all versions of the object have a "versionId", Amazon S3 does not remove the object and only inserts a delete marker. To permanently delete an object that has a "versionId", you must include the object’s "versionId" in the request. For more information about versioning-suspended buckets, see Deleting objects from versioning-suspended buckets. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. To remove a specific version, you must use the "versionId" query parameter. Using this query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3 sets the response header "x-amz-delete-marker" to true. If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include the "x-amz-mfa" request header in the DELETE "versionId" request. Requests that include "x-amz-mfa" must use HTTPS. For more information about MFA Delete, see Using MFA Delete in the *Amazon S3 User Guide*. To see sample requests that use versioning, see Sample Request. Note: **Directory buckets** - MFA delete is not supported by directory buckets. You can delete objects by explicitly calling DELETE Object or calling ( PutBucketLifecycle) to enable Amazon S3 to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them the "s3:DeleteObject", "s3:DeleteObjectVersion", and "s3:PutLifeCycleConfiguration" actions. Note: **Directory buckets** - S3 Lifecycle is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always have the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must have the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following action is related to "DeleteObject": * PutObject See also: AWS API Documentation **Request Syntax** response = object_summary.delete( MFA='string', VersionId='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', IfMatch='string', IfMatchLastModifiedTime=datetime(2015, 1, 1), IfMatchSize=123 ) Parameters: * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatch** (*string*) -- The "If-Match" header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a "412 Precondition Failed" error. If the ETag matches or if the object doesn't exist, the operation will return a "204 Success (No Content) response". For more information about conditional requests, see RFC 7232. Note: This functionality is only supported for directory buckets. * **IfMatchLastModifiedTime** (*datetime*) -- If present, the object is deleted only if its modification times matches the provided "Timestamp". If the "Timestamp" values do not match, the operation returns a "412 Precondition Failed" error. If the "Timestamp" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. * **IfMatchSize** (*integer*) -- If present, the object is deleted only if its size matches the provided size in bytes. If the "Size" value does not match, the operation returns a "412 Precondition Failed" error. If the "Size" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. Warning: You can use the "If-Match", "x-amz-if-match-last-modified- time" and "x-amz-if-match-size" conditional headers in conjunction with each-other or individually. Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'VersionId': 'string', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Returns the version ID of the delete marker created as a result of the DELETE operation. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. Bucket / Action / download_file download_file ************* S3.Bucket.download_file(Key, Filename, ExtraArgs=None, Callback=None, Config=None) Download an S3 object to a file. Usage: import boto3 s3 = boto3.resource('s3') s3.Bucket('amzn-s3-demo-bucket').download_file('hello.txt', '/tmp/hello.txt') Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at *S3Transfer's Usage*. Parameters: * **Key** (*str*) -- The name of the key to download from. * **Filename** (*str*) -- The path to the file to download to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the download. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the transfer. Bucket / Action / get_available_subresources get_available_subresources ************************** S3.Bucket.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str Bucket / Attribute / bucket_region bucket_region ************* S3.Bucket.bucket_region * *(string) --* "BucketRegion" indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response. Bucket / Attribute / bucket_arn bucket_arn ********** S3.Bucket.bucket_arn * *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. Bucket / Action / create create ****** S3.Bucket.create(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts bucket, see CreateBucket. Creates a new S3 bucket. To create a bucket, you must set up 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. There are two types of buckets: general purpose buckets and directory buckets. For more information about these bucket types, see Creating, configuring, and working with Amazon S3 buckets in the *Amazon S3 User Guide*. Note: * **General purpose buckets** - If you send your "CreateBucket" request to the "s3.amazonaws.com" global endpoint, the request goes to the "us-east-1" Region. So 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 Virtual hosting of buckets in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - In addition to the "s3:CreateBucket" permission, the following permissions are required in a policy when your "CreateBucket" request includes specific headers: * **Access control lists (ACLs)** - In your "CreateBucket" request, if you specify an access control list (ACL) and set it to "public-read", "public-read-write", "authenticated-read", or if you explicitly specify any other custom ACLs, both "s3:CreateBucket" and "s3:PutBucketAcl" permissions are required. In your "CreateBucket" request, if you set the ACL to "private", or if you don't specify any ACLs, only the "s3:CreateBucket" permission is required. * **Object Lock** - In your "CreateBucket" request, if you set "x -amz-bucket-object-lock-enabled" to true, the "s3:PutBucketObjectLockConfiguration" and "s3:PutBucketVersioning" permissions are required. * **S3 Object Ownership** - If your "CreateBucket" request includes the "x-amz-object-ownership" header, then the "s3:PutBucketOwnershipControls" permission is required. Warning: To set an ACL on a bucket as part of a "CreateBucket" request, you must explicitly set S3 Object Ownership for the bucket to a different value than the default, "BucketOwnerEnforced". Additionally, if your desired bucket ACL grants public access, you must first create the bucket (without the bucket ACL) and then explicitly disable Block Public Access on the bucket before using "PutBucketAcl" to set the ACL. If you try to create a bucket with a public ACL, the request will fail. For the majority of modern use cases in S3, we recommend that you keep all Block Public Access settings enabled and keep ACLs disabled. If you would like to share data with users outside of your account, you can use bucket policies as needed. For more information, see Controlling ownership of objects and disabling ACLs for your bucket and Blocking public access to your Amazon S3 storage in the *Amazon S3 User Guide*. * **S3 Block Public Access** - If your specific use case requires granting public access to your S3 resources, you can disable Block Public Access. Specifically, you can create a new bucket with Block Public Access enabled, then separately call the DeletePublicAccessBlock API. To use this operation, you must have the "s3:PutBucketPublicAccessBlock" permission. For more information about S3 Block Public Access, see Blocking public access to your Amazon S3 storage in the *Amazon S3 User Guide*. * **Directory bucket permissions** - You must have the "s3express:CreateBucket" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. Warning: The permissions for ACLs, Object Lock, S3 Object Ownership, and S3 Block Public Access are not supported for directory buckets. For directory buckets, all Block Public Access settings are enabled at the bucket level and S3 Object Ownership is set to Bucket owner enforced (ACLs disabled). These settings can't be modified. For more information about permissions for creating and working with directory buckets, see Directory buckets in the *Amazon S3 User Guide*. For more information about supported S3 features for directory buckets, see Features of S3 Express One Zone in the *Amazon S3 User Guide*.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "CreateBucket": * PutObject * DeleteBucket See also: AWS API Documentation **Request Syntax** response = bucket.create( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', CreateBucketConfiguration={ 'LocationConstraint': 'af-south-1'|'ap-east-1'|'ap-northeast-1'|'ap-northeast-2'|'ap-northeast-3'|'ap-south-1'|'ap-south-2'|'ap-southeast-1'|'ap-southeast-2'|'ap-southeast-3'|'ap-southeast-4'|'ap-southeast-5'|'ca-central-1'|'cn-north-1'|'cn-northwest-1'|'EU'|'eu-central-1'|'eu-central-2'|'eu-north-1'|'eu-south-1'|'eu-south-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'il-central-1'|'me-central-1'|'me-south-1'|'sa-east-1'|'us-east-2'|'us-gov-east-1'|'us-gov-west-1'|'us-west-1'|'us-west-2', 'Location': { 'Type': 'AvailabilityZone'|'LocalZone', 'Name': 'string' }, 'Bucket': { 'DataRedundancy': 'SingleAvailabilityZone'|'SingleLocalZone', 'Type': 'Directory' }, 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', ObjectLockEnabledForBucket=True|False, ObjectOwnership='BucketOwnerPreferred'|'ObjectWriter'|'BucketOwnerEnforced' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the bucket. Note: This functionality is not supported for directory buckets. * **CreateBucketConfiguration** (*dict*) -- The configuration information for the bucket. * **LocationConstraint** *(string) --* Specifies the Region where the bucket will be created. 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. If you don't specify a Region, the bucket is created in the US East (N. Virginia) Region (us-east-1) by default. Configurations using the value "EU" will create a bucket in "eu-west-1". For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints. Note: This functionality is not supported for directory buckets. * **Location** *(dict) --* Specifies the location where the bucket will be created. **Directory buckets** - The location type is Availability Zone or Local Zone. To use the Local Zone location type, your account must be enabled for Local Zones. Otherwise, you get an HTTP "403 Forbidden" error with the error code "AccessDenied". To learn more, see Enable accounts for Local Zones in the *Amazon S3 User Guide*. Note: This functionality is only supported by directory buckets. * **Type** *(string) --* The type of location where the bucket will be created. * **Name** *(string) --* The name of the location where the bucket will be created. For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is "usw2-az1". * **Bucket** *(dict) --* Specifies the information about the bucket that will be created. Note: This functionality is only supported by directory buckets. * **DataRedundancy** *(string) --* The number of Zone (Availability Zone or Local Zone) that's used for redundancy for the bucket. * **Type** *(string) --* The type of bucket. * **Tags** *(list) --* An array of tags that you can apply to the bucket that you're creating. Tags are key-value pairs of metadata used to categorize and organize your buckets, track costs, and control access. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **GrantFullControl** (*string*) -- Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. Note: This functionality is not supported for directory buckets. * **GrantRead** (*string*) -- Allows grantee to list the objects in the bucket. Note: This functionality is not supported for directory buckets. * **GrantReadACP** (*string*) -- Allows grantee to read the bucket ACL. Note: This functionality is not supported for directory buckets. * **GrantWrite** (*string*) -- Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. Note: This functionality is not supported for directory buckets. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. Note: This functionality is not supported for directory buckets. * **ObjectLockEnabledForBucket** (*boolean*) -- Specifies whether you want S3 Object Lock to be enabled for the new bucket. Note: This functionality is not supported for directory buckets. * **ObjectOwnership** (*string*) -- The container element for object ownership for a bucket's ownership controls. "BucketOwnerPreferred" - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the "bucket-owner-full-control" canned ACL. "ObjectWriter" - The uploading account will own the object if the object is uploaded with the "bucket-owner-full-control" canned ACL. "BucketOwnerEnforced" - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or specify bucket owner full control ACLs (such as the predefined "bucket-owner-full-control" canned ACL or a custom ACL in XML format that grants the same permissions). By default, "ObjectOwnership" is set to "BucketOwnerEnforced" and ACLs are disabled. We recommend keeping ACLs disabled, except in uncommon use cases where you must control access for each object individually. For more information about S3 Object Ownership, see Controlling ownership of objects and disabling ACLs for your bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets use the bucket owner enforced setting for S3 Object Ownership. Return type: dict Returns: **Response Syntax** { 'Location': 'string', 'BucketArn': 'string' } **Response Structure** * *(dict) --* * **Location** *(string) --* A forward slash followed by the name of the bucket. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. Bucket / Waiter / wait_until_exists wait_until_exists ***************** S3.Bucket.wait_until_exists(**kwargs) Waits until this Bucket is exists. This method calls "S3.Waiter.bucket_exists.wait()" which polls "S3.Client.head_bucket()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** bucket.wait_until_exists( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None Bucket / Collection / multipart_uploads multipart_uploads ***************** S3.Bucket.multipart_uploads A collection of MultipartUpload resources.A MultipartUpload Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources. all() Creates an iterable of all MultipartUpload resources in the collection. See also: AWS API Documentation **Request Syntax** multipart_upload_iterator = bucket.multipart_uploads.all() Return type: list("s3.MultipartUpload") Returns: A list of MultipartUpload resources filter(**kwargs) Creates an iterable of all MultipartUpload resources in the collection filtered by kwargs passed to method. A MultipartUpload collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources. See also: AWS API Documentation **Request Syntax** multipart_upload_iterator = bucket.multipart_uploads.filter( Delimiter='string', EncodingType='url', KeyMarker='string', MaxUploads=123, Prefix='string', UploadIdMarker='string', ExpectedBucketOwner='string', RequestPayer='requester' ) Parameters: * **Delimiter** (*string*) -- Character you use to group keys. All keys that contain the same string between the prefix, if specified, and the first occurrence of the delimiter after the prefix are grouped under a single result element, "CommonPrefixes". If you don't specify the prefix parameter, then the substring starts at the beginning of the key. The keys that are grouped under "CommonPrefixes" result element are not returned elsewhere in the response. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **KeyMarker** (*string*) -- Specifies the multipart upload after which listing should begin. Note: * **General purpose buckets** - For general purpose buckets, "key-marker" is an object key. Together with "upload-id-marker", this parameter specifies the multipart upload after which listing should begin. If "upload-id-marker" is not specified, only the keys lexicographically greater than the specified "key- marker" will be included in the list. If "upload-id- marker" is specified, any multipart uploads for a key equal to the "key-marker" might also be included, provided those multipart uploads have upload IDs lexicographically greater than the specified "upload- id-marker". * **Directory buckets** - For directory buckets, "key- marker" is obfuscated and isn't a real object key. The "upload-id-marker" parameter isn't supported by directory buckets. To list the additional multipart uploads, you only need to set the value of "key-marker" to the "NextKeyMarker" value from the previous response. In the "ListMultipartUploads" response, the multipart uploads aren't sorted lexicographically based on the object keys. * **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. You can use prefixes to separate a bucket into different grouping of keys. (You can think of using "prefix" to make groups in the same way that you'd use a folder in a file system.) Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **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. Otherwise, any multipart uploads for a key equal to the key-marker might be included in the list only if they have an upload ID lexicographically greater than the specified "upload-id-marker". Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Return type: list("s3.MultipartUpload") Returns: A list of MultipartUpload resources limit(**kwargs) Creates an iterable up to a specified amount of MultipartUpload resources in the collection. See also: AWS API Documentation **Request Syntax** multipart_upload_iterator = bucket.multipart_uploads.limit( count=123 ) Parameters: **count** (*integer*) -- The limit to the number of resources in the iterable. Return type: list("s3.MultipartUpload") Returns: A list of MultipartUpload resources page_size(**kwargs) Creates an iterable of all MultipartUpload resources in the collection, but limits the number of items returned by each service call by the specified amount. See also: AWS API Documentation **Request Syntax** multipart_upload_iterator = bucket.multipart_uploads.page_size( count=123 ) Parameters: **count** (*integer*) -- The number of items returned by each service call Return type: list("s3.MultipartUpload") Returns: A list of MultipartUpload resources Bucket / Action / upload_file upload_file *********** S3.Bucket.upload_file(Filename, Key, ExtraArgs=None, Callback=None, Config=None) Upload a file to an S3 object. Usage: import boto3 s3 = boto3.resource('s3') s3.Bucket('amzn-s3-demo-bucket').upload_file('/tmp/hello.txt', 'hello.txt') Similar behavior as S3Transfer's upload_file() method, except that parameters are capitalized. Detailed examples can be found at *S3Transfer's Usage*. Parameters: * **Filename** (*str*) -- The path to the file to upload. * **Key** (*str*) -- The name of the key to upload to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed upload arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the upload. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the transfer. Bucket / Action / load load **** S3.Bucket.load(*args, **kwargs) Calls s3.Client.list_buckets() to update the attributes of the Bucket resource. S3 / Resource / Bucket Bucket ****** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.Bucket(name) A resource representing an Amazon Simple Storage Service (S3) Bucket: import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('name') Parameters: **name** (*string*) -- The Bucket's name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * bucket_arn * bucket_region * creation_date Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * copy * create * delete * delete_objects * download_file * download_fileobj * get_available_subresources * load * put_object * upload_file * upload_fileobj Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Acl * Cors * Lifecycle * LifecycleConfiguration * Logging * Notification * Object * Policy * RequestPayment * Tagging * Versioning * Website Collections =========== Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide. These are the resource's available collections: * multipart_uploads * object_versions * objects Waiters ======= Waiters provide an interface to wait for a resource to reach a specific state. For more information about waiters refer to the Resources Introduction Guide. These are the resource's available waiters: * wait_until_exists * wait_until_not_exists Bucket / Attribute / creation_date creation_date ************* S3.Bucket.creation_date * *(datetime) --* Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy. Bucket / Sub-Resource / Website Website ******* S3.Bucket.Website() Creates a BucketWebsite resource.: bucket_website = bucket.Website() Return type: "S3.BucketWebsite" Returns: A BucketWebsite resource Bucket / Waiter / wait_until_not_exists wait_until_not_exists ********************* S3.Bucket.wait_until_not_exists(**kwargs) Waits until this Bucket is not exists. This method calls "S3.Waiter.bucket_not_exists.wait()" which polls "S3.Client.head_bucket()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** bucket.wait_until_not_exists( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None Bucket / Sub-Resource / Tagging Tagging ******* S3.Bucket.Tagging() Creates a BucketTagging resource.: bucket_tagging = bucket.Tagging() Return type: "S3.BucketTagging" Returns: A BucketTagging resource Bucket / Sub-Resource / Policy Policy ****** S3.Bucket.Policy() Creates a BucketPolicy resource.: bucket_policy = bucket.Policy() Return type: "S3.BucketPolicy" Returns: A BucketPolicy resource Bucket / Identifier / name name **** S3.Bucket.name *(string)* The Bucket's name identifier. This **must** be set. Bucket / Action / delete_objects delete_objects ************** S3.Bucket.delete_objects(**kwargs) This operation enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this operation provides a suitable alternative to sending individual delete requests, reducing per-request overhead. The request can contain a list of up to 1,000 keys that you want to delete. In the XML, you provide the object key names, and optionally, version IDs if you want to delete a specific version of the object from a versioning-enabled bucket. For each key, Amazon S3 performs a delete operation and returns the result of that delete, success or failure, in the response. If the object specified in the request isn't found, Amazon S3 confirms the deletion by returning the result as deleted. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. The operation supports two modes for the response: verbose and quiet. By default, the operation uses verbose mode in which the response includes the result of deletion of each key in your request. In quiet mode the response includes only keys where the delete operation encountered an error. For a successful deletion in a quiet mode, the operation does not return any information about the delete in the response body. When performing this action on an MFA Delete enabled bucket, that attempts to delete any versioned objects, you must include an MFA token. If you do not provide one, the entire request will fail, even if there are non-versioned objects you are trying to delete. If you provide an invalid token, whether there are versioned keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: **Directory buckets** - MFA delete is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always specify the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must specify the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Content-MD5 request header * **General purpose bucket** - The Content-MD5 request header is required for all Multi-Object Delete requests. Amazon S3 uses the header value to ensure that your request body has not been altered in transit. * **Directory bucket** - The Content-MD5 request header or a additional checksum request header (including "x-amz-checksum- crc32", "x-amz-checksum-crc32c", "x-amz-checksum-sha1", or "x -amz-checksum-sha256") is required for all Multi-Object Delete requests. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "DeleteObjects": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * AbortMultipartUpload See also: AWS API Documentation **Request Syntax** response = bucket.delete_objects( Delete={ 'Objects': [ { 'Key': 'string', 'VersionId': 'string', 'ETag': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'Size': 123 }, ], 'Quiet': True|False }, MFA='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' ) Parameters: * **Delete** (*dict*) -- **[REQUIRED]** Container for the request. * **Objects** *(list) --* **[REQUIRED]** The object to delete. Note: **Directory buckets** - For directory buckets, an object that's composed entirely of whitespace characters is not supported by the "DeleteObjects" API operation. The request will receive a "400 Bad Request" error and none of the objects in the request will be deleted. * *(dict) --* Object Identifier is unique value to identify objects. * **Key** *(string) --* **[REQUIRED]** Key name of the object. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **VersionId** *(string) --* Version ID for the specific version of the object to delete. Note: This functionality is not supported for directory buckets. * **ETag** *(string) --* An entity tag (ETag) is an identifier assigned by a web server to a specific version of a resource found at a URL. This header field makes the request method conditional on "ETags". Note: Entity tags (ETags) for S3 Express One Zone are random alphanumeric strings unique to the object. * **LastModifiedTime** *(datetime) --* If present, the objects are deleted only if its modification times matches the provided "Timestamp". Note: This functionality is only supported for directory buckets. * **Size** *(integer) --* If present, the objects are deleted only if its size matches the provided size in bytes. Note: This functionality is only supported for directory buckets. * **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. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. When performing the "DeleteObjects" operation on an MFA delete enabled bucket, which attempts to delete the specified versioned objects, you must include an MFA token. If you don't provide an MFA token, the entire request will fail, even if there are non-versioned objects that you are trying to delete. If you provide an invalid token, whether there are versioned object keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Return type: dict Returns: **Response Syntax** { 'Deleted': [ { 'Key': 'string', 'VersionId': 'string', 'DeleteMarker': True|False, 'DeleteMarkerVersionId': 'string' }, ], 'RequestCharged': 'requester', 'Errors': [ { 'Key': 'string', 'VersionId': 'string', 'Code': 'string', 'Message': 'string' }, ] } **Response Structure** * *(dict) --* * **Deleted** *(list) --* Container element for a successful delete. It identifies the object that was successfully deleted. * *(dict) --* Information about the deleted object. * **Key** *(string) --* The name of the deleted object. * **VersionId** *(string) --* The version ID of the deleted object. Note: This functionality is not supported for directory buckets. * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **DeleteMarkerVersionId** *(string) --* The version ID of the delete marker created as a result of the DELETE operation. If you delete a specific object version, the value returned by this header is the version ID of the object version deleted. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **Errors** *(list) --* Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered. * *(dict) --* Container for all error elements. * **Key** *(string) --* The error key. * **VersionId** *(string) --* The version ID of the error. Note: This functionality is not supported for directory buckets. * **Code** *(string) --* The error code is a string that uniquely identifies an error condition. It is meant to be read and understood by programs that detect and handle errors by type. The following is a list of Amazon S3 error codes. For more information, see Error responses. * * *Code:* AccessDenied * *Description:* Access Denied * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AccountProblem * *Description:* There is a problem with your Amazon Web Services account that prevents the action from completing successfully. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AllAccessDisabled * *Description:* All access to this Amazon S3 resource has been disabled. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AmbiguousGrantByEmailAddress * *Description:* The email address you provided is associated with more than one account. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* AuthorizationHeaderMalformed * *Description:* The authorization header you provided is invalid. * *HTTP Status Code:* 400 Bad Request * *HTTP Status Code:* N/A * * *Code:* BadDigest * *Description:* The Content-MD5 you specified did not match what we received. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyExists * *Description:* The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyOwnedByYou * *Description:* The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all Amazon Web Services Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs). * *Code:* 409 Conflict (in all Regions except the North Virginia Region) * *SOAP Fault Code Prefix:* Client * * *Code:* BucketNotEmpty * *Description:* The bucket you tried to delete is not empty. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* CredentialsNotSupported * *Description:* This request does not support credentials. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* CrossLocationLoggingProhibited * *Description:* Cross-location logging not allowed. Buckets in one geographic location cannot log information to a bucket in another location. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooSmall * *Description:* Your proposed upload is smaller than the minimum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooLarge * *Description:* Your proposed upload exceeds the maximum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* ExpiredToken * *Description:* The provided token has expired. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IllegalVersioningConfigurationException * *Description:* Indicates that the versioning configuration specified in the request is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncompleteBody * *Description:* You did not provide the number of bytes specified by the Content-Length HTTP header * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncorrectNumberOfFilesInPostRequest * *Description:* POST requires exactly one file upload per request. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InlineDataTooLarge * *Description:* Inline data exceeds the maximum allowed size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InternalError * *Description:* We encountered an internal error. Please try again. * *HTTP Status Code:* 500 Internal Server Error * *SOAP Fault Code Prefix:* Server * * *Code:* InvalidAccessKeyId * *Description:* The Amazon Web Services access key ID you provided does not exist in our records. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidAddressingHeader * *Description:* You must specify the Anonymous role. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidArgument * *Description:* Invalid Argument * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketName * *Description:* The specified bucket is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketState * *Description:* The request is not valid with the current state of the bucket. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidDigest * *Description:* The Content-MD5 you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidEncryptionAlgorithmError * *Description:* The encryption request you specified is not valid. The valid value is AES256. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidLocationConstraint * *Description:* The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidObjectState * *Description:* The action is not valid for the current state of the object. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPart * *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. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPartOrder * *Description:* The list of parts was not in ascending order. Parts list must be specified in order by part number. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPayer * *Description:* All access to this object has been disabled. Please contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPolicyDocument * *Description:* The content of the form does not meet the conditions specified in the policy document. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRange * *Description:* The requested range cannot be satisfied. * *HTTP Status Code:* 416 Requested Range Not Satisfiable * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Please use "AWS4-HMAC-SHA256". * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* SOAP requests must be made over an HTTPS connection. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with non-DNS compliant names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with periods (.) in their names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate endpoint only supports virtual style requests. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is not configured on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is disabled on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration cannot be enabled on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidSecurity * *Description:* The provided security credentials are not valid. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidSOAPRequest * *Description:* The SOAP request body is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidStorageClass * *Description:* The storage class you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidTargetBucketForLogging * *Description:* The target bucket for logging does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidToken * *Description:* The provided token is malformed or otherwise invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidURI * *Description:* Couldn't parse the specified URI. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* KeyTooLongError * *Description:* Your key is too long. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedACLError * *Description:* The XML you provided was not well- formed or did not validate against our published schema. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedPOSTRequest * *Description:* The body of your POST request is not well-formed multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedXML * *Description:* This happens when the user sends malformed XML (XML that doesn't conform to the published XSD) for the configuration. The error message is, "The XML you provided was not well- formed or did not validate against our published schema." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxMessageLengthExceeded * *Description:* Your request was too big. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxPostPreDataLengthExceededError * *Description:* Your POST request fields preceding the upload file were too large. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MetadataTooLarge * *Description:* Your metadata headers exceed the maximum allowed metadata size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MethodNotAllowed * *Description:* The specified method is not allowed against this resource. * *HTTP Status Code:* 405 Method Not Allowed * *SOAP Fault Code Prefix:* Client * * *Code:* MissingAttachment * *Description:* A SOAP attachment was expected, but none were found. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* MissingContentLength * *Description:* You must provide the Content-Length HTTP header. * *HTTP Status Code:* 411 Length Required * *SOAP Fault Code Prefix:* Client * * *Code:* MissingRequestBodyError * *Description:* This happens when the user sends an empty XML document as a request. The error message is, "Request body is empty." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityElement * *Description:* The SOAP 1.1 request is missing a security element. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityHeader * *Description:* Your request is missing a required header. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoLoggingStatusForKey * *Description:* There is no such thing as a logging status subresource for a key. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucket * *Description:* The specified bucket does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucketPolicy * *Description:* The specified bucket does not have a bucket policy. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchKey * *Description:* The specified key does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchLifecycleConfiguration * *Description:* The lifecycle configuration does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchUpload * *Description:* The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchVersion * *Description:* Indicates that the version ID specified in the request does not match an existing version. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NotImplemented * *Description:* A header you provided implies functionality that is not implemented. * *HTTP Status Code:* 501 Not Implemented * *SOAP Fault Code Prefix:* Server * * *Code:* NotSignedUp * *Description:* Your account is not signed up for the Amazon S3 service. You must sign up before you can use Amazon S3. You can sign up at the following URL: Amazon S3 * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* OperationAborted * *Description:* A conflicting conditional action is currently in progress against this resource. Try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* PermanentRedirect * *Description:* The bucket you are attempting to access must be addressed using the specified endpoint. Send all future requests to this endpoint. * *HTTP Status Code:* 301 Moved Permanently * *SOAP Fault Code Prefix:* Client * * *Code:* PreconditionFailed * *Description:* At least one of the preconditions you specified did not hold. * *HTTP Status Code:* 412 Precondition Failed * *SOAP Fault Code Prefix:* Client * * *Code:* Redirect * *Description:* Temporary redirect. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* RestoreAlreadyInProgress * *Description:* Object restore is already in progress. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* RequestIsNotMultiPartContent * *Description:* Bucket POST must be of the enclosure- type multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeout * *Description:* Your socket connection to the server was not read from or written to within the timeout period. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeTooSkewed * *Description:* The difference between the request time and the server's time is too large. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTorrentOfBucketError * *Description:* Requesting the torrent file of a bucket is not permitted. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* SignatureDoesNotMatch * *Description:* The request signature we calculated does not match the signature you provided. Check your Amazon Web Services secret access key and signing method. For more information, see REST Authentication and SOAP Authentication for details. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* ServiceUnavailable * *Description:* Service is unable to handle request. * *HTTP Status Code:* 503 Service Unavailable * *SOAP Fault Code Prefix:* Server * * *Code:* SlowDown * *Description:* Reduce your request rate. * *HTTP Status Code:* 503 Slow Down * *SOAP Fault Code Prefix:* Server * * *Code:* TemporaryRedirect * *Description:* You are being redirected to the bucket while DNS updates. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* TokenRefreshRequired * *Description:* The provided token must be refreshed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* TooManyBuckets * *Description:* You have attempted to create more buckets than allowed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnexpectedContent * *Description:* This request does not support content. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnresolvableGrantByEmailAddress * *Description:* The email address you provided does not match any account on record. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UserKeyMustBeSpecified * *Description:* The bucket POST must contain the specified field name. If it is specified, check the order of the fields. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * **Message** *(string) --* The error message contains a generic description of the error condition in English. It is intended for a human audience. Simple programs display the message directly to the end user if they encounter an error condition they don't know how or don't care to handle. Sophisticated programs with more exhaustive error handling and proper internationalization are more likely to ignore the error message. Bucket / Action / upload_fileobj upload_fileobj ************** S3.Bucket.upload_fileobj(Fileobj, Key, ExtraArgs=None, Callback=None, Config=None) Upload a file-like object to this bucket. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart upload in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('amzn-s3-demo-bucket') with open('filename', 'rb') as data: bucket.upload_fileobj(data, 'mykey') Parameters: * **Fileobj** (*a file-like object*) -- A file-like object to upload. At a minimum, it must implement the *read* method, and must return bytes. * **Key** (*str*) -- The name of the key to upload to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed upload arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the upload. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the upload. Bucket / Sub-Resource / Logging Logging ******* S3.Bucket.Logging() Creates a BucketLogging resource.: bucket_logging = bucket.Logging() Return type: "S3.BucketLogging" Returns: A BucketLogging resource Bucket / Sub-Resource / Versioning Versioning ********** S3.Bucket.Versioning() Creates a BucketVersioning resource.: bucket_versioning = bucket.Versioning() Return type: "S3.BucketVersioning" Returns: A BucketVersioning resource Bucket / Sub-Resource / Notification Notification ************ S3.Bucket.Notification() Creates a BucketNotification resource.: bucket_notification = bucket.Notification() Return type: "S3.BucketNotification" Returns: A BucketNotification resource Bucket / Sub-Resource / Cors Cors **** S3.Bucket.Cors() Creates a BucketCors resource.: bucket_cors = bucket.Cors() Return type: "S3.BucketCors" Returns: A BucketCors resource Bucket / Action / copy copy **** S3.Bucket.copy(CopySource, Key, ExtraArgs=None, Callback=None, SourceClient=None, Config=None) Copy an object from one S3 location to an object in this bucket. This is a managed transfer which will perform a multipart copy in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') copy_source = { 'Bucket': 'amzn-s3-demo-bucket1', 'Key': 'mykey' } bucket = s3.Bucket('amzn-s3-demo-bucket2') bucket.copy(copy_source, 'otherkey') Parameters: * **CopySource** (*dict*) -- The name of the source bucket, key name of the source object, and optional version ID of the source object. The dictionary format is: "{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}". Note that the "VersionId" key is optional and may be omitted. * **Key** (*str*) -- The name of the key to copy to * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the copy. * **SourceClient** (*botocore** or **boto3 Client*) -- The client to be used for operation that may happen at the source object. For example, this client is used for the head_object that determines the size of the copy. If no client is provided, the current client is used as the client for the source object. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the copy. Bucket / Sub-Resource / LifecycleConfiguration LifecycleConfiguration ********************** S3.Bucket.LifecycleConfiguration() Creates a BucketLifecycleConfiguration resource.: bucket_lifecycle_configuration = bucket.LifecycleConfiguration() Return type: "S3.BucketLifecycleConfiguration" Returns: A BucketLifecycleConfiguration resource Bucket / Action / put_object put_object ********** S3.Bucket.put_object(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Adds an object to a bucket. Note: * Amazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the entire object to the bucket. You cannot use "PutObject" to only update a single piece of metadata for an existing object. You must put the entire object with updated metadata if you want to update some values. * If your bucket uses the bucket owner enforced setting for Object Ownership, ACLs are disabled and no longer affect permissions. All objects written to the bucket by any account will be owned by the bucket owner. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Amazon S3 is a distributed system. If it receives multiple write requests for the same object simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior: * **S3 Object Lock** - To prevent objects from being deleted or overwritten, you can use Amazon S3 Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **If-None-Match** - Uploads the object only if the object key name does not already exist in the specified bucket. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload, S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure, retry the upload. Expects the * character (asterisk). For more information, see Add preconditions to S3 operations with conditional requests in the *Amazon S3 User Guide* or RFC 7232. Note: This functionality is not supported for S3 on Outposts. * **S3 Versioning** - When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all versions of the objects. For each write request that is made to the same object, Amazon S3 automatically generates a unique version ID of that object being stored in Amazon S3. You can retrieve, replace, or delete any version of the object. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "PutObject" request includes specific headers. * "s3:PutObject" - To successfully complete the "PutObject" request, you must always have the "s3:PutObject" permission on a bucket to add an object to it. * "s3:PutObjectAcl" - To successfully change the objects ACL of your "PutObject" request, you must have the "s3:PutObjectAcl". * "s3:PutObjectTagging" - To successfully set the tag-set with your "PutObject" request, you must have the "s3:PutObjectTagging". * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Data integrity with Content-MD5 * **General purpose bucket** - To ensure that data is not corrupted traversing the network, use the "Content-MD5" header. When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 digest, you can calculate the MD5 while putting the object to Amazon S3 and compare the returned ETag to the calculated MD5 value. * **Directory bucket** - This functionality is not supported for directory buckets. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". For more information about related Amazon S3 APIs, see the following: * CopyObject * DeleteObject See also: AWS API Documentation **Request Syntax** object = bucket.put_object( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Body=b'bytes'|file, CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentLength=123, ContentMD5='string', ContentType='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', Expires=datetime(2015, 1, 1), IfMatch='string', IfNoneMatch='string', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Key='string', WriteOffsetBytes=123, Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. For more information, see Canned ACL in the *Amazon S3 User Guide*. When adding a new object, you can use headers to grant ACL- based 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. By default, all objects are private. Only the owner has full access control. For more information, see Access Control List (ACL) Overview and Managing ACLs Using the REST API in the *Amazon S3 User Guide*. If the bucket that you're uploading 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. PUT requests that contain other ACLs (for example, custom grants to certain Amazon Web Services accounts) fail and return a "400" error with the error code "AccessControlListNotSupported". For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Body** (*bytes** or **seekable file-like object*) -- Object data. * **CacheControl** (*string*) -- Can be used to specify caching behavior along the request/reply chain. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#se c14.9. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. For more information, see https://www.rfc-editor.org/rfc/rfc6266#section-4. * **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. For more information, see https://www.rfc- editor.org/rfc/rfc9110.html#field.content-encoding. * **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. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content- length. * **ContentMD5** (*string*) -- The Base64 encoded 128-bit "MD5" digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ContentType** (*string*) -- A standard MIME type describing the format of the contents. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3. * **IfMatch** (*string*) -- Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should fetch the object's ETag and retry the upload. Expects the ETag value as a string. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **IfNoneMatch** (*string*) -- Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should retry the upload. Expects the '*' (asterisk) character. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **GrantFullControl** (*string*) -- Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Key** (*string*) -- **[REQUIRED]** Object key for which the PUT action was initiated. * **WriteOffsetBytes** (*integer*) -- Specifies the offset for appending data to existing objects in bytes. The offset must be equal to the size of the existing object being appended to. If no object exists, setting this header to 0 will create a new object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm that was used when you store this object in Amazon S3 or Amazon FSx. * **General purpose buckets** - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer- provided keys (SSE-C). Amazon S3 encrypts data with server- side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. For information about object metadata, see Object Key and Metadata in the *Amazon S3 User Guide*. In the following example, the request header sets the redirect to an object (anotherPage.html) in the same bucket: "x-amz-website-redirect-location: /anotherPage.html" In the following example, the request header sets the object redirect to another website: "x-amz-website-redirect-location: http://www.example.com/" For more information about website hosting in Amazon S3, see Hosting Websites on Amazon S3 and How to Configure Website Page Redirects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key- value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. **General purpose buckets** - This value must be explicitly added during "CopyObject" operations if you want an additional encryption context for your object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want this object's Object Lock to expire. Must be formatted as a timestamp parameter. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: "s3.Object" Returns: Object resource Bucket / Collection / object_versions object_versions *************** S3.Bucket.object_versions A collection of ObjectVersion resources.A ObjectVersion Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources. all() Creates an iterable of all ObjectVersion resources in the collection. See also: AWS API Documentation **Request Syntax** object_version_iterator = bucket.object_versions.all() Return type: list("s3.ObjectVersion") Returns: A list of ObjectVersion resources delete(**kwargs) This operation enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this operation provides a suitable alternative to sending individual delete requests, reducing per- request overhead. The request can contain a list of up to 1,000 keys that you want to delete. In the XML, you provide the object key names, and optionally, version IDs if you want to delete a specific version of the object from a versioning-enabled bucket. For each key, Amazon S3 performs a delete operation and returns the result of that delete, success or failure, in the response. If the object specified in the request isn't found, Amazon S3 confirms the deletion by returning the result as deleted. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. The operation supports two modes for the response: verbose and quiet. By default, the operation uses verbose mode in which the response includes the result of deletion of each key in your request. In quiet mode the response includes only keys where the delete operation encountered an error. For a successful deletion in a quiet mode, the operation does not return any information about the delete in the response body. When performing this action on an MFA Delete enabled bucket, that attempts to delete any versioned objects, you must include an MFA token. If you do not provide one, the entire request will fail, even if there are non-versioned objects you are trying to delete. If you provide an invalid token, whether there are versioned keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: **Directory buckets** - MFA delete is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always specify the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must specify the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Content-MD5 request header * **General purpose bucket** - The Content-MD5 request header is required for all Multi-Object Delete requests. Amazon S3 uses the header value to ensure that your request body has not been altered in transit. * **Directory bucket** - The Content-MD5 request header or a additional checksum request header (including "x-amz-checksum- crc32", "x-amz-checksum-crc32c", "x-amz-checksum-sha1", or "x -amz-checksum-sha256") is required for all Multi-Object Delete requests. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket- name.s3express-zone-id.region-code.amazonaws.com". The following operations are related to "DeleteObjects": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * AbortMultipartUpload See also: AWS API Documentation **Request Syntax** response = bucket.object_versions.delete( MFA='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' ) Parameters: * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. When performing the "DeleteObjects" operation on an MFA delete enabled bucket, which attempts to delete the specified versioned objects, you must include an MFA token. If you don't provide an MFA token, the entire request will fail, even if there are non-versioned objects that you are trying to delete. If you provide an invalid token, whether there are versioned object keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x -amz-checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Return type: dict Returns: **Response Syntax** { 'Deleted': [ { 'Key': 'string', 'VersionId': 'string', 'DeleteMarker': True|False, 'DeleteMarkerVersionId': 'string' }, ], 'RequestCharged': 'requester', 'Errors': [ { 'Key': 'string', 'VersionId': 'string', 'Code': 'string', 'Message': 'string' }, ] } **Response Structure** * *(dict) --* * **Deleted** *(list) --* Container element for a successful delete. It identifies the object that was successfully deleted. * *(dict) --* Information about the deleted object. * **Key** *(string) --* The name of the deleted object. * **VersionId** *(string) --* The version ID of the deleted object. Note: This functionality is not supported for directory buckets. * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **DeleteMarkerVersionId** *(string) --* The version ID of the delete marker created as a result of the DELETE operation. If you delete a specific object version, the value returned by this header is the version ID of the object version deleted. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **Errors** *(list) --* Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered. * *(dict) --* Container for all error elements. * **Key** *(string) --* The error key. * **VersionId** *(string) --* The version ID of the error. Note: This functionality is not supported for directory buckets. * **Code** *(string) --* The error code is a string that uniquely identifies an error condition. It is meant to be read and understood by programs that detect and handle errors by type. The following is a list of Amazon S3 error codes. For more information, see Error responses. * * *Code:* AccessDenied * *Description:* Access Denied * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AccountProblem * *Description:* There is a problem with your Amazon Web Services account that prevents the action from completing successfully. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AllAccessDisabled * *Description:* All access to this Amazon S3 resource has been disabled. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AmbiguousGrantByEmailAddress * *Description:* The email address you provided is associated with more than one account. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* AuthorizationHeaderMalformed * *Description:* The authorization header you provided is invalid. * *HTTP Status Code:* 400 Bad Request * *HTTP Status Code:* N/A * * *Code:* BadDigest * *Description:* The Content-MD5 you specified did not match what we received. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyExists * *Description:* The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyOwnedByYou * *Description:* The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all Amazon Web Services Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs). * *Code:* 409 Conflict (in all Regions except the North Virginia Region) * *SOAP Fault Code Prefix:* Client * * *Code:* BucketNotEmpty * *Description:* The bucket you tried to delete is not empty. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* CredentialsNotSupported * *Description:* This request does not support credentials. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* CrossLocationLoggingProhibited * *Description:* Cross-location logging not allowed. Buckets in one geographic location cannot log information to a bucket in another location. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooSmall * *Description:* Your proposed upload is smaller than the minimum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooLarge * *Description:* Your proposed upload exceeds the maximum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* ExpiredToken * *Description:* The provided token has expired. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IllegalVersioningConfigurationException * *Description:* Indicates that the versioning configuration specified in the request is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncompleteBody * *Description:* You did not provide the number of bytes specified by the Content-Length HTTP header * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncorrectNumberOfFilesInPostRequest * *Description:* POST requires exactly one file upload per request. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InlineDataTooLarge * *Description:* Inline data exceeds the maximum allowed size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InternalError * *Description:* We encountered an internal error. Please try again. * *HTTP Status Code:* 500 Internal Server Error * *SOAP Fault Code Prefix:* Server * * *Code:* InvalidAccessKeyId * *Description:* The Amazon Web Services access key ID you provided does not exist in our records. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidAddressingHeader * *Description:* You must specify the Anonymous role. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidArgument * *Description:* Invalid Argument * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketName * *Description:* The specified bucket is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketState * *Description:* The request is not valid with the current state of the bucket. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidDigest * *Description:* The Content-MD5 you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidEncryptionAlgorithmError * *Description:* The encryption request you specified is not valid. The valid value is AES256. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidLocationConstraint * *Description:* The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidObjectState * *Description:* The action is not valid for the current state of the object. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPart * *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. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPartOrder * *Description:* The list of parts was not in ascending order. Parts list must be specified in order by part number. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPayer * *Description:* All access to this object has been disabled. Please contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPolicyDocument * *Description:* The content of the form does not meet the conditions specified in the policy document. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRange * *Description:* The requested range cannot be satisfied. * *HTTP Status Code:* 416 Requested Range Not Satisfiable * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Please use "AWS4-HMAC-SHA256". * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* SOAP requests must be made over an HTTPS connection. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with non-DNS compliant names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with periods (.) in their names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate endpoint only supports virtual style requests. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is not configured on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is disabled on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration cannot be enabled on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidSecurity * *Description:* The provided security credentials are not valid. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidSOAPRequest * *Description:* The SOAP request body is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidStorageClass * *Description:* The storage class you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidTargetBucketForLogging * *Description:* The target bucket for logging does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidToken * *Description:* The provided token is malformed or otherwise invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidURI * *Description:* Couldn't parse the specified URI. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* KeyTooLongError * *Description:* Your key is too long. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedACLError * *Description:* The XML you provided was not well- formed or did not validate against our published schema. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedPOSTRequest * *Description:* The body of your POST request is not well-formed multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedXML * *Description:* This happens when the user sends malformed XML (XML that doesn't conform to the published XSD) for the configuration. The error message is, "The XML you provided was not well- formed or did not validate against our published schema." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxMessageLengthExceeded * *Description:* Your request was too big. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxPostPreDataLengthExceededError * *Description:* Your POST request fields preceding the upload file were too large. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MetadataTooLarge * *Description:* Your metadata headers exceed the maximum allowed metadata size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MethodNotAllowed * *Description:* The specified method is not allowed against this resource. * *HTTP Status Code:* 405 Method Not Allowed * *SOAP Fault Code Prefix:* Client * * *Code:* MissingAttachment * *Description:* A SOAP attachment was expected, but none were found. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* MissingContentLength * *Description:* You must provide the Content- Length HTTP header. * *HTTP Status Code:* 411 Length Required * *SOAP Fault Code Prefix:* Client * * *Code:* MissingRequestBodyError * *Description:* This happens when the user sends an empty XML document as a request. The error message is, "Request body is empty." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityElement * *Description:* The SOAP 1.1 request is missing a security element. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityHeader * *Description:* Your request is missing a required header. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoLoggingStatusForKey * *Description:* There is no such thing as a logging status subresource for a key. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucket * *Description:* The specified bucket does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucketPolicy * *Description:* The specified bucket does not have a bucket policy. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchKey * *Description:* The specified key does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchLifecycleConfiguration * *Description:* The lifecycle configuration does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchUpload * *Description:* The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchVersion * *Description:* Indicates that the version ID specified in the request does not match an existing version. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NotImplemented * *Description:* A header you provided implies functionality that is not implemented. * *HTTP Status Code:* 501 Not Implemented * *SOAP Fault Code Prefix:* Server * * *Code:* NotSignedUp * *Description:* Your account is not signed up for the Amazon S3 service. You must sign up before you can use Amazon S3. You can sign up at the following URL: Amazon S3 * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* OperationAborted * *Description:* A conflicting conditional action is currently in progress against this resource. Try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* PermanentRedirect * *Description:* The bucket you are attempting to access must be addressed using the specified endpoint. Send all future requests to this endpoint. * *HTTP Status Code:* 301 Moved Permanently * *SOAP Fault Code Prefix:* Client * * *Code:* PreconditionFailed * *Description:* At least one of the preconditions you specified did not hold. * *HTTP Status Code:* 412 Precondition Failed * *SOAP Fault Code Prefix:* Client * * *Code:* Redirect * *Description:* Temporary redirect. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* RestoreAlreadyInProgress * *Description:* Object restore is already in progress. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* RequestIsNotMultiPartContent * *Description:* Bucket POST must be of the enclosure-type multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeout * *Description:* Your socket connection to the server was not read from or written to within the timeout period. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeTooSkewed * *Description:* The difference between the request time and the server's time is too large. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTorrentOfBucketError * *Description:* Requesting the torrent file of a bucket is not permitted. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* SignatureDoesNotMatch * *Description:* The request signature we calculated does not match the signature you provided. Check your Amazon Web Services secret access key and signing method. For more information, see REST Authentication and SOAP Authentication for details. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* ServiceUnavailable * *Description:* Service is unable to handle request. * *HTTP Status Code:* 503 Service Unavailable * *SOAP Fault Code Prefix:* Server * * *Code:* SlowDown * *Description:* Reduce your request rate. * *HTTP Status Code:* 503 Slow Down * *SOAP Fault Code Prefix:* Server * * *Code:* TemporaryRedirect * *Description:* You are being redirected to the bucket while DNS updates. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* TokenRefreshRequired * *Description:* The provided token must be refreshed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* TooManyBuckets * *Description:* You have attempted to create more buckets than allowed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnexpectedContent * *Description:* This request does not support content. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnresolvableGrantByEmailAddress * *Description:* The email address you provided does not match any account on record. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UserKeyMustBeSpecified * *Description:* The bucket POST must contain the specified field name. If it is specified, check the order of the fields. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * **Message** *(string) --* The error message contains a generic description of the error condition in English. It is intended for a human audience. Simple programs display the message directly to the end user if they encounter an error condition they don't know how or don't care to handle. Sophisticated programs with more exhaustive error handling and proper internationalization are more likely to ignore the error message. filter(**kwargs) Creates an iterable of all ObjectVersion resources in the collection filtered by kwargs passed to method. A ObjectVersion collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources. See also: AWS API Documentation **Request Syntax** object_version_iterator = bucket.object_versions.filter( Delimiter='string', EncodingType='url', KeyMarker='string', MaxKeys=123, Prefix='string', VersionIdMarker='string', ExpectedBucketOwner='string', RequestPayer='requester', OptionalObjectAttributes=[ 'RestoreStatus', ] ) Parameters: * **Delimiter** (*string*) -- A delimiter is a character that you specify to group keys. All keys that contain the same string between the "prefix" and the first occurrence of the delimiter are grouped under a single result element in "CommonPrefixes". These groups are counted as one result against the "max-keys" limitation. These keys are not returned elsewhere in the response. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **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. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. If additional keys satisfy the search criteria, but were not returned because "max-keys" was exceeded, the response contains "true". To return the additional keys, see "key-marker" and "version-id-marker". * **Prefix** (*string*) -- Use this parameter to select only those keys that begin with the specified prefix. You can use prefixes to separate a bucket into different groupings of keys. (You can think of using "prefix" to make groups in the same way that you'd use a folder in a file system.) You can use "prefix" with "delimiter" to roll up numerous objects into a single result under "CommonPrefixes". * **VersionIdMarker** (*string*) -- Specifies the object version you want to start listing from. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* Return type: list("s3.ObjectVersion") Returns: A list of ObjectVersion resources limit(**kwargs) Creates an iterable up to a specified amount of ObjectVersion resources in the collection. See also: AWS API Documentation **Request Syntax** object_version_iterator = bucket.object_versions.limit( count=123 ) Parameters: **count** (*integer*) -- The limit to the number of resources in the iterable. Return type: list("s3.ObjectVersion") Returns: A list of ObjectVersion resources page_size(**kwargs) Creates an iterable of all ObjectVersion resources in the collection, but limits the number of items returned by each service call by the specified amount. See also: AWS API Documentation **Request Syntax** object_version_iterator = bucket.object_versions.page_size( count=123 ) Parameters: **count** (*integer*) -- The number of items returned by each service call Return type: list("s3.ObjectVersion") Returns: A list of ObjectVersion resources Bucket / Sub-Resource / Object Object ****** S3.Bucket.Object(key) Creates a Object resource.: object = bucket.Object('key') Parameters: **key** (*string*) -- The Object's key identifier. This **must** be set. Return type: "S3.Object" Returns: A Object resource Bucket / Sub-Resource / Lifecycle Lifecycle ********* S3.Bucket.Lifecycle() Creates a BucketLifecycle resource.: bucket_lifecycle = bucket.Lifecycle() Return type: "S3.BucketLifecycle" Returns: A BucketLifecycle resource Bucket / Collection / objects objects ******* S3.Bucket.objects A collection of ObjectSummary resources.A ObjectSummary Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources. all() Creates an iterable of all ObjectSummary resources in the collection. See also: AWS API Documentation **Request Syntax** object_summary_iterator = bucket.objects.all() Return type: list("s3.ObjectSummary") Returns: A list of ObjectSummary resources delete(**kwargs) This operation enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this operation provides a suitable alternative to sending individual delete requests, reducing per- request overhead. The request can contain a list of up to 1,000 keys that you want to delete. In the XML, you provide the object key names, and optionally, version IDs if you want to delete a specific version of the object from a versioning-enabled bucket. For each key, Amazon S3 performs a delete operation and returns the result of that delete, success or failure, in the response. If the object specified in the request isn't found, Amazon S3 confirms the deletion by returning the result as deleted. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. The operation supports two modes for the response: verbose and quiet. By default, the operation uses verbose mode in which the response includes the result of deletion of each key in your request. In quiet mode the response includes only keys where the delete operation encountered an error. For a successful deletion in a quiet mode, the operation does not return any information about the delete in the response body. When performing this action on an MFA Delete enabled bucket, that attempts to delete any versioned objects, you must include an MFA token. If you do not provide one, the entire request will fail, even if there are non-versioned objects you are trying to delete. If you provide an invalid token, whether there are versioned keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: **Directory buckets** - MFA delete is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always specify the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must specify the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Content-MD5 request header * **General purpose bucket** - The Content-MD5 request header is required for all Multi-Object Delete requests. Amazon S3 uses the header value to ensure that your request body has not been altered in transit. * **Directory bucket** - The Content-MD5 request header or a additional checksum request header (including "x-amz-checksum- crc32", "x-amz-checksum-crc32c", "x-amz-checksum-sha1", or "x -amz-checksum-sha256") is required for all Multi-Object Delete requests. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket- name.s3express-zone-id.region-code.amazonaws.com". The following operations are related to "DeleteObjects": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * AbortMultipartUpload See also: AWS API Documentation **Request Syntax** response = bucket.objects.delete( MFA='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' ) Parameters: * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. When performing the "DeleteObjects" operation on an MFA delete enabled bucket, which attempts to delete the specified versioned objects, you must include an MFA token. If you don't provide an MFA token, the entire request will fail, even if there are non-versioned objects that you are trying to delete. If you provide an invalid token, whether there are versioned object keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x -amz-checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Return type: dict Returns: **Response Syntax** { 'Deleted': [ { 'Key': 'string', 'VersionId': 'string', 'DeleteMarker': True|False, 'DeleteMarkerVersionId': 'string' }, ], 'RequestCharged': 'requester', 'Errors': [ { 'Key': 'string', 'VersionId': 'string', 'Code': 'string', 'Message': 'string' }, ] } **Response Structure** * *(dict) --* * **Deleted** *(list) --* Container element for a successful delete. It identifies the object that was successfully deleted. * *(dict) --* Information about the deleted object. * **Key** *(string) --* The name of the deleted object. * **VersionId** *(string) --* The version ID of the deleted object. Note: This functionality is not supported for directory buckets. * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **DeleteMarkerVersionId** *(string) --* The version ID of the delete marker created as a result of the DELETE operation. If you delete a specific object version, the value returned by this header is the version ID of the object version deleted. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **Errors** *(list) --* Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered. * *(dict) --* Container for all error elements. * **Key** *(string) --* The error key. * **VersionId** *(string) --* The version ID of the error. Note: This functionality is not supported for directory buckets. * **Code** *(string) --* The error code is a string that uniquely identifies an error condition. It is meant to be read and understood by programs that detect and handle errors by type. The following is a list of Amazon S3 error codes. For more information, see Error responses. * * *Code:* AccessDenied * *Description:* Access Denied * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AccountProblem * *Description:* There is a problem with your Amazon Web Services account that prevents the action from completing successfully. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AllAccessDisabled * *Description:* All access to this Amazon S3 resource has been disabled. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AmbiguousGrantByEmailAddress * *Description:* The email address you provided is associated with more than one account. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* AuthorizationHeaderMalformed * *Description:* The authorization header you provided is invalid. * *HTTP Status Code:* 400 Bad Request * *HTTP Status Code:* N/A * * *Code:* BadDigest * *Description:* The Content-MD5 you specified did not match what we received. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyExists * *Description:* The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyOwnedByYou * *Description:* The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all Amazon Web Services Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs). * *Code:* 409 Conflict (in all Regions except the North Virginia Region) * *SOAP Fault Code Prefix:* Client * * *Code:* BucketNotEmpty * *Description:* The bucket you tried to delete is not empty. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* CredentialsNotSupported * *Description:* This request does not support credentials. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* CrossLocationLoggingProhibited * *Description:* Cross-location logging not allowed. Buckets in one geographic location cannot log information to a bucket in another location. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooSmall * *Description:* Your proposed upload is smaller than the minimum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooLarge * *Description:* Your proposed upload exceeds the maximum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* ExpiredToken * *Description:* The provided token has expired. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IllegalVersioningConfigurationException * *Description:* Indicates that the versioning configuration specified in the request is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncompleteBody * *Description:* You did not provide the number of bytes specified by the Content-Length HTTP header * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncorrectNumberOfFilesInPostRequest * *Description:* POST requires exactly one file upload per request. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InlineDataTooLarge * *Description:* Inline data exceeds the maximum allowed size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InternalError * *Description:* We encountered an internal error. Please try again. * *HTTP Status Code:* 500 Internal Server Error * *SOAP Fault Code Prefix:* Server * * *Code:* InvalidAccessKeyId * *Description:* The Amazon Web Services access key ID you provided does not exist in our records. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidAddressingHeader * *Description:* You must specify the Anonymous role. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidArgument * *Description:* Invalid Argument * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketName * *Description:* The specified bucket is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketState * *Description:* The request is not valid with the current state of the bucket. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidDigest * *Description:* The Content-MD5 you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidEncryptionAlgorithmError * *Description:* The encryption request you specified is not valid. The valid value is AES256. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidLocationConstraint * *Description:* The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidObjectState * *Description:* The action is not valid for the current state of the object. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPart * *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. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPartOrder * *Description:* The list of parts was not in ascending order. Parts list must be specified in order by part number. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPayer * *Description:* All access to this object has been disabled. Please contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPolicyDocument * *Description:* The content of the form does not meet the conditions specified in the policy document. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRange * *Description:* The requested range cannot be satisfied. * *HTTP Status Code:* 416 Requested Range Not Satisfiable * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Please use "AWS4-HMAC-SHA256". * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* SOAP requests must be made over an HTTPS connection. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with non-DNS compliant names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with periods (.) in their names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate endpoint only supports virtual style requests. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is not configured on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is disabled on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration cannot be enabled on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidSecurity * *Description:* The provided security credentials are not valid. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidSOAPRequest * *Description:* The SOAP request body is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidStorageClass * *Description:* The storage class you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidTargetBucketForLogging * *Description:* The target bucket for logging does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidToken * *Description:* The provided token is malformed or otherwise invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidURI * *Description:* Couldn't parse the specified URI. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* KeyTooLongError * *Description:* Your key is too long. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedACLError * *Description:* The XML you provided was not well- formed or did not validate against our published schema. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedPOSTRequest * *Description:* The body of your POST request is not well-formed multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedXML * *Description:* This happens when the user sends malformed XML (XML that doesn't conform to the published XSD) for the configuration. The error message is, "The XML you provided was not well- formed or did not validate against our published schema." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxMessageLengthExceeded * *Description:* Your request was too big. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxPostPreDataLengthExceededError * *Description:* Your POST request fields preceding the upload file were too large. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MetadataTooLarge * *Description:* Your metadata headers exceed the maximum allowed metadata size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MethodNotAllowed * *Description:* The specified method is not allowed against this resource. * *HTTP Status Code:* 405 Method Not Allowed * *SOAP Fault Code Prefix:* Client * * *Code:* MissingAttachment * *Description:* A SOAP attachment was expected, but none were found. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* MissingContentLength * *Description:* You must provide the Content- Length HTTP header. * *HTTP Status Code:* 411 Length Required * *SOAP Fault Code Prefix:* Client * * *Code:* MissingRequestBodyError * *Description:* This happens when the user sends an empty XML document as a request. The error message is, "Request body is empty." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityElement * *Description:* The SOAP 1.1 request is missing a security element. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityHeader * *Description:* Your request is missing a required header. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoLoggingStatusForKey * *Description:* There is no such thing as a logging status subresource for a key. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucket * *Description:* The specified bucket does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucketPolicy * *Description:* The specified bucket does not have a bucket policy. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchKey * *Description:* The specified key does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchLifecycleConfiguration * *Description:* The lifecycle configuration does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchUpload * *Description:* The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchVersion * *Description:* Indicates that the version ID specified in the request does not match an existing version. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NotImplemented * *Description:* A header you provided implies functionality that is not implemented. * *HTTP Status Code:* 501 Not Implemented * *SOAP Fault Code Prefix:* Server * * *Code:* NotSignedUp * *Description:* Your account is not signed up for the Amazon S3 service. You must sign up before you can use Amazon S3. You can sign up at the following URL: Amazon S3 * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* OperationAborted * *Description:* A conflicting conditional action is currently in progress against this resource. Try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* PermanentRedirect * *Description:* The bucket you are attempting to access must be addressed using the specified endpoint. Send all future requests to this endpoint. * *HTTP Status Code:* 301 Moved Permanently * *SOAP Fault Code Prefix:* Client * * *Code:* PreconditionFailed * *Description:* At least one of the preconditions you specified did not hold. * *HTTP Status Code:* 412 Precondition Failed * *SOAP Fault Code Prefix:* Client * * *Code:* Redirect * *Description:* Temporary redirect. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* RestoreAlreadyInProgress * *Description:* Object restore is already in progress. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* RequestIsNotMultiPartContent * *Description:* Bucket POST must be of the enclosure-type multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeout * *Description:* Your socket connection to the server was not read from or written to within the timeout period. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeTooSkewed * *Description:* The difference between the request time and the server's time is too large. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTorrentOfBucketError * *Description:* Requesting the torrent file of a bucket is not permitted. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* SignatureDoesNotMatch * *Description:* The request signature we calculated does not match the signature you provided. Check your Amazon Web Services secret access key and signing method. For more information, see REST Authentication and SOAP Authentication for details. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* ServiceUnavailable * *Description:* Service is unable to handle request. * *HTTP Status Code:* 503 Service Unavailable * *SOAP Fault Code Prefix:* Server * * *Code:* SlowDown * *Description:* Reduce your request rate. * *HTTP Status Code:* 503 Slow Down * *SOAP Fault Code Prefix:* Server * * *Code:* TemporaryRedirect * *Description:* You are being redirected to the bucket while DNS updates. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* TokenRefreshRequired * *Description:* The provided token must be refreshed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* TooManyBuckets * *Description:* You have attempted to create more buckets than allowed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnexpectedContent * *Description:* This request does not support content. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnresolvableGrantByEmailAddress * *Description:* The email address you provided does not match any account on record. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UserKeyMustBeSpecified * *Description:* The bucket POST must contain the specified field name. If it is specified, check the order of the fields. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * **Message** *(string) --* The error message contains a generic description of the error condition in English. It is intended for a human audience. Simple programs display the message directly to the end user if they encounter an error condition they don't know how or don't care to handle. Sophisticated programs with more exhaustive error handling and proper internationalization are more likely to ignore the error message. filter(**kwargs) Creates an iterable of all ObjectSummary resources in the collection filtered by kwargs passed to method. A ObjectSummary collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources. See also: AWS API Documentation **Request Syntax** object_summary_iterator = bucket.objects.filter( Delimiter='string', EncodingType='url', Marker='string', MaxKeys=123, Prefix='string', RequestPayer='requester', ExpectedBucketOwner='string', OptionalObjectAttributes=[ 'RestoreStatus', ] ) Parameters: * **Delimiter** (*string*) -- A delimiter is a character that you use to group keys. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **Marker** (*string*) -- Marker is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. Marker can be any key in the bucket. * **MaxKeys** (*integer*) -- Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. * **Prefix** (*string*) -- Limits the response to keys that begin with the specified prefix. * **RequestPayer** (*string*) -- Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* Return type: list("s3.ObjectSummary") Returns: A list of ObjectSummary resources limit(**kwargs) Creates an iterable up to a specified amount of ObjectSummary resources in the collection. See also: AWS API Documentation **Request Syntax** object_summary_iterator = bucket.objects.limit( count=123 ) Parameters: **count** (*integer*) -- The limit to the number of resources in the iterable. Return type: list("s3.ObjectSummary") Returns: A list of ObjectSummary resources page_size(**kwargs) Creates an iterable of all ObjectSummary resources in the collection, but limits the number of items returned by each service call by the specified amount. See also: AWS API Documentation **Request Syntax** object_summary_iterator = bucket.objects.page_size( count=123 ) Parameters: **count** (*integer*) -- The number of items returned by each service call Return type: list("s3.ObjectSummary") Returns: A list of ObjectSummary resources Bucket / Action / download_fileobj download_fileobj **************** S3.Bucket.download_fileobj(Key, Fileobj, ExtraArgs=None, Callback=None, Config=None) Download an object from this bucket to a file-like-object. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart download in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('amzn-s3-demo-bucket') with open('filename', 'wb') as data: bucket.download_fileobj('mykey', data) Parameters: * **Fileobj** (*a file-like object*) -- A file-like object to download into. At a minimum, it must implement the *write* method and must accept bytes. * **Key** (*str*) -- The name of the key to download from. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the download. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the download. Bucket / Sub-Resource / Acl Acl *** S3.Bucket.Acl() Creates a BucketAcl resource.: bucket_acl = bucket.Acl() Return type: "S3.BucketAcl" Returns: A BucketAcl resource Bucket / Action / delete delete ****** S3.Bucket.delete(**kwargs) Deletes the S3 bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted. Note: * **Directory buckets** - If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - You must have the "s3:DeleteBucket" permission on the specified bucket in a policy. * **Directory bucket permissions** - You must have the "s3express:DeleteBucket" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "DeleteBucket": * CreateBucket * DeleteObject See also: AWS API Documentation **Request Syntax** response = bucket.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None Bucket / Sub-Resource / RequestPayment RequestPayment ************** S3.Bucket.RequestPayment() Creates a BucketRequestPayment resource.: bucket_request_payment = bucket.RequestPayment() Return type: "S3.BucketRequestPayment" Returns: A BucketRequestPayment resource Object / Attribute / content_disposition content_disposition ******************* S3.Object.content_disposition * *(string) --* Specifies presentational information for the object. Object / Attribute / checksum_crc32_c checksum_crc32_c **************** S3.Object.checksum_crc32_c * *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. Object / Action / restore_object restore_object ************** S3.Object.restore_object(**kwargs) Note: This operation is not supported for directory buckets. Restores an archived copy of an object back into Amazon S3 This functionality is not supported for Amazon S3 on Outposts. This action performs the following types of requests: * "restore an archive" - Restore an archived object For more information about the "S3" structure in the request body, see the following: * PutObject * Managing Access with ACLs in the *Amazon S3 User Guide* * Protecting Data Using Server-Side Encryption in the *Amazon S3 User Guide* Permissions To use this operation, you must have permissions to perform the "s3:RestoreObject" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources in the *Amazon S3 User Guide*. Restoring objects Objects that you archive to the S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive storage class, and S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep Archive tiers, are not accessible in real time. For objects in the S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive storage classes, you must first initiate a restore request, and then wait until a temporary copy of the object is available. If you want a permanent copy of the object, create a copy of it in the Amazon S3 Standard storage class in your S3 bucket. To access an archived object, you must restore the object for the duration (number of days) that you specify. For objects in the Archive Access or Deep Archive Access tiers of S3 Intelligent-Tiering, you must first initiate a restore request, and then wait until the object is moved into the Frequent Access tier. To restore a specific object version, you can provide a version ID. If you don't provide a version ID, Amazon S3 restores the current version. When restoring an archived object, you can specify one of the following data access tier options in the "Tier" element of the request body: * "Expedited" - Expedited retrievals allow you to quickly access your data stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier when occasional urgent requests for restoring archives are required. For all but the largest archived objects (250 MB+), data accessed using Expedited retrievals is typically made available within 1–5 minutes. Provisioned capacity ensures that retrieval capacity for Expedited retrievals is available when you need it. Expedited retrievals and provisioned capacity are not available for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. * "Standard" - Standard retrievals allow you to access any of your archived objects within several hours. This is the default option for retrieval requests that do not specify the retrieval option. Standard retrievals typically finish within 3–5 hours for objects stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. They typically finish within 12 hours for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. Standard retrievals are free for objects stored in S3 Intelligent-Tiering. * "Bulk" - Bulk retrievals free for objects stored in the S3 Glacier Flexible Retrieval and S3 Intelligent-Tiering storage classes, enabling you to retrieve large amounts, even petabytes, of data at no cost. Bulk retrievals typically finish within 5–12 hours for objects stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. Bulk retrievals are also the lowest-cost retrieval option when restoring objects from S3 Glacier Deep Archive. They typically finish within 48 hours for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. For more information about archive retrieval options and provisioned capacity for "Expedited" data access, see Restoring Archived Objects in the *Amazon S3 User Guide*. You can use Amazon S3 restore speed upgrade to change the restore speed to a faster speed while it is in progress. For more information, see Upgrading the speed of an in-progress restore in the *Amazon S3 User Guide*. To get the status of object restoration, you can send a "HEAD" request. Operations return the "x-amz-restore" header, which provides information about the restoration status, in the response. You can use Amazon S3 event notifications to notify you when a restore is initiated or completed. For more information, see Configuring Amazon S3 Event Notifications in the *Amazon S3 User Guide*. After restoring an archived object, you can update the restoration period by reissuing the request with a new period. Amazon S3 updates the restoration period relative to the current time and charges only for the request-there are no data transfer charges. You cannot update the restoration period when Amazon S3 is actively processing your current restore request for the object. If your bucket has a lifecycle configuration with a rule that includes an expiration action, the object expiration overrides the life span that you specify in a restore request. For example, if you restore an object copy for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the object in 3 days. For more information about lifecycle configuration, see PutBucketLifecycleConfiguration and Object Lifecycle Management in *Amazon S3 User Guide*. Responses A successful action returns either the "200 OK" or "202 Accepted" status code. * If the object is not previously restored, then Amazon S3 returns "202 Accepted" in the response. * If the object is previously restored, Amazon S3 returns "200 OK" in the response. * Special errors: * *Code: RestoreAlreadyInProgress* * *Cause: Object restore is already in progress.* * *HTTP Status Code: 409 Conflict* * *SOAP Fault Code Prefix: Client* * * *Code: GlacierExpeditedRetrievalNotAvailable* * *Cause: expedited retrievals are currently not available. Try again later. (Returned if there is insufficient capacity to process the Expedited request. This error applies only to Expedited retrievals and not to S3 Standard or Bulk retrievals.)* * *HTTP Status Code: 503* * *SOAP Fault Code Prefix: N/A* The following operations are related to "RestoreObject": * PutBucketLifecycleConfiguration * GetBucketNotificationConfiguration See also: AWS API Documentation **Request Syntax** response = object.restore_object( VersionId='string', RestoreRequest={ 'Days': 123, 'GlacierJobParameters': { 'Tier': 'Standard'|'Bulk'|'Expedited' }, 'Type': 'SELECT', 'Tier': 'Standard'|'Bulk'|'Expedited', 'Description': 'string', 'SelectParameters': { 'InputSerialization': { 'CSV': { 'FileHeaderInfo': 'USE'|'IGNORE'|'NONE', 'Comments': 'string', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string', 'AllowQuotedRecordDelimiter': True|False }, 'CompressionType': 'NONE'|'GZIP'|'BZIP2', 'JSON': { 'Type': 'DOCUMENT'|'LINES' }, 'Parquet': {} }, 'ExpressionType': 'SQL', 'Expression': 'string', 'OutputSerialization': { 'CSV': { 'QuoteFields': 'ALWAYS'|'ASNEEDED', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string' }, 'JSON': { 'RecordDelimiter': 'string' } } }, 'OutputLocation': { 'S3': { 'BucketName': 'string', 'Prefix': 'string', 'Encryption': { 'EncryptionType': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'KMSKeyId': 'string', 'KMSContext': 'string' }, 'CannedACL': 'private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', 'AccessControlList': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Tagging': { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, 'UserMetadata': [ { 'Name': 'string', 'Value': 'string' }, ], 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS' } } }, RequestPayer='requester', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **VersionId** (*string*) -- VersionId used to reference a specific version of the object. * **RestoreRequest** (*dict*) -- Container for restore job parameters. * **Days** *(integer) --* Lifetime of the active copy in days. Do not use with restores that specify "OutputLocation". The Days element is required for regular restores, and must not be provided for select requests. * **GlacierJobParameters** *(dict) --* S3 Glacier related parameters pertaining to this job. Do not use with restores that specify "OutputLocation". * **Tier** *(string) --* **[REQUIRED]** Retrieval tier at which the restore will be processed. * **Type** *(string) --* Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more Type of restore request. * **Tier** *(string) --* Retrieval tier at which the restore will be processed. * **Description** *(string) --* The optional description for the job. * **SelectParameters** *(dict) --* Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more Describes the parameters for Select job types. * **InputSerialization** *(dict) --* **[REQUIRED]** Describes the serialization format of the object. * **CSV** *(dict) --* Describes the serialization of a CSV-encoded object. * **FileHeaderInfo** *(string) --* Describes the first line of input. Valid values are: * "NONE": First line is not a header. * "IGNORE": First line is a header, but you can't use the header values to indicate the column in an expression. You can use column position (such as _1, _2, …) to indicate the column ( "SELECT s._1 FROM OBJECT s"). * "Use": First line is a header, and you can use the header value to identify a column in an expression ( "SELECT "name" FROM OBJECT"). * **Comments** *(string) --* A single character used to indicate that a row should be ignored when the character is present at the start of that row. You can specify any character to indicate a comment line. The default character is "#". Default: "#" * **QuoteEscapeCharacter** *(string) --* A single character used for escaping the quotation mark character inside an already escaped value. For example, the value """" a , b """" is parsed as "" a , b "". * **RecordDelimiter** *(string) --* A single character used to separate individual records in the input. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* A single character used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". Type: String Default: """ Ancestors: "CSV" * **AllowQuotedRecordDelimiter** *(boolean) --* Specifies that CSV field values may contain quoted record delimiters and such records should be allowed. Default value is FALSE. Setting this value to TRUE may lower performance. * **CompressionType** *(string) --* Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default Value: NONE. * **JSON** *(dict) --* Specifies JSON as object's input serialization format. * **Type** *(string) --* The type of JSON. Valid values: Document, Lines. * **Parquet** *(dict) --* Specifies Parquet as object's input serialization format. * **ExpressionType** *(string) --* **[REQUIRED]** The type of the provided expression (for example, SQL). * **Expression** *(string) --* **[REQUIRED]** Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more The expression that is used to query the object. * **OutputSerialization** *(dict) --* **[REQUIRED]** Describes how the results of the Select job are serialized. * **CSV** *(dict) --* Describes the serialization of CSV-encoded Select results. * **QuoteFields** *(string) --* Indicates whether to use quotation marks around output fields. * "ALWAYS": Always use quotation marks for output fields. * "ASNEEDED": Use quotation marks for output fields when needed. * **QuoteEscapeCharacter** *(string) --* The single character used for escaping the quote character inside an already escaped value. * **RecordDelimiter** *(string) --* A single character used to separate individual records in the output. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* The value used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". * **JSON** *(dict) --* Specifies JSON as request's output serialization format. * **RecordDelimiter** *(string) --* The value used to separate individual records in the output. If no value is specified, Amazon S3 uses a newline character ('n'). * **OutputLocation** *(dict) --* Describes the location where the restore job's output is stored. * **S3** *(dict) --* Describes an S3 location that will receive the results of the restore request. * **BucketName** *(string) --* **[REQUIRED]** The name of the bucket where the restore results will be placed. * **Prefix** *(string) --* **[REQUIRED]** The prefix that is prepended to the restore results for this request. * **Encryption** *(dict) --* Contains the type of server-side encryption used. * **EncryptionType** *(string) --* **[REQUIRED]** The server-side encryption algorithm used when storing job results in Amazon S3 (for example, AES256, "aws:kms"). * **KMSKeyId** *(string) --* If the encryption type is "aws:kms", this optional value specifies the ID of the symmetric encryption customer managed key to use for encryption of job results. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in KMS in the *Amazon Web Services Key Management Service Developer Guide*. * **KMSContext** *(string) --* If the encryption type is "aws:kms", this optional value can be used to specify the encryption context for the restore results. * **CannedACL** *(string) --* The canned ACL to apply to the restore results. * **AccessControlList** *(list) --* A list of grants that control access to the staged results. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Tagging** *(dict) --* The tag-set that is applied to the restore results. * **TagSet** *(list) --* **[REQUIRED]** A collection for a set of tags * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **UserMetadata** *(list) --* A list of metadata to store with the restore results in S3. * *(dict) --* A metadata key-value pair to store with an object. * **Name** *(string) --* Name of the object. * **Value** *(string) --* Value of the object. * **StorageClass** *(string) --* The class of storage used to store the restore results. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester', 'RestoreOutputPath': 'string' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **RestoreOutputPath** *(string) --* Indicates the path in the provided S3 output location where Select results will be restored to. Object / Attribute / bucket_key_enabled bucket_key_enabled ****************** S3.Object.bucket_key_enabled * *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server- side encryption with Key Management Service (KMS) keys (SSE-KMS). Object / Action / download_file download_file ************* S3.Object.download_file(Filename, ExtraArgs=None, Callback=None, Config=None) Download an S3 object to a file. Usage: import boto3 s3 = boto3.resource('s3') s3.Object('amzn-s3-demo-bucket', 'hello.txt').download_file('/tmp/hello.txt') Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at *S3Transfer's Usage*. Parameters: * **Filename** (*str*) -- The path to the file to download to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the download. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the transfer. Object / Action / get_available_subresources get_available_subresources ************************** S3.Object.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str Object / Attribute / sse_customer_algorithm sse_customer_algorithm ********************** S3.Object.sse_customer_algorithm * *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. Object / Attribute / metadata metadata ******** S3.Object.metadata * *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* Object / Action / put put *** S3.Object.put(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Adds an object to a bucket. Note: * Amazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the entire object to the bucket. You cannot use "PutObject" to only update a single piece of metadata for an existing object. You must put the entire object with updated metadata if you want to update some values. * If your bucket uses the bucket owner enforced setting for Object Ownership, ACLs are disabled and no longer affect permissions. All objects written to the bucket by any account will be owned by the bucket owner. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Amazon S3 is a distributed system. If it receives multiple write requests for the same object simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior: * **S3 Object Lock** - To prevent objects from being deleted or overwritten, you can use Amazon S3 Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **If-None-Match** - Uploads the object only if the object key name does not already exist in the specified bucket. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload, S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure, retry the upload. Expects the * character (asterisk). For more information, see Add preconditions to S3 operations with conditional requests in the *Amazon S3 User Guide* or RFC 7232. Note: This functionality is not supported for S3 on Outposts. * **S3 Versioning** - When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all versions of the objects. For each write request that is made to the same object, Amazon S3 automatically generates a unique version ID of that object being stored in Amazon S3. You can retrieve, replace, or delete any version of the object. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "PutObject" request includes specific headers. * "s3:PutObject" - To successfully complete the "PutObject" request, you must always have the "s3:PutObject" permission on a bucket to add an object to it. * "s3:PutObjectAcl" - To successfully change the objects ACL of your "PutObject" request, you must have the "s3:PutObjectAcl". * "s3:PutObjectTagging" - To successfully set the tag-set with your "PutObject" request, you must have the "s3:PutObjectTagging". * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Data integrity with Content-MD5 * **General purpose bucket** - To ensure that data is not corrupted traversing the network, use the "Content-MD5" header. When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 digest, you can calculate the MD5 while putting the object to Amazon S3 and compare the returned ETag to the calculated MD5 value. * **Directory bucket** - This functionality is not supported for directory buckets. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". For more information about related Amazon S3 APIs, see the following: * CopyObject * DeleteObject See also: AWS API Documentation **Request Syntax** response = object.put( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Body=b'bytes'|file, CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentLength=123, ContentMD5='string', ContentType='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', Expires=datetime(2015, 1, 1), IfMatch='string', IfNoneMatch='string', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', WriteOffsetBytes=123, Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. For more information, see Canned ACL in the *Amazon S3 User Guide*. When adding a new object, you can use headers to grant ACL- based 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. By default, all objects are private. Only the owner has full access control. For more information, see Access Control List (ACL) Overview and Managing ACLs Using the REST API in the *Amazon S3 User Guide*. If the bucket that you're uploading 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. PUT requests that contain other ACLs (for example, custom grants to certain Amazon Web Services accounts) fail and return a "400" error with the error code "AccessControlListNotSupported". For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Body** (*bytes** or **seekable file-like object*) -- Object data. * **CacheControl** (*string*) -- Can be used to specify caching behavior along the request/reply chain. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#se c14.9. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. For more information, see https://www.rfc-editor.org/rfc/rfc6266#section-4. * **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. For more information, see https://www.rfc- editor.org/rfc/rfc9110.html#field.content-encoding. * **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. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content- length. * **ContentMD5** (*string*) -- The Base64 encoded 128-bit "MD5" digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ContentType** (*string*) -- A standard MIME type describing the format of the contents. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3. * **IfMatch** (*string*) -- Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should fetch the object's ETag and retry the upload. Expects the ETag value as a string. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **IfNoneMatch** (*string*) -- Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should retry the upload. Expects the '*' (asterisk) character. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **GrantFullControl** (*string*) -- Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **WriteOffsetBytes** (*integer*) -- Specifies the offset for appending data to existing objects in bytes. The offset must be equal to the size of the existing object being appended to. If no object exists, setting this header to 0 will create a new object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm that was used when you store this object in Amazon S3 or Amazon FSx. * **General purpose buckets** - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer- provided keys (SSE-C). Amazon S3 encrypts data with server- side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. For information about object metadata, see Object Key and Metadata in the *Amazon S3 User Guide*. In the following example, the request header sets the redirect to an object (anotherPage.html) in the same bucket: "x-amz-website-redirect-location: /anotherPage.html" In the following example, the request header sets the object redirect to another website: "x-amz-website-redirect-location: http://www.example.com/" For more information about website hosting in Amazon S3, see Hosting Websites on Amazon S3 and How to Configure Website Page Redirects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key- value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. **General purpose buckets** - This value must be explicitly added during "CopyObject" operations if you want an additional encryption context for your object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want this object's Object Lock to expire. Must be formatted as a timestamp parameter. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Expiration': 'string', 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'VersionId': 'string', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'Size': 123, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Expiration** *(string) --* If the expiration is configured for the object (see PutBucketLifecycleConfiguration) in the *Amazon S3 User Guide*, the response includes this header. It includes the "expiry-date" and "rule-id" key-value pairs that provide information about object expiration. The value of the "rule- id" is URL-encoded. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **ETag** *(string) --* Entity tag for the uploaded object. **General purpose buckets** - To ensure that data is not corrupted traversing the network, for objects where the ETag is the MD5 digest of the object, you can calculate the MD5 while putting an object to Amazon S3 and compare the returned ETag to the calculated MD5 value. **Directory buckets** - The ETag for the object in a directory bucket isn't the MD5 digest of the object. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This header is present if the object was uploaded with the "CRC64NVME" checksum algorithm, or if it was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* This header specifies the checksum type of the object, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. For "PutObject" uploads, the checksum type is always "FULL_OBJECT". You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum that was specified. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **VersionId** *(string) --* Version ID of the object. If you enable versioning for a bucket, Amazon S3 automatically generates a unique version ID for the object being stored. Amazon S3 returns this ID in the response. When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of the objects. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. * **BucketKeyEnabled** *(boolean) --* Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **Size** *(integer) --* The size of the object in bytes. This value is only be present if you append to an object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. Object / Attribute / checksum_crc32 checksum_crc32 ************** S3.Object.checksum_crc32 * *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. Object / Attribute / storage_class storage_class ************* S3.Object.storage_class * *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. For more information, see Storage Classes. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Object / Attribute / missing_meta missing_meta ************ S3.Object.missing_meta * *(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. Note: This functionality is not supported for directory buckets. Object / Attribute / object_lock_retain_until_date object_lock_retain_until_date ***************************** S3.Object.object_lock_retain_until_date * *(datetime) --* The date and time when the Object Lock retention period expires. This header is only returned if the requester has the "s3:GetObjectRetention" permission. Note: This functionality is not supported for directory buckets. Object / Waiter / wait_until_exists wait_until_exists ***************** S3.Object.wait_until_exists(**kwargs) Waits until this Object is exists. This method calls "S3.Waiter.object_exists.wait()" which polls "S3.Client.head_object()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** object.wait_until_exists( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Returns: None Object / Action / upload_file upload_file *********** S3.Object.upload_file(Filename, ExtraArgs=None, Callback=None, Config=None) Upload a file to an S3 object. Usage: import boto3 s3 = boto3.resource('s3') s3.Object('amzn-s3-demo-bucket', 'hello.txt').upload_file('/tmp/hello.txt') Similar behavior as S3Transfer's upload_file() method, except that parameters are capitalized. Detailed examples can be found at *S3Transfer's Usage*. Parameters: * **Filename** (*str*) -- The path to the file to upload. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed upload arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the upload. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the transfer. Object / Attribute / content_length content_length ************** S3.Object.content_length * *(integer) --* Size of the body in bytes. Object / Attribute / object_lock_mode object_lock_mode **************** S3.Object.object_lock_mode * *(string) --* The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester has the "s3:GetObjectRetention" permission. For more information about S3 Object Lock, see Object Lock. Note: This functionality is not supported for directory buckets. Object / Attribute / checksum_type checksum_type ************* S3.Object.checksum_type * *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in "CreateMultipartUpload" request. For more information, see Checking object integrity in the Amazon S3 User Guide. Object / Action / load load **** S3.Object.load() Calls "S3.Client.head_object()" to update the attributes of the Object resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** object.load() Returns: None Object / Sub-Resource / MultipartUpload MultipartUpload *************** S3.Object.MultipartUpload(id) Creates a MultipartUpload resource.: multipart_upload = object.MultipartUpload('id') Parameters: **id** (*string*) -- The MultipartUpload's id identifier. This **must** be set. Return type: "S3.MultipartUpload" Returns: A MultipartUpload resource Object / Attribute / content_encoding content_encoding **************** S3.Object.content_encoding * *(string) --* Indicates 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. Object / Attribute / expiration expiration ********** S3.Object.expiration * *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. S3 / Resource / Object Object ****** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.Object(bucket_name, key) A resource representing an Amazon Simple Storage Service (S3) Object: import boto3 s3 = boto3.resource('s3') object = s3.Object('bucket_name','key') Parameters: * **bucket_name** (*string*) -- The Object's bucket_name identifier. This **must** be set. * **key** (*string*) -- The Object's key identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name * key Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * accept_ranges * archive_status * bucket_key_enabled * cache_control * checksum_crc32 * checksum_crc32_c * checksum_crc64_nvme * checksum_sha1 * checksum_sha256 * checksum_type * content_disposition * content_encoding * content_language * content_length * content_range * content_type * delete_marker * e_tag * expiration * expires * last_modified * metadata * missing_meta * object_lock_legal_hold_status * object_lock_mode * object_lock_retain_until_date * parts_count * replication_status * request_charged * restore * server_side_encryption * sse_customer_algorithm * sse_customer_key_md5 * ssekms_key_id * storage_class * tag_count * version_id * website_redirect_location Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * copy * copy_from * delete * download_file * download_fileobj * get * get_available_subresources * initiate_multipart_upload * load * put * reload * restore_object * upload_file * upload_fileobj Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Acl * Bucket * MultipartUpload * Version Waiters ======= Waiters provide an interface to wait for a resource to reach a specific state. For more information about waiters refer to the Resources Introduction Guide. These are the resource's available waiters: * wait_until_exists * wait_until_not_exists Object / Attribute / version_id version_id ********** S3.Object.version_id * *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. Object / Identifier / bucket_name bucket_name *********** S3.Object.bucket_name *(string)* The Object's bucket_name identifier. This **must** be set. Object / Attribute / website_redirect_location website_redirect_location ************************* S3.Object.website_redirect_location * *(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. Note: This functionality is not supported for directory buckets. Object / Waiter / wait_until_not_exists wait_until_not_exists ********************* S3.Object.wait_until_not_exists(**kwargs) Waits until this Object is not exists. This method calls "S3.Waiter.object_not_exists.wait()" which polls "S3.Client.head_object()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** object.wait_until_not_exists( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Returns: None Object / Attribute / checksum_crc64_nvme checksum_crc64_nvme ******************* S3.Object.checksum_crc64_nvme * *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. Object / Attribute / archive_status archive_status ************** S3.Object.archive_status * *(string) --* The archive state of the head object. Note: This functionality is not supported for directory buckets. Object / Attribute / content_type content_type ************ S3.Object.content_type * *(string) --* A standard MIME type describing the format of the object data. Object / Action / get get *** S3.Object.get(**kwargs) Retrieves an object from Amazon S3. In the "GetObject" request, specify the full key name for the object. **General purpose buckets** - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg", specify the object key name as "/photos/2006/February/sample.jpg". For a path-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "examplebucket", specify the object key name as "/examplebucket/photos/2006/February/sample.jpg". For more information about request types, see HTTP Host Header Bucket Specification in the *Amazon S3 User Guide*. **Directory buckets** - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "amzn-s3-demo-bucket--usw2-az1--x-s3", specify the object key name as "/photos/2006/February/sample.jpg". Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - You must have the required permissions in a policy. To use "GetObject", you must have the "READ" access to the object (or version). If you grant "READ" access to the anonymous user, the "GetObject" operation returns the object without using an authorization header. For more information, see Specifying permissions in a policy in the *Amazon S3 User Guide*. If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. If the object that you request doesn’t exist, the error that Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" error. * If you don’t have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Access Denied" error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted using SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Storage classes If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a copy using RestoreObject. Otherwise, this operation returns an "InvalidObjectState" error. For information about restoring archived objects, see Restoring Archived Objects in the *Amazon S3 User Guide*. **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". Encryption Encryption request headers, like "x-amz-server-side-encryption", should not be sent for the "GetObject" requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your "GetObject" requests for the object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. Overriding response header values through the request There are times when you want to override certain response header values of a "GetObject" response. For example, you might override the "Content-Disposition" response header value through your "GetObject" request. You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code "200 OK" is returned. The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. The response headers that you can override for the "GetObject" response are "Cache-Control", "Content-Disposition", "Content- Encoding", "Content-Language", "Content-Type", and "Expires". To override values for a set of response headers in the "GetObject" response, you can use the following query parameters in the request. * "response-cache-control" * "response-content-disposition" * "response-content-encoding" * "response-content-language" * "response-content-type" * "response-expires" Note: When you use these parameters, you must sign the request by using either an Authorization header or a presigned URL. These parameters cannot be used with an unsigned (anonymous) request.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "GetObject": * ListBuckets * GetObjectAcl See also: AWS API Documentation **Request Syntax** response = object.get( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified in this header; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" status code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified in this header; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" HTTP status code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- Downloads the specified byte range of an object. For more information about the HTTP Range header, see https://www.rfc- editor.org/rfc/rfc9110.html#name-range. Note: Amazon S3 doesn't support retrieving multiple ranges of data per "GET" request. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. By default, the "GetObject" operation returns the current version of an object. To return a different version, use the "versionId" subresource. Note: * If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. * If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. For more information about versioning, see PutBucketVersioning. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the object (for example, "AES256"). If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- Specifies the customer-provided encryption key that you originally provided for Amazon S3 to encrypt the data before storing it. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the "x-amz-server-side-encryption-customer- algorithm" header. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. Useful for downloading just a part of an object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this mode must be enabled. Return type: dict Returns: **Response Syntax** { 'Body': StreamingBody(), 'DeleteMarker': True|False, 'AcceptRanges': 'string', 'Expiration': 'string', 'Restore': 'string', 'LastModified': datetime(2015, 1, 1), 'ContentLength': 123, 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'MissingMeta': 123, 'VersionId': 'string', 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'ContentRange': 'string', 'ContentType': 'string', 'Expires': datetime(2015, 1, 1), 'ExpiresString': 'string', 'WebsiteRedirectLocation': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'Metadata': { 'string': 'string' }, 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', 'PartsCount': 123, 'TagCount': 123, 'ObjectLockMode': 'GOVERNANCE'|'COMPLIANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'ObjectLockLegalHoldStatus': 'ON'|'OFF' } **Response Structure** * *(dict) --* * **Body** ("StreamingBody") -- Object data. * **DeleteMarker** *(boolean) --* Indicates whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response. Note: * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes "x-amz-delete-marker: true" in the response. * If the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **AcceptRanges** *(string) --* Indicates that a range of bytes was specified in the request. * **Expiration** *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **Restore** *(string) --* Provides information about object restoration action and expiration time of the restored object copy. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **LastModified** *(datetime) --* Date and time when the object was last modified. **General purpose buckets** - When you specify a "versionId" of the object in your request, if the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **ContentLength** *(integer) --* Size of the body in bytes. * **ETag** *(string) --* An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in the "CreateMultipartUpload" request. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **MissingMeta** *(integer) --* This is set to the number of metadata entries not returned in the headers that are prefixed with "x-amz-meta-". 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. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. * **CacheControl** *(string) --* Specifies caching behavior along the request/reply chain. * **ContentDisposition** *(string) --* Specifies presentational information for the object. * **ContentEncoding** *(string) --* Indicates 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. * **ContentRange** *(string) --* The portion of the object returned in the response. * **ContentType** *(string) --* A standard MIME type describing the format of the object data. * **Expires** *(datetime) --* The date and time at which the object is no longer cacheable. Note: This member has been deprecated. Please use "ExpiresString" instead. * **ExpiresString** *(string) --* The raw, unparsed value of the "Expires" field. * **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. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **Metadata** *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **StorageClass** *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ReplicationStatus** *(string) --* Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule. Note: This functionality is not supported for directory buckets. * **PartsCount** *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. * **TagCount** *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** *(string) --* The Object Lock mode that's currently in place for this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date and time when this object's Object Lock will expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** *(string) --* Indicates whether this object has an active legal hold. This field is only returned if you have permission to view an object's legal hold status. Note: This functionality is not supported for directory buckets. Object / Identifier / key key *** S3.Object.key *(string)* The Object's key identifier. This **must** be set. Object / Attribute / content_language content_language **************** S3.Object.content_language * *(string) --* The language the content is in. Object / Attribute / tag_count tag_count ********* S3.Object.tag_count * *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. Object / Attribute / content_range content_range ************* S3.Object.content_range * *(string) --* The portion of the object returned in the response for a "GET" request. Object / Sub-Resource / Bucket Bucket ****** S3.Object.Bucket() Creates a Bucket resource.: bucket = object.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource Object / Attribute / accept_ranges accept_ranges ************* S3.Object.accept_ranges * *(string) --* Indicates that a range of bytes was specified. Object / Action / initiate_multipart_upload initiate_multipart_upload ************************* S3.Object.initiate_multipart_upload(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. 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 UploadPart). You also include this upload ID in the final request to either complete or abort the multipart upload request. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. Note: 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 stops charging you for storing them only after you either complete or abort a multipart upload. If you have configured a lifecycle rule to abort incomplete multipart uploads, the created multipart upload must be completed 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 Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration. Note: * **Directory buckets** - S3 Lifecycle is not supported by directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Request signing 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 Authenticating Requests (Amazon Web Services Signature Version 4) in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - To perform a multipart upload with encryption using an Key Management Service (KMS) KMS key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 Multipart upload API and permissions and Protecting data using server-side encryption with Amazon Web Services KMS in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Encryption * **General purpose buckets** - Server-side encryption is for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts it when you access it. Amazon S3 automatically encrypts all new objects that are uploaded to an S3 bucket. When doing a multipart upload, if you don't specify encryption information in your request, the encryption setting of the uploaded parts is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with an Key Management Service (KMS) key (SSE-KMS), or a customer-provided encryption key (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer- provided key to encrypt the uploaded parts. When you perform a CreateMultipartUpload operation, if you want to use a different type of encryption setting for the uploaded parts, you can request that Amazon S3 encrypts the object with a different encryption key (such as an Amazon S3 managed key, a KMS key, or a customer-provided key). When the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. If you choose to provide your own encryption key, the request headers you provide in UploadPart and UploadPartCopy requests must match the headers you used in the "CreateMultipartUpload" request. * Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key ( "aws/s3") and KMS customer managed keys stored in Key Management Service (KMS) – If you want Amazon Web Services to manage the keys used to encrypt data, specify the following headers in the request. * "x-amz-server-side-encryption" * "x-amz-server-side-encryption-aws-kms-key-id" * "x-amz-server-side-encryption-context" Note: * If you specify "x-amz-server-side-encryption:aws:kms", but don't provide "x-amz-server-side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3" key) in KMS to protect the data. * To perform a multipart upload with encryption by using an Amazon Web Services KMS key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey*" 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 Multipart upload API and permissions and Protecting data using server-side encryption with Amazon Web Services KMS in the *Amazon S3 User Guide*. * 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 is in a different account from the key, then you must have the permissions on both the key policy and your IAM user or role. * All "GET" and "PUT" requests for an object protected by KMS fail if you don't make them by using Secure Sockets Layer (SSL), Transport Layer Security (TLS), or Signature Version 4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the *Amazon S3 User Guide*. For more information about server-side encryption with KMS keys (SSE-KMS), see Protecting Data Using Server-Side Encryption with KMS keys in the *Amazon S3 User Guide*. * Use customer-provided encryption keys (SSE-C) – If you want to manage your own encryption keys, provide all the following headers in the request. * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about server-side encryption with customer- provided encryption keys (SSE-C), see Protecting data using server-side encryption with customer-provided encryption keys (SSE-C) in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz- server-side-encryption", "x-amz-server-side-encryption-aws-kms- key-id", "x-amz-server-side-encryption-context", and "x-amz- server-side-encryption-bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. Note: For directory buckets, when you perform a "CreateMultipartUpload" operation and an "UploadPartCopy" operation, the request headers you provide in the "CreateMultipartUpload" request must match the default encryption configuration of the destination bucket.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "CreateMultipartUpload": * UploadPart * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** multipart_upload = object.initiate_multipart_upload( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentType='string', Expires=datetime(2015, 1, 1), GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumType='COMPOSITE'|'FULL_OBJECT' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. Amazon S3 supports a set of predefined ACLs, known as *canned ACLs*. Each canned ACL has a predefined set of grantees and permissions. For more information, see Canned ACL in the *Amazon S3 User Guide*. By default, all objects are private. Only the owner has full access control. When uploading an object, you can grant access permissions to individual Amazon Web Services accounts or to predefined groups defined by Amazon S3. These permissions are then added to the access control list (ACL) on the new object. For more information, see Using ACLs. One way to grant the permissions using the request headers is to specify a canned ACL with the "x-amz-acl" request header. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **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. Note: For directory buckets, only the "aws-chunked" value is supported in this header field. * **ContentLanguage** (*string*) -- The language that the content is in. * **ContentType** (*string*) -- A standard MIME type describing the format of the object data. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. * **GrantFullControl** (*string*) -- Specify access permissions explicitly to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Specify access permissions explicitly to allow grantee to read the object data and its metadata. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Specify access permissions explicitly to allows grantee to read the object ACL. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Specify access permissions explicitly to allows grantee to allow grantee to write the ACL for the applicable object. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- Specifies the Object Lock mode that you want to apply to the uploaded object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- Specifies the date and time when you want the Object Lock to expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether you want to apply a legal hold to the uploaded object. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** (*string*) -- Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide. Return type: "s3.MultipartUpload" Returns: MultipartUpload resource Object / Attribute / ssekms_key_id ssekms_key_id ************* S3.Object.ssekms_key_id * *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. Object / Action / upload_fileobj upload_fileobj ************** S3.Object.upload_fileobj(Fileobj, ExtraArgs=None, Callback=None, Config=None) Upload a file-like object to this object. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart upload in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('amzn-s3-demo-bucket') obj = bucket.Object('mykey') with open('filename', 'rb') as data: obj.upload_fileobj(data) Parameters: * **Fileobj** (*a file-like object*) -- A file-like object to upload. At a minimum, it must implement the *read* method, and must return bytes. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed upload arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the upload. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the upload. Object / Attribute / delete_marker delete_marker ************* S3.Object.delete_marker * *(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. Note: This functionality is not supported for directory buckets. Object / Attribute / cache_control cache_control ************* S3.Object.cache_control * *(string) --* Specifies caching behavior along the request/reply chain. Object / Attribute / object_lock_legal_hold_status object_lock_legal_hold_status ***************************** S3.Object.object_lock_legal_hold_status * *(string) --* Specifies whether a legal hold is in effect for this object. This header is only returned if the requester has the "s3:GetObjectLegalHold" permission. This header is not returned if the specified version of this object has never had a legal hold applied. For more information about S3 Object Lock, see Object Lock. Note: This functionality is not supported for directory buckets. Object / Action / reload reload ****** S3.Object.reload() Calls "S3.Client.head_object()" to update the attributes of the Object resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** object.reload() Returns: None Object / Action / copy copy **** S3.Object.copy(CopySource, ExtraArgs=None, Callback=None, SourceClient=None, Config=None) Copy an object from one S3 location to this object. This is a managed transfer which will perform a multipart copy in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') copy_source = { 'Bucket': 'amzn-s3-demo-bucket1', 'Key': 'mykey' } bucket = s3.Bucket('amzn-s3-demo-bucket2') obj = bucket.Object('otherkey') obj.copy(copy_source) Parameters: * **CopySource** (*dict*) -- The name of the source bucket, key name of the source object, and optional version ID of the source object. The dictionary format is: "{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}". Note that the "VersionId" key is optional and may be omitted. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the copy. * **SourceClient** (*botocore** or **boto3 Client*) -- The client to be used for operation that may happen at the source object. For example, this client is used for the head_object that determines the size of the copy. If no client is provided, the current client is used as the client for the source object. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the copy. Object / Attribute / expires expires ******* S3.Object.expires * *(datetime) --* The date and time at which the object is no longer cacheable. Object / Attribute / sse_customer_key_md5 sse_customer_key_md5 ******************** S3.Object.sse_customer_key_md5 * *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer- provided encryption key. Note: This functionality is not supported for directory buckets. Object / Attribute / parts_count parts_count *********** S3.Object.parts_count * *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. Object / Attribute / checksum_sha1 checksum_sha1 ************* S3.Object.checksum_sha1 * *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. Object / Action / copy_from copy_from ********* S3.Object.copy_from(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Creates a copy of an object that is already stored in Amazon S3. Note: 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 Copy Object Using the REST Multipart Upload API. You can copy individual objects between general purpose buckets, between directory buckets, and between general purpose buckets and directory buckets. Note: * Amazon S3 supports copy operations using Multi-Region Access Points only as a destination when using the Multi-Region Access Point ARN. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. * VPC endpoints don't support cross-Region requests (including copies). If you're using VPC endpoints, your source and destination buckets should be in the same Amazon Web Services Region as your VPC endpoint. 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. For more information about how to enable a Region for your account, see Enable or disable a Region for standalone accounts in the *Amazon Web Services Account Management Guide*. Warning: 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 Bad Request" error. For more information, see Transfer Acceleration.Authentication and authorization All "CopyObject" requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the "x-amz-" prefix, including "x -amz-copy-source", must be signed. For more information, see REST Authentication. **Directory buckets** - You must use the IAM credentials to authenticate and authorize your access to the "CopyObject" API operation, instead of using the temporary security credentials through the "CreateSession" API operation. Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. Permissions You must have *read* access to the source object and *write* access to the destination bucket. * **General purpose bucket permissions** - You must have permissions in an IAM policy based on the source and destination bucket types in a "CopyObject" operation. * If the source object is in a general purpose bucket, you must have "s3:GetObject" permission to read the source object that is being copied. * If the destination bucket is a general purpose bucket, you must have "s3:PutObject" permission to write the object copy to the destination bucket. * **Directory bucket permissions** - You must have permissions in a bucket policy or an IAM identity-based policy based on the source and destination bucket types in a "CopyObject" operation. * If the source object that you want to copy is in a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to read the object. By default, the session is in the "ReadWrite" mode. If you want to restrict the access, you can explicitly set the "s3express:SessionMode" condition key to "ReadOnly" on the copy source bucket. * If the copy destination is a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to write the object to the destination. The "s3express:SessionMode" condition key can't be set to "ReadOnly" on the copy destination bucket. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. Response and special errors When the request is an HTTP 1.1 request, the response is chunk encoded. When the request is not an HTTP 1.1 request, the response would not contain the "Content-Length". You always need to read the entire response body to check if the copy succeeds. * If the copy is successful, you receive a response with information about the copied object. * A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the files. A "200 OK" response can contain either a success or an error. * 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 "200 OK" response. For example, in a cross-region copy, you may encounter throttling and receive a "200 OK" response. For more information, see Resolve the Error 200 response when copying objects to Amazon S3. The "200 OK" status code means the copy was accepted, but it doesn't mean the copy is complete. Another example is when you disconnect from Amazon S3 before the copy is complete, Amazon S3 might cancel the copy and you may receive a "200 OK" response. You must stay connected to Amazon S3 until the entire response is successfully received and processed. If you call this API operation directly, make sure to design your application to parse the content of the response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply error handling per your configuration settings (including automatically retrying the request as appropriate). If the condition persists, the SDKs throw an exception (or, for the SDKs that don't use exceptions, they return an error). Charge The copy request charge is based on the storage class and Region that you specify for the destination object. The request can also result in a data retrieval charge for the source if the source storage class bills for data retrieval. If the copy source is in a different region, the data transfer is billed to the copy source account. For pricing information, see Amazon S3 pricing. HTTP Host header syntax * **Directory buckets** - The HTTP Host header syntax is "Bucket- name.s3express-zone-id.region-code.amazonaws.com". * **Amazon S3 on Outposts** - When you use this action with S3 on Outposts through the REST API, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". The hostname isn't required when you use the Amazon Web Services CLI or SDKs. The following operations are related to "CopyObject": * PutObject * GetObject See also: AWS API Documentation **Request Syntax** response = object.copy_from( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', CacheControl='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentType='string', CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}, CopySourceIfMatch='string', CopySourceIfModifiedSince=datetime(2015, 1, 1), CopySourceIfNoneMatch='string', CopySourceIfUnmodifiedSince=datetime(2015, 1, 1), Expires=datetime(2015, 1, 1), GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Metadata={ 'string': 'string' }, MetadataDirective='COPY'|'REPLACE', TaggingDirective='COPY'|'REPLACE', ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, CopySourceSSECustomerAlgorithm='string', CopySourceSSECustomerKey='string', RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string', ExpectedSourceBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned access control list (ACL) to apply to the object. When you copy an object, the ACL metadata is not preserved and is set to "private" by default. Only the owner has full access control. To override the default ACL setting, specify a new ACL when you generate a copy request. For more information, see Using ACLs. If the destination 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * If your destination 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. * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **CacheControl** (*string*) -- Specifies the caching behavior along the request/reply chain. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. When you copy an object, if the source object has a checksum, that checksum value will be copied to the new object by default. If the "CopyObject" request does not include this "x -amz-checksum-algorithm" header, the checksum algorithm will be copied from the source object to the destination object (if it's present on the source object). You can optionally specify a different checksum algorithm to use with the "x-amz- checksum-algorithm" header. Unrecognized or unsupported values will respond with the HTTP status code "400 Bad Request". Note: For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. Indicates whether an object should be displayed in a web browser or downloaded as a file. It allows specifying the desired filename for the downloaded file. * **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. Note: For directory buckets, only the "aws-chunked" value is supported in this header field. * **ContentLanguage** (*string*) -- The language the content is in. * **ContentType** (*string*) -- A standard MIME type that describes the format of the object data. * **CopySource** (*str** or **dict*) -- **[REQUIRED]** The name of the source bucket, key name of the source object, and optional version ID of the source object. You can either provide this value as a string or a dictionary. The string form is {bucket}/{key} or {bucket}/{key}?versionId={versionId} if you want to copy a specific version. You can also provide this value as a dictionary. The dictionary format is recommended over the string format because it is more explicit. The dictionary format is: {'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}. Note that the VersionId key is optional and may be omitted. To specify an S3 access point, provide the access point ARN for the "Bucket" key in the copy source dictionary. If you want to provide the copy source for an S3 access point as a string instead of a dictionary, the ARN provided must be the full S3 access point object ARN (i.e. {accesspoint_arn}/object/{key}) * **CopySourceIfMatch** (*string*) -- Copies the object if its entity tag (ETag) matches the specified tag. If both the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request and evaluate as follows, Amazon S3 returns "200 OK" and copies the data: * "x-amz-copy-source-if-match" condition evaluates to true * "x-amz-copy-source-if-unmodified-since" condition evaluates to false * **CopySourceIfModifiedSince** (*datetime*) -- Copies the object if it has been modified since the specified time. If both the "x-amz-copy-source-if-none-match" and "x-amz-copy- source-if-modified-since" headers are present in the request and evaluate as follows, Amazon S3 returns the "412 Precondition Failed" response code: * "x-amz-copy-source-if-none-match" condition evaluates to false * "x-amz-copy-source-if-modified-since" condition evaluates to true * **CopySourceIfNoneMatch** (*string*) -- Copies the object if its entity tag (ETag) is different than the specified ETag. If both the "x-amz-copy-source-if-none-match" and "x-amz-copy- source-if-modified-since" headers are present in the request and evaluate as follows, Amazon S3 returns the "412 Precondition Failed" response code: * "x-amz-copy-source-if-none-match" condition evaluates to false * "x-amz-copy-source-if-modified-since" condition evaluates to true * **CopySourceIfUnmodifiedSince** (*datetime*) -- Copies the object if it hasn't been modified since the specified time. If both the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request and evaluate as follows, Amazon S3 returns "200 OK" and copies the data: * "x-amz-copy-source-if-match" condition evaluates to true * "x-amz-copy-source-if-unmodified-since" condition evaluates to false * **Expires** (*datetime*) -- 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. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **MetadataDirective** (*string*) -- Specifies whether the metadata is copied from the source object or replaced with metadata that's provided in the request. When copying an object, you can preserve all metadata (the default) or specify new metadata. If this header isn’t specified, "COPY" is the default behavior. **General purpose bucket** - For general purpose buckets, when you grant permissions, you can use the "s3:x-amz-metadata- directive" condition key to enforce certain metadata behavior when objects are uploaded. For more information, see Amazon S3 condition key examples in the *Amazon S3 User Guide*. Note: "x-amz-website-redirect-location" is unique to each object and is not copied when using the "x-amz-metadata-directive" header. To copy the value, you must specify "x-amz-website- redirect-location" in the request header. * **TaggingDirective** (*string*) -- Specifies whether the object tag-set is copied from the source object or replaced with the tag-set that's provided in the request. The default value is "COPY". Note: **Directory buckets** - For directory buckets in a "CopyObject" operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a "501 Not Implemented" status code. When the destination bucket is a directory bucket, you will receive a "501 Not Implemented" response in any of the following situations: * When you attempt to "COPY" the tag-set from an S3 source object that has non-empty tags. * When you attempt to "REPLACE" the tag-set of a source object and set a non-empty value to "x-amz-tagging". * When you don't set the "x-amz-tagging-directive" header and the source object has non-empty tags. This is because the default value of "x-amz-tagging-directive" is "COPY". Because only the empty tag-set is supported for directory buckets in a "CopyObject" operation, the following situations are allowed: * When you attempt to "COPY" the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a general purpose bucket source object that has non-empty tags and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and don't set the "x-amz-tagging" value of the directory bucket destination object. This is because the default value of "x-amz-tagging" is the empty value. * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a "400 Bad Request" response. Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy. With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the *Amazon S3 User Guide*. **General purpose buckets** * For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy. * When you perform a "CopyObject" operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. **Directory buckets** * For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. * To encrypt new object copies to a directory bucket with SSE- KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key ( "aws/s3") isn't supported. Your SSE- KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a "CopyObject" operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- If the "x-amz-storage-class" header is not used, the copied object will be stored in the "STANDARD" Storage Class by default. The "STANDARD" storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Note: * **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". * **Amazon S3 on Outposts** - S3 on Outposts only uses the "OUTPOSTS" Storage Class. You can use the "CopyObject" action to change the storage class of an object that is already stored in Amazon S3 by using the "x-amz-storage-class" header. For more information, see Storage Classes in the *Amazon S3 User Guide*. Before using an object as a source object for the copy operation, you must restore a copy of it if it meets any of the following conditions: * The storage class of the source object is "GLACIER" or "DEEP_ARCHIVE". * The storage class of the source object is "INTELLIGENT_TIERING" and it's S3 Intelligent-Tiering access tier is "Archive Access" or "Deep Archive Access". For more information, see RestoreObject and Copying Objects in the *Amazon S3 User Guide*. * **WebsiteRedirectLocation** (*string*) -- If the destination bucket is configured as a website, redirects requests for this object copy to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. This value is unique to each object and is not copied when using the "x-amz- metadata-directive" header. Instead, you may opt to provide this header in combination with the "x-amz-metadata-directive" header. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). When you perform a "CopyObject" operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 S3 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. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the destination bucket is a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the *Amazon S3 User Guide*. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. **General purpose buckets** - This value must be explicitly added to specify encryption context for "CopyObject" requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key. For more information, see Amazon S3 Bucket Keys in the *Amazon S3 User Guide*. Note: **Directory buckets** - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **CopySourceSSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the source object (for example, "AES256"). If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. * **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 the same one that was used when the source object was created. If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. * **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 that the encryption key was transmitted without error. If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object copy in the destination bucket. This value must be used in conjunction with the "x-amz- tagging-directive" if you choose "REPLACE" for the "x-amz- tagging-directive". If you choose "COPY" for the "x-amz- tagging-directive", you don't need to set the "x-amz-tagging" header, because the tag-set will be copied from the source object directly. The tag-set must be encoded as URL Query parameters. The default value is the empty value. Note: **Directory buckets** - For directory buckets in a "CopyObject" operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a "501 Not Implemented" status code. When the destination bucket is a directory bucket, you will receive a "501 Not Implemented" response in any of the following situations: * When you attempt to "COPY" the tag-set from an S3 source object that has non-empty tags. * When you attempt to "REPLACE" the tag-set of a source object and set a non-empty value to "x-amz-tagging". * When you don't set the "x-amz-tagging-directive" header and the source object has non-empty tags. This is because the default value of "x-amz-tagging-directive" is "COPY". Because only the empty tag-set is supported for directory buckets in a "CopyObject" operation, the following situations are allowed: * When you attempt to "COPY" the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a general purpose bucket source object that has non-empty tags and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and don't set the "x-amz-tagging" value of the directory bucket destination object. This is because the default value of "x-amz-tagging" is the empty value. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to the object copy. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want the Object Lock of the object copy to expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether you want to apply a legal hold to the object copy. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ExpectedSourceBucketOwner** (*string*) -- The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'CopyObjectResult': { 'ETag': 'string', 'LastModified': datetime(2015, 1, 1), 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, 'Expiration': 'string', 'CopySourceVersionId': 'string', 'VersionId': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **CopyObjectResult** *(dict) --* Container for all response elements. * **ETag** *(string) --* Returns the ETag of the new object. The ETag reflects only changes to the contents of an object, not its metadata. * **LastModified** *(datetime) --* Creation date of the object. * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This checksum is present if the object being copied was uploaded with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expiration** *(string) --* If the object expiration is configured, the response includes this header. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **CopySourceVersionId** *(string) --* Version ID of the source object that was copied. Note: This functionality is not supported when the source object is in a directory bucket. * **VersionId** *(string) --* Version ID of the newly created copy. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs. * **BucketKeyEnabled** *(boolean) --* Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. Object / Attribute / e_tag e_tag ***** S3.Object.e_tag * *(string) --* An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. Object / Sub-Resource / Version Version ******* S3.Object.Version(id) Creates a ObjectVersion resource.: object_version = object.Version('id') Parameters: **id** (*string*) -- The Version's id identifier. This **must** be set. Return type: "S3.ObjectVersion" Returns: A ObjectVersion resource Object / Action / download_fileobj download_fileobj **************** S3.Object.download_fileobj(Fileobj, ExtraArgs=None, Callback=None, Config=None) Download this object from S3 to a file-like object. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart download in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket('amzn-s3-demo-bucket') obj = bucket.Object('mykey') with open('filename', 'wb') as data: obj.download_fileobj(data) Parameters: * **Fileobj** (*a file-like object*) -- A file-like object to download into. At a minimum, it must implement the *write* method and must accept bytes. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the download. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the download. Object / Attribute / replication_status replication_status ****************** S3.Object.replication_status * *(string) --* Amazon S3 can return this header if your request involves a bucket that is either a source or a destination in a replication rule. In replication, you have a source bucket on which you configure replication and destination bucket or buckets where Amazon S3 stores object replicas. When you request an object ( "GetObject") or object metadata ( "HeadObject") from these buckets, Amazon S3 will return the "x-amz-replication-status" header in the response as follows: * **If requesting an object from the source bucket**, Amazon S3 will return the "x-amz-replication-status" header if the object in your request is eligible for replication. For example, suppose that in your replication configuration, you specify object prefix "TaxDocs" requesting Amazon S3 to replicate objects with key prefix "TaxDocs". Any objects you upload with this key name prefix, for example "TaxDocs/document1.pdf", are eligible for replication. For any object request with this key name prefix, Amazon S3 will return the "x-amz-replication- status" header with value PENDING, COMPLETED or FAILED indicating object replication status. * **If requesting an object from a destination bucket**, Amazon S3 will return the "x-amz-replication-status" header with value REPLICA if the object in your request is a replica that Amazon S3 created and there is no replica modification replication in progress. * **When replicating objects to multiple destination buckets**, the "x-amz-replication-status" header acts differently. The header of the source object will only return a value of COMPLETED when replication is successful to all destinations. The header will remain at value PENDING until replication has completed for all destinations. If one or more destinations fails replication the header will return FAILED. For more information, see Replication. Note: This functionality is not supported for directory buckets. Object / Attribute / request_charged request_charged *************** S3.Object.request_charged * *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. Object / Attribute / checksum_sha256 checksum_sha256 *************** S3.Object.checksum_sha256 * *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. Object / Sub-Resource / Acl Acl *** S3.Object.Acl() Creates a ObjectAcl resource.: object_acl = object.Acl() Return type: "S3.ObjectAcl" Returns: A ObjectAcl resource Object / Attribute / last_modified last_modified ************* S3.Object.last_modified * *(datetime) --* Date and time when the object was last modified. Object / Action / delete delete ****** S3.Object.delete(**kwargs) Removes an object from a bucket. The behavior depends on the bucket's versioning state: * If bucket versioning is not enabled, the operation permanently deletes the object. * If bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the object. To permanently delete an object in a versioned bucket, you must include the object’s "versionId" in the request. For more information about versioning-enabled buckets, see Deleting object versions from a versioning-enabled bucket. * If bucket versioning is suspended, the operation removes the object that has a null "versionId", if there is one, and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null "versionId", and all versions of the object have a "versionId", Amazon S3 does not remove the object and only inserts a delete marker. To permanently delete an object that has a "versionId", you must include the object’s "versionId" in the request. For more information about versioning-suspended buckets, see Deleting objects from versioning-suspended buckets. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. To remove a specific version, you must use the "versionId" query parameter. Using this query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3 sets the response header "x-amz-delete-marker" to true. If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include the "x-amz-mfa" request header in the DELETE "versionId" request. Requests that include "x-amz-mfa" must use HTTPS. For more information about MFA Delete, see Using MFA Delete in the *Amazon S3 User Guide*. To see sample requests that use versioning, see Sample Request. Note: **Directory buckets** - MFA delete is not supported by directory buckets. You can delete objects by explicitly calling DELETE Object or calling ( PutBucketLifecycle) to enable Amazon S3 to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them the "s3:DeleteObject", "s3:DeleteObjectVersion", and "s3:PutLifeCycleConfiguration" actions. Note: **Directory buckets** - S3 Lifecycle is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always have the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must have the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following action is related to "DeleteObject": * PutObject See also: AWS API Documentation **Request Syntax** response = object.delete( MFA='string', VersionId='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', IfMatch='string', IfMatchLastModifiedTime=datetime(2015, 1, 1), IfMatchSize=123 ) Parameters: * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatch** (*string*) -- The "If-Match" header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a "412 Precondition Failed" error. If the ETag matches or if the object doesn't exist, the operation will return a "204 Success (No Content) response". For more information about conditional requests, see RFC 7232. Note: This functionality is only supported for directory buckets. * **IfMatchLastModifiedTime** (*datetime*) -- If present, the object is deleted only if its modification times matches the provided "Timestamp". If the "Timestamp" values do not match, the operation returns a "412 Precondition Failed" error. If the "Timestamp" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. * **IfMatchSize** (*integer*) -- If present, the object is deleted only if its size matches the provided size in bytes. If the "Size" value does not match, the operation returns a "412 Precondition Failed" error. If the "Size" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. Warning: You can use the "If-Match", "x-amz-if-match-last-modified- time" and "x-amz-if-match-size" conditional headers in conjunction with each-other or individually. Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'VersionId': 'string', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Returns the version ID of the delete marker created as a result of the DELETE operation. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. Object / Attribute / restore restore ******* S3.Object.restore * *(string) --* If the object is an archived object (an object whose storage class is GLACIER), the response includes this header if either the archive restoration is in progress (see RestoreObject or an archive copy is already restored. If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to delete the object copy. For example: "x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 GMT"" If the object restoration is in progress, the header returns the value "ongoing-request="true"". For more information about archiving objects, see Transitioning Objects: General Considerations. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Object / Attribute / server_side_encryption server_side_encryption ********************** S3.Object.server_side_encryption * *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". BucketPolicy / Action / get_available_subresources get_available_subresources ************************** S3.BucketPolicy.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketPolicy / Action / put put *** S3.BucketPolicy.put(**kwargs) Applies an Amazon S3 bucket policy to an Amazon S3 bucket. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must both have the "PutBucketPolicy" permissions on the specified bucket and belong to the bucket owner's account in order to use this operation. If you don't have "PutBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: To ensure that bucket owners don't inadvertently lock themselves out of their own buckets, the root principal in a bucket owner's Amazon Web Services account can perform the "GetBucketPolicy", "PutBucketPolicy", and "DeleteBucketPolicy" API actions, even if their bucket policy explicitly denies the root principal's access. Bucket owner root principals can only be blocked from performing these API actions by VPC endpoint policies and Amazon Web Services Organizations policies. * **General purpose bucket permissions** - The "s3:PutBucketPolicy" permission is required in a policy. For more information about general purpose buckets bucket policies, see Using Bucket Policies and User Policies in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:PutBucketPolicy" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. Example bucket policies **General purpose buckets example bucket policies** - See Bucket policy examples in the *Amazon S3 User Guide*. **Directory bucket example bucket policies** - See Example bucket policies for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "PutBucketPolicy": * CreateBucket * DeleteBucket See also: AWS API Documentation **Request Syntax** response = bucket_policy.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ConfirmRemoveSelfBucketAccess=True|False, Policy='string', ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. Note: For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ConfirmRemoveSelfBucketAccess** (*boolean*) -- Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future. Note: This functionality is not supported for directory buckets. * **Policy** (*string*) -- **[REQUIRED]** The bucket policy as a JSON document. For directory buckets, the only IAM action supported in the bucket policy is "s3express:CreateSession". * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None BucketPolicy / Action / load load **** S3.BucketPolicy.load() Calls "S3.Client.get_bucket_policy()" to update the attributes of the BucketPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_policy.load() Returns: None S3 / Resource / BucketPolicy BucketPolicy ************ Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketPolicy(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketPolicy: import boto3 s3 = boto3.resource('s3') bucket_policy = s3.BucketPolicy('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketPolicy's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * policy Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketPolicy / Identifier / bucket_name bucket_name *********** S3.BucketPolicy.bucket_name *(string)* The BucketPolicy's bucket_name identifier. This **must** be set. BucketPolicy / Attribute / policy policy ****** S3.BucketPolicy.policy * *(string) --* The bucket policy as a JSON document. BucketPolicy / Sub-Resource / Bucket Bucket ****** S3.BucketPolicy.Bucket() Creates a Bucket resource.: bucket = bucket_policy.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketPolicy / Action / reload reload ****** S3.BucketPolicy.reload() Calls "S3.Client.get_bucket_policy()" to update the attributes of the BucketPolicy resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_policy.reload() Returns: None BucketPolicy / Action / delete delete ****** S3.BucketPolicy.delete(**kwargs) Deletes the policy of a specified bucket. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must both have the "DeleteBucketPolicy" permissions on the specified bucket and belong to the bucket owner's account in order to use this operation. If you don't have "DeleteBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: To ensure that bucket owners don't inadvertently lock themselves out of their own buckets, the root principal in a bucket owner's Amazon Web Services account can perform the "GetBucketPolicy", "PutBucketPolicy", and "DeleteBucketPolicy" API actions, even if their bucket policy explicitly denies the root principal's access. Bucket owner root principals can only be blocked from performing these API actions by VPC endpoint policies and Amazon Web Services Organizations policies. * **General purpose bucket permissions** - The "s3:DeleteBucketPolicy" permission is required in a policy. For more information about general purpose buckets bucket policies, see Using Bucket Policies and User Policies in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:DeleteBucketPolicy" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "DeleteBucketPolicy" * CreateBucket * DeleteObject See also: AWS API Documentation **Request Syntax** response = bucket_policy.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None BucketAcl / Action / get_available_subresources get_available_subresources ************************** S3.BucketAcl.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketAcl / Action / put put *** S3.BucketAcl.put(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Sets the permissions on an existing bucket using access control lists (ACL). For more information, see Using ACLs. To set the ACL of a bucket, you must have the "WRITE_ACP" permission. You can use one of the following two ways to set a bucket's permissions: * Specify the ACL in the request body * Specify permissions using request headers Note: You cannot specify access permission using both the body and the request headers. Depending on your application needs, you may choose to set the ACL on a bucket using either the request body or the headers. For example, if you have an existing application that updates a bucket ACL using the request body, then you can continue to use that approach. Warning: If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. You must use policies to grant access to your bucket and the objects in it. Requests to set ACLs or update ACLs fail and return the "AccessControlListNotSupported" error code. Requests to read ACLs are still supported. For more information, see Controlling object ownership in the *Amazon S3 User Guide*.Permissions You can set access permissions by using one of the following methods: * Specify a canned ACL with the "x-amz-acl" request header. Amazon S3 supports a set of predefined ACLs, known as *canned ACLs*. Each canned ACL has a predefined set of grantees and permissions. Specify the canned ACL name as the value of "x-amz-acl". If you use this header, you cannot use other access control-specific headers in your request. For more information, see Canned ACL. * Specify access permissions explicitly with the "x-amz-grant- read", "x-amz-grant-read-acp", "x-amz-grant-write-acp", and "x -amz-grant-full-control" headers. When using these headers, you specify explicit access permissions and grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the permission. If you use these ACL-specific headers, you cannot use the "x-amz-acl" header to set a canned ACL. These parameters map to the set of permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-write" header grants create, overwrite, and delete objects permission to LogDelivery group predefined by Amazon S3 and two Amazon Web Services accounts identified by their email addresses. "x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", id="111122223333", id="555566667777"" You can use either a canned ACL or specify access permissions explicitly. You cannot do both. Grantee Values You can specify the person (grantee) to whom you're assigning access rights (using request elements) in the following ways. For examples of how to specify these grantee values in JSON format, see the Amazon Web Services CLI example in Enabling Amazon S3 server access logging in the *Amazon S3 User Guide*. * By the person's ID: "<>ID<><>GranteesEmail<> " DisplayName is optional and ignored in the request * By URI: "<>http://acs.amazonaws.com/group s/global/AuthenticatedUsers<>" * By Email address: "<>Grantees@email.com<>&" The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the CanonicalUser. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. The following operations are related to "PutBucketAcl": * CreateBucket * DeleteBucket * GetObjectAcl See also: AWS API Documentation **Request Syntax** response = bucket_acl.put( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', AccessControlPolicy={ 'Grants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Owner': { 'DisplayName': 'string', 'ID': 'string' } }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the bucket. * **AccessControlPolicy** (*dict*) -- Contains the elements that set the ACL permissions for an object per grantee. * **Grants** *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Owner** *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **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 new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketAcl / Attribute / grants grants ****** S3.BucketAcl.grants * *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. BucketAcl / Attribute / owner owner ***** S3.BucketAcl.owner * *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. BucketAcl / Action / load load **** S3.BucketAcl.load() Calls "S3.Client.get_bucket_acl()" to update the attributes of the BucketAcl resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_acl.load() Returns: None S3 / Resource / BucketAcl BucketAcl ********* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketAcl(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketAcl: import boto3 s3 = boto3.resource('s3') bucket_acl = s3.BucketAcl('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketAcl's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * grants * owner Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketAcl / Identifier / bucket_name bucket_name *********** S3.BucketAcl.bucket_name *(string)* The BucketAcl's bucket_name identifier. This **must** be set. BucketAcl / Sub-Resource / Bucket Bucket ****** S3.BucketAcl.Bucket() Creates a Bucket resource.: bucket = bucket_acl.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketAcl / Action / reload reload ****** S3.BucketAcl.reload() Calls "S3.Client.get_bucket_acl()" to update the attributes of the BucketAcl resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_acl.reload() Returns: None S3 / Waiter / BucketExists BucketExists ************ class S3.Waiter.BucketExists waiter = client.get_waiter('bucket_exists') wait(**kwargs) Polls "S3.Client.head_bucket()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** waiter.wait( Bucket='string', ExpectedBucketOwner='string', WaiterConfig={ 'Delay': 123, 'MaxAttempts': 123 } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **Object Lambda access points** - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **WaiterConfig** (*dict*) -- A dictionary that provides parameters to control waiting behavior. * **Delay** *(integer) --* The amount of time in seconds to wait between attempts. Default: 5 * **MaxAttempts** *(integer) --* The maximum number of attempts to be made. Default: 20 Returns: None S3 / Waiter / ObjectExists ObjectExists ************ class S3.Waiter.ObjectExists waiter = client.get_waiter('object_exists') wait(**kwargs) Polls "S3.Client.head_object()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** waiter.wait( Bucket='string', IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Key='string', Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED', WaiterConfig={ 'Delay': 123, 'MaxAttempts': 123 } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket that contains the object. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Key** (*string*) -- **[REQUIRED]** The object key. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. * **WaiterConfig** (*dict*) -- A dictionary that provides parameters to control waiting behavior. * **Delay** *(integer) --* The amount of time in seconds to wait between attempts. Default: 5 * **MaxAttempts** *(integer) --* The maximum number of attempts to be made. Default: 20 Returns: None S3 / Waiter / ObjectNotExists ObjectNotExists *************** class S3.Waiter.ObjectNotExists waiter = client.get_waiter('object_not_exists') wait(**kwargs) Polls "S3.Client.head_object()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** waiter.wait( Bucket='string', IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Key='string', Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED', WaiterConfig={ 'Delay': 123, 'MaxAttempts': 123 } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket that contains the object. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Key** (*string*) -- **[REQUIRED]** The object key. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. * **WaiterConfig** (*dict*) -- A dictionary that provides parameters to control waiting behavior. * **Delay** *(integer) --* The amount of time in seconds to wait between attempts. Default: 5 * **MaxAttempts** *(integer) --* The maximum number of attempts to be made. Default: 20 Returns: None S3 / Waiter / BucketNotExists BucketNotExists *************** class S3.Waiter.BucketNotExists waiter = client.get_waiter('bucket_not_exists') wait(**kwargs) Polls "S3.Client.head_bucket()" every 5 seconds until a successful state is reached. An error is raised after 20 failed checks. See also: AWS API Documentation **Request Syntax** waiter.wait( Bucket='string', ExpectedBucketOwner='string', WaiterConfig={ 'Delay': 123, 'MaxAttempts': 123 } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **Object Lambda access points** - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **WaiterConfig** (*dict*) -- A dictionary that provides parameters to control waiting behavior. * **Delay** *(integer) --* The amount of time in seconds to wait between attempts. Default: 5 * **MaxAttempts** *(integer) --* The maximum number of attempts to be made. Default: 20 Returns: None ObjectAcl / Action / get_available_subresources get_available_subresources ************************** S3.ObjectAcl.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str ObjectAcl / Action / put put *** S3.ObjectAcl.put(**kwargs) Note: This operation is not supported for directory buckets. Uses the "acl" subresource to set the access control list (ACL) permissions for a new or existing object in an S3 bucket. You must have the "WRITE_ACP" permission to set the ACL of an object. For more information, see What permissions can I grant? in the *Amazon S3 User Guide*. This functionality is not supported for Amazon S3 on Outposts. Depending on your application needs, you can choose to set the ACL on an object using either the request body or the headers. For example, if you have an existing application that updates a bucket ACL using the request body, you can continue to use that approach. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. Warning: If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. You must use policies to grant access to your bucket and the objects in it. Requests to set ACLs or update ACLs fail and return the "AccessControlListNotSupported" error code. Requests to read ACLs are still supported. For more information, see Controlling object ownership in the *Amazon S3 User Guide*.Permissions You can set access permissions using one of the following methods: * Specify a canned ACL with the "x-amz-acl" request header. Amazon S3 supports a set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify the canned ACL name as the value of >>``<<>ID<><>GranteesEmail<> " DisplayName is optional and ignored in the request. * By URI: "<>http://acs.amazonaws.com/group s/global/AuthenticatedUsers<>" * By Email address: "<>Grantees@email.com<>lt;/Grantee>" The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the CanonicalUser. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference.Versioning The ACL of an object is set at the object version level. By default, PUT sets the ACL of the current version of an object. To set the ACL of a different version, use the "versionId" subresource. The following operations are related to "PutObjectAcl": * CopyObject * GetObject See also: AWS API Documentation **Request Syntax** response = object_acl.put( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', AccessControlPolicy={ 'Grants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Owner': { 'DisplayName': 'string', 'ID': 'string' } }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', RequestPayer='requester', VersionId='string', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. For more information, see Canned ACL. * **AccessControlPolicy** (*dict*) -- Contains the elements that set the ACL permissions for an object per grantee. * **Grants** *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Owner** *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **GrantFullControl** (*string*) -- Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to list the objects in the bucket. This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the bucket ACL. This functionality is not supported for Amazon S3 on Outposts. * **GrantWrite** (*string*) -- Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. This functionality is not supported for Amazon S3 on Outposts. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. ObjectAcl / Attribute / grants grants ****** S3.ObjectAcl.grants * *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. ObjectAcl / Attribute / owner owner ***** S3.ObjectAcl.owner * *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. ObjectAcl / Action / load load **** S3.ObjectAcl.load() Calls "S3.Client.get_object_acl()" to update the attributes of the ObjectAcl resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** object_acl.load() Returns: None S3 / Resource / ObjectAcl ObjectAcl ********* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.ObjectAcl(bucket_name, object_key) A resource representing an Amazon Simple Storage Service (S3) ObjectAcl: import boto3 s3 = boto3.resource('s3') object_acl = s3.ObjectAcl('bucket_name','object_key') Parameters: * **bucket_name** (*string*) -- The ObjectAcl's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The ObjectAcl's object_key identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name * object_key Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * grants * owner * request_charged Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Object ObjectAcl / Identifier / bucket_name bucket_name *********** S3.ObjectAcl.bucket_name *(string)* The ObjectAcl's bucket_name identifier. This **must** be set. ObjectAcl / Action / reload reload ****** S3.ObjectAcl.reload() Calls "S3.Client.get_object_acl()" to update the attributes of the ObjectAcl resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** object_acl.reload() Returns: None ObjectAcl / Sub-Resource / Object Object ****** S3.ObjectAcl.Object() Creates a Object resource.: object = object_acl.Object() Return type: "S3.Object" Returns: A Object resource ObjectAcl / Identifier / object_key object_key ********** S3.ObjectAcl.object_key *(string)* The ObjectAcl's object_key identifier. This **must** be set. ObjectAcl / Attribute / request_charged request_charged *************** S3.ObjectAcl.request_charged * *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. ServiceResource / Sub-Resource / BucketWebsite BucketWebsite ************* S3.ServiceResource.BucketWebsite(bucket_name) Creates a BucketWebsite resource.: bucket_website = s3.BucketWebsite('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketWebsite's bucket_name identifier. This **must** be set. Return type: "S3.BucketWebsite" Returns: A BucketWebsite resource ServiceResource / Sub-Resource / BucketTagging BucketTagging ************* S3.ServiceResource.BucketTagging(bucket_name) Creates a BucketTagging resource.: bucket_tagging = s3.BucketTagging('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketTagging's bucket_name identifier. This **must** be set. Return type: "S3.BucketTagging" Returns: A BucketTagging resource ServiceResource / Sub-Resource / BucketVersioning BucketVersioning **************** S3.ServiceResource.BucketVersioning(bucket_name) Creates a BucketVersioning resource.: bucket_versioning = s3.BucketVersioning('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketVersioning's bucket_name identifier. This **must** be set. Return type: "S3.BucketVersioning" Returns: A BucketVersioning resource ServiceResource / Sub-Resource / BucketCors BucketCors ********** S3.ServiceResource.BucketCors(bucket_name) Creates a BucketCors resource.: bucket_cors = s3.BucketCors('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketCors's bucket_name identifier. This **must** be set. Return type: "S3.BucketCors" Returns: A BucketCors resource ServiceResource / Action / get_available_subresources get_available_subresources ************************** S3.ServiceResource.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str ServiceResource / Sub-Resource / ObjectSummary ObjectSummary ************* S3.ServiceResource.ObjectSummary(bucket_name, key) Creates a ObjectSummary resource.: object_summary = s3.ObjectSummary('bucket_name','key') Parameters: * **bucket_name** (*string*) -- The ObjectSummary's bucket_name identifier. This **must** be set. * **key** (*string*) -- The ObjectSummary's key identifier. This **must** be set. Return type: "S3.ObjectSummary" Returns: A ObjectSummary resource ServiceResource / Sub-Resource / BucketAcl BucketAcl ********* S3.ServiceResource.BucketAcl(bucket_name) Creates a BucketAcl resource.: bucket_acl = s3.BucketAcl('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketAcl's bucket_name identifier. This **must** be set. Return type: "S3.BucketAcl" Returns: A BucketAcl resource ServiceResource / Sub-Resource / MultipartUpload MultipartUpload *************** S3.ServiceResource.MultipartUpload(bucket_name, object_key, id) Creates a MultipartUpload resource.: multipart_upload = s3.MultipartUpload('bucket_name','object_key','id') Parameters: * **bucket_name** (*string*) -- The MultipartUpload's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The MultipartUpload's object_key identifier. This **must** be set. * **id** (*string*) -- The MultipartUpload's id identifier. This **must** be set. Return type: "S3.MultipartUpload" Returns: A MultipartUpload resource ServiceResource / Collection / buckets buckets ******* S3.ServiceResource.buckets A collection of Bucket resources.A Bucket Collection will include all resources by default, and extreme caution should be taken when performing actions on all resources. all() Creates an iterable of all Bucket resources in the collection. See also: AWS API Documentation **Request Syntax** bucket_iterator = s3.buckets.all() Return type: list("s3.Bucket") Returns: A list of Bucket resources filter(**kwargs) Creates an iterable of all Bucket resources in the collection filtered by kwargs passed to method. A Bucket collection will include all resources by default if no filters are provided, and extreme caution should be taken when performing actions on all resources. See also: AWS API Documentation **Request Syntax** bucket_iterator = s3.buckets.filter( MaxBuckets=123, ContinuationToken='string', Prefix='string', BucketRegion='string' ) Parameters: * **MaxBuckets** (*integer*) -- Maximum number of buckets to be returned in response. When the number is more than the count of buckets that are owned by an Amazon Web Services account, return all the buckets in response. * **ContinuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on this bucket with a token. "ContinuationToken" is obfuscated and is not a real key. You can use this "ContinuationToken" for pagination of the list results. Length Constraints: Minimum length of 0. Maximum length of 1024. Required: No. Note: If you specify the "bucket-region", "prefix", or "continuation-token" query parameters without using "max- buckets" to set the maximum number of buckets returned in the response, Amazon S3 applies a default page size of 10,000 and provides a continuation token if there are more buckets. * **Prefix** (*string*) -- Limits the response to bucket names that begin with the specified bucket name prefix. * **BucketRegion** (*string*) -- Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services Region must be expressed according to the Amazon Web Services Region code, such as "us-west-2" for the US West (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints. Note: Requests made to a Regional endpoint that is different from the "bucket-region" parameter are not supported. For example, if you want to limit the response to your buckets in Region "us-west-2", the request must be made to an endpoint in Region "us-west-2". Return type: list("s3.Bucket") Returns: A list of Bucket resources limit(**kwargs) Creates an iterable up to a specified amount of Bucket resources in the collection. See also: AWS API Documentation **Request Syntax** bucket_iterator = s3.buckets.limit( count=123 ) Parameters: **count** (*integer*) -- The limit to the number of resources in the iterable. Return type: list("s3.Bucket") Returns: A list of Bucket resources page_size(**kwargs) Creates an iterable of all Bucket resources in the collection, but limits the number of items returned by each service call by the specified amount. See also: AWS API Documentation **Request Syntax** bucket_iterator = s3.buckets.page_size( count=123 ) Parameters: **count** (*integer*) -- The number of items returned by each service call Return type: list("s3.Bucket") Returns: A list of Bucket resources S3 / Resource / ServiceResource Service Resource **************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.ServiceResource A resource representing Amazon Simple Storage Service (S3): import boto3 s3 = boto3.resource('s3') Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * create_bucket * get_available_subresources Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket * BucketAcl * BucketCors * BucketLifecycle * BucketLifecycleConfiguration * BucketLogging * BucketNotification * BucketPolicy * BucketRequestPayment * BucketTagging * BucketVersioning * BucketWebsite * MultipartUpload * MultipartUploadPart * Object * ObjectAcl * ObjectSummary * ObjectVersion Collections =========== Collections provide an interface to iterate over and manipulate groups of resources. For more information about collections refer to the Resources Introduction Guide. These are the resource's available collections: * buckets ServiceResource / Sub-Resource / ObjectVersion ObjectVersion ************* S3.ServiceResource.ObjectVersion(bucket_name, object_key, id) Creates a ObjectVersion resource.: object_version = s3.ObjectVersion('bucket_name','object_key','id') Parameters: * **bucket_name** (*string*) -- The ObjectVersion's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The ObjectVersion's object_key identifier. This **must** be set. * **id** (*string*) -- The ObjectVersion's id identifier. This **must** be set. Return type: "S3.ObjectVersion" Returns: A ObjectVersion resource ServiceResource / Action / create_bucket create_bucket ************* S3.ServiceResource.create_bucket(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts bucket, see CreateBucket. Creates a new S3 bucket. To create a bucket, you must set up 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. There are two types of buckets: general purpose buckets and directory buckets. For more information about these bucket types, see Creating, configuring, and working with Amazon S3 buckets in the *Amazon S3 User Guide*. Note: * **General purpose buckets** - If you send your "CreateBucket" request to the "s3.amazonaws.com" global endpoint, the request goes to the "us-east-1" Region. So 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 Virtual hosting of buckets in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - In addition to the "s3:CreateBucket" permission, the following permissions are required in a policy when your "CreateBucket" request includes specific headers: * **Access control lists (ACLs)** - In your "CreateBucket" request, if you specify an access control list (ACL) and set it to "public-read", "public-read-write", "authenticated-read", or if you explicitly specify any other custom ACLs, both "s3:CreateBucket" and "s3:PutBucketAcl" permissions are required. In your "CreateBucket" request, if you set the ACL to "private", or if you don't specify any ACLs, only the "s3:CreateBucket" permission is required. * **Object Lock** - In your "CreateBucket" request, if you set "x -amz-bucket-object-lock-enabled" to true, the "s3:PutBucketObjectLockConfiguration" and "s3:PutBucketVersioning" permissions are required. * **S3 Object Ownership** - If your "CreateBucket" request includes the "x-amz-object-ownership" header, then the "s3:PutBucketOwnershipControls" permission is required. Warning: To set an ACL on a bucket as part of a "CreateBucket" request, you must explicitly set S3 Object Ownership for the bucket to a different value than the default, "BucketOwnerEnforced". Additionally, if your desired bucket ACL grants public access, you must first create the bucket (without the bucket ACL) and then explicitly disable Block Public Access on the bucket before using "PutBucketAcl" to set the ACL. If you try to create a bucket with a public ACL, the request will fail. For the majority of modern use cases in S3, we recommend that you keep all Block Public Access settings enabled and keep ACLs disabled. If you would like to share data with users outside of your account, you can use bucket policies as needed. For more information, see Controlling ownership of objects and disabling ACLs for your bucket and Blocking public access to your Amazon S3 storage in the *Amazon S3 User Guide*. * **S3 Block Public Access** - If your specific use case requires granting public access to your S3 resources, you can disable Block Public Access. Specifically, you can create a new bucket with Block Public Access enabled, then separately call the DeletePublicAccessBlock API. To use this operation, you must have the "s3:PutBucketPublicAccessBlock" permission. For more information about S3 Block Public Access, see Blocking public access to your Amazon S3 storage in the *Amazon S3 User Guide*. * **Directory bucket permissions** - You must have the "s3express:CreateBucket" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. Warning: The permissions for ACLs, Object Lock, S3 Object Ownership, and S3 Block Public Access are not supported for directory buckets. For directory buckets, all Block Public Access settings are enabled at the bucket level and S3 Object Ownership is set to Bucket owner enforced (ACLs disabled). These settings can't be modified. For more information about permissions for creating and working with directory buckets, see Directory buckets in the *Amazon S3 User Guide*. For more information about supported S3 features for directory buckets, see Features of S3 Express One Zone in the *Amazon S3 User Guide*.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "CreateBucket": * PutObject * DeleteBucket See also: AWS API Documentation **Request Syntax** bucket = s3.create_bucket( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', Bucket='string', CreateBucketConfiguration={ 'LocationConstraint': 'af-south-1'|'ap-east-1'|'ap-northeast-1'|'ap-northeast-2'|'ap-northeast-3'|'ap-south-1'|'ap-south-2'|'ap-southeast-1'|'ap-southeast-2'|'ap-southeast-3'|'ap-southeast-4'|'ap-southeast-5'|'ca-central-1'|'cn-north-1'|'cn-northwest-1'|'EU'|'eu-central-1'|'eu-central-2'|'eu-north-1'|'eu-south-1'|'eu-south-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'il-central-1'|'me-central-1'|'me-south-1'|'sa-east-1'|'us-east-2'|'us-gov-east-1'|'us-gov-west-1'|'us-west-1'|'us-west-2', 'Location': { 'Type': 'AvailabilityZone'|'LocalZone', 'Name': 'string' }, 'Bucket': { 'DataRedundancy': 'SingleAvailabilityZone'|'SingleLocalZone', 'Type': 'Directory' }, 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', ObjectLockEnabledForBucket=True|False, ObjectOwnership='BucketOwnerPreferred'|'ObjectWriter'|'BucketOwnerEnforced' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the bucket. Note: This functionality is not supported for directory buckets. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to create. **General purpose buckets** - For information about bucket naming restrictions, see Bucket naming rules in the *Amazon S3 User Guide*. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **CreateBucketConfiguration** (*dict*) -- The configuration information for the bucket. * **LocationConstraint** *(string) --* Specifies the Region where the bucket will be created. 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. If you don't specify a Region, the bucket is created in the US East (N. Virginia) Region (us-east-1) by default. Configurations using the value "EU" will create a bucket in "eu-west-1". For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints. Note: This functionality is not supported for directory buckets. * **Location** *(dict) --* Specifies the location where the bucket will be created. **Directory buckets** - The location type is Availability Zone or Local Zone. To use the Local Zone location type, your account must be enabled for Local Zones. Otherwise, you get an HTTP "403 Forbidden" error with the error code "AccessDenied". To learn more, see Enable accounts for Local Zones in the *Amazon S3 User Guide*. Note: This functionality is only supported by directory buckets. * **Type** *(string) --* The type of location where the bucket will be created. * **Name** *(string) --* The name of the location where the bucket will be created. For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is "usw2-az1". * **Bucket** *(dict) --* Specifies the information about the bucket that will be created. Note: This functionality is only supported by directory buckets. * **DataRedundancy** *(string) --* The number of Zone (Availability Zone or Local Zone) that's used for redundancy for the bucket. * **Type** *(string) --* The type of bucket. * **Tags** *(list) --* An array of tags that you can apply to the bucket that you're creating. Tags are key-value pairs of metadata used to categorize and organize your buckets, track costs, and control access. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **GrantFullControl** (*string*) -- Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. Note: This functionality is not supported for directory buckets. * **GrantRead** (*string*) -- Allows grantee to list the objects in the bucket. Note: This functionality is not supported for directory buckets. * **GrantReadACP** (*string*) -- Allows grantee to read the bucket ACL. Note: This functionality is not supported for directory buckets. * **GrantWrite** (*string*) -- Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. Note: This functionality is not supported for directory buckets. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. Note: This functionality is not supported for directory buckets. * **ObjectLockEnabledForBucket** (*boolean*) -- Specifies whether you want S3 Object Lock to be enabled for the new bucket. Note: This functionality is not supported for directory buckets. * **ObjectOwnership** (*string*) -- The container element for object ownership for a bucket's ownership controls. "BucketOwnerPreferred" - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the "bucket-owner-full-control" canned ACL. "ObjectWriter" - The uploading account will own the object if the object is uploaded with the "bucket-owner-full-control" canned ACL. "BucketOwnerEnforced" - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or specify bucket owner full control ACLs (such as the predefined "bucket-owner-full-control" canned ACL or a custom ACL in XML format that grants the same permissions). By default, "ObjectOwnership" is set to "BucketOwnerEnforced" and ACLs are disabled. We recommend keeping ACLs disabled, except in uncommon use cases where you must control access for each object individually. For more information about S3 Object Ownership, see Controlling ownership of objects and disabling ACLs for your bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets use the bucket owner enforced setting for S3 Object Ownership. Return type: "s3.Bucket" Returns: Bucket resource ServiceResource / Sub-Resource / ObjectAcl ObjectAcl ********* S3.ServiceResource.ObjectAcl(bucket_name, object_key) Creates a ObjectAcl resource.: object_acl = s3.ObjectAcl('bucket_name','object_key') Parameters: * **bucket_name** (*string*) -- The ObjectAcl's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The ObjectAcl's object_key identifier. This **must** be set. Return type: "S3.ObjectAcl" Returns: A ObjectAcl resource ServiceResource / Sub-Resource / BucketRequestPayment BucketRequestPayment ******************** S3.ServiceResource.BucketRequestPayment(bucket_name) Creates a BucketRequestPayment resource.: bucket_request_payment = s3.BucketRequestPayment('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketRequestPayment's bucket_name identifier. This **must** be set. Return type: "S3.BucketRequestPayment" Returns: A BucketRequestPayment resource ServiceResource / Sub-Resource / Bucket Bucket ****** S3.ServiceResource.Bucket(name) Creates a Bucket resource.: bucket = s3.Bucket('name') Parameters: **name** (*string*) -- The Bucket's name identifier. This **must** be set. Return type: "S3.Bucket" Returns: A Bucket resource ServiceResource / Sub-Resource / BucketLifecycleConfiguration BucketLifecycleConfiguration **************************** S3.ServiceResource.BucketLifecycleConfiguration(bucket_name) Creates a BucketLifecycleConfiguration resource.: bucket_lifecycle_configuration = s3.BucketLifecycleConfiguration('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketLifecycleConfiguration's bucket_name identifier. This **must** be set. Return type: "S3.BucketLifecycleConfiguration" Returns: A BucketLifecycleConfiguration resource ServiceResource / Sub-Resource / MultipartUploadPart MultipartUploadPart ******************* S3.ServiceResource.MultipartUploadPart(bucket_name, object_key, multipart_upload_id, part_number) Creates a MultipartUploadPart resource.: multipart_upload_part = s3.MultipartUploadPart('bucket_name','object_key','multipart_upload_id','part_number') Parameters: * **bucket_name** (*string*) -- The MultipartUploadPart's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The MultipartUploadPart's object_key identifier. This **must** be set. * **multipart_upload_id** (*string*) -- The MultipartUploadPart's multipart_upload_id identifier. This **must** be set. * **part_number** (*string*) -- The MultipartUploadPart's part_number identifier. This **must** be set. Return type: "S3.MultipartUploadPart" Returns: A MultipartUploadPart resource ServiceResource / Sub-Resource / Object Object ****** S3.ServiceResource.Object(bucket_name, key) Creates a Object resource.: object = s3.Object('bucket_name','key') Parameters: * **bucket_name** (*string*) -- The Object's bucket_name identifier. This **must** be set. * **key** (*string*) -- The Object's key identifier. This **must** be set. Return type: "S3.Object" Returns: A Object resource ServiceResource / Sub-Resource / BucketLogging BucketLogging ************* S3.ServiceResource.BucketLogging(bucket_name) Creates a BucketLogging resource.: bucket_logging = s3.BucketLogging('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketLogging's bucket_name identifier. This **must** be set. Return type: "S3.BucketLogging" Returns: A BucketLogging resource ServiceResource / Sub-Resource / BucketLifecycle BucketLifecycle *************** S3.ServiceResource.BucketLifecycle(bucket_name) Creates a BucketLifecycle resource.: bucket_lifecycle = s3.BucketLifecycle('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketLifecycle's bucket_name identifier. This **must** be set. Return type: "S3.BucketLifecycle" Returns: A BucketLifecycle resource ServiceResource / Sub-Resource / BucketNotification BucketNotification ****************** S3.ServiceResource.BucketNotification(bucket_name) Creates a BucketNotification resource.: bucket_notification = s3.BucketNotification('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketNotification's bucket_name identifier. This **must** be set. Return type: "S3.BucketNotification" Returns: A BucketNotification resource ServiceResource / Sub-Resource / BucketPolicy BucketPolicy ************ S3.ServiceResource.BucketPolicy(bucket_name) Creates a BucketPolicy resource.: bucket_policy = s3.BucketPolicy('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketPolicy's bucket_name identifier. This **must** be set. Return type: "S3.BucketPolicy" Returns: A BucketPolicy resource BucketTagging / Attribute / tag_set tag_set ******* S3.BucketTagging.tag_set * *(list) --* Contains the tag set. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. BucketTagging / Action / get_available_subresources get_available_subresources ************************** S3.BucketTagging.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketTagging / Action / put put *** S3.BucketTagging.put(**kwargs) Note: This operation is not supported for directory buckets. Sets the tags for a bucket. Use tags to organize your Amazon Web Services bill to reflect your own cost structure. To do this, sign up to get your Amazon Web Services account bill with tag key values included. Then, to see the cost of combined resources, organize your billing information according to resources with the same tag key values. For example, you can tag several resources with a specific application name, and then organize your billing information to see the total cost of that application across several services. For more information, see Cost Allocation and Tagging and Using Cost Allocation in Amazon S3 Bucket Tags. Note: When this operation sets the tags for a bucket, it will overwrite any current tags the bucket already has. You cannot use this operation to add tags to an existing list of tags. To use this operation, you must have permissions to perform the "s3:PutBucketTagging" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. "PutBucketTagging" has the following special errors. For more Amazon S3 errors see, Error Responses. * "InvalidTag" - The tag provided was not a valid tag. This error can occur if the tag did not pass input validation. For more information, see Using Cost Allocation in Amazon S3 Bucket Tags. * "MalformedXML" - The XML provided does not match the schema. * "OperationAborted" - A conflicting conditional action is currently in progress against this resource. Please try again. * "InternalError" - The service was unable to apply the provided tag to the bucket. The following operations are related to "PutBucketTagging": * GetBucketTagging * DeleteBucketTagging See also: AWS API Documentation **Request Syntax** response = bucket_tagging.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', Tagging={ 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **Tagging** (*dict*) -- **[REQUIRED]** Container for the "TagSet" and "Tag" elements. * **TagSet** *(list) --* **[REQUIRED]** A collection for a set of tags * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketTagging / Action / load load **** S3.BucketTagging.load() Calls "S3.Client.get_bucket_tagging()" to update the attributes of the BucketTagging resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_tagging.load() Returns: None S3 / Resource / BucketTagging BucketTagging ************* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketTagging(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketTagging: import boto3 s3 = boto3.resource('s3') bucket_tagging = s3.BucketTagging('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketTagging's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * tag_set Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketTagging / Identifier / bucket_name bucket_name *********** S3.BucketTagging.bucket_name *(string)* The BucketTagging's bucket_name identifier. This **must** be set. BucketTagging / Sub-Resource / Bucket Bucket ****** S3.BucketTagging.Bucket() Creates a Bucket resource.: bucket = bucket_tagging.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketTagging / Action / reload reload ****** S3.BucketTagging.reload() Calls "S3.Client.get_bucket_tagging()" to update the attributes of the BucketTagging resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_tagging.reload() Returns: None BucketTagging / Action / delete delete ****** S3.BucketTagging.delete(**kwargs) Note: This operation is not supported for directory buckets. Deletes the tags from the bucket. To use this operation, you must have permission to perform the "s3:PutBucketTagging" action. By default, the bucket owner has this permission and can grant this permission to others. The following operations are related to "DeleteBucketTagging": * GetBucketTagging * PutBucketTagging See also: AWS API Documentation **Request Syntax** response = bucket_tagging.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Paginator / ListObjectVersions ListObjectVersions ****************** class S3.Paginator.ListObjectVersions paginator = client.get_paginator('list_object_versions') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_object_versions()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Bucket='string', Delimiter='string', EncodingType='url', Prefix='string', ExpectedBucketOwner='string', RequestPayer='requester', OptionalObjectAttributes=[ 'RestoreStatus', ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name that contains the objects. * **Delimiter** (*string*) -- A delimiter is a character that you specify to group keys. All keys that contain the same string between the "prefix" and the first occurrence of the delimiter are grouped under a single result element in "CommonPrefixes". These groups are counted as one result against the "max-keys" limitation. These keys are not returned elsewhere in the response. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **Prefix** (*string*) -- Use this parameter to select only those keys that begin with the specified prefix. You can use prefixes to separate a bucket into different groupings of keys. (You can think of using "prefix" to make groups in the same way that you'd use a folder in a file system.) You can use "prefix" with "delimiter" to roll up numerous objects into a single result under "CommonPrefixes". * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'KeyMarker': 'string', 'VersionIdMarker': 'string', 'Versions': [ { 'ETag': 'string', 'ChecksumAlgorithm': [ 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ], 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'Size': 123, 'StorageClass': 'STANDARD', 'Key': 'string', 'VersionId': 'string', 'IsLatest': True|False, 'LastModified': datetime(2015, 1, 1), 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'RestoreStatus': { 'IsRestoreInProgress': True|False, 'RestoreExpiryDate': datetime(2015, 1, 1) } }, ], 'DeleteMarkers': [ { 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Key': 'string', 'VersionId': 'string', 'IsLatest': True|False, 'LastModified': datetime(2015, 1, 1) }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'RequestCharged': 'requester', 'NextToken': 'string' } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* A flag that indicates whether 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 by 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) --* Marks the last version of the key returned in a truncated response. * **Versions** *(list) --* Container for version information. * *(dict) --* The version of an object. * **ETag** *(string) --* The entity tag is an MD5 hash of that version of the object. * **ChecksumAlgorithm** *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Size** *(integer) --* Size in bytes of the object. * **StorageClass** *(string) --* The class of storage used to store the object. * **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** *(datetime) --* Date and time when the object was last modified. * **Owner** *(dict) --* Specifies the owner of the object. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **RestoreStatus** *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" * **DeleteMarkers** *(list) --* Container for an object that is a delete marker. To learn more about delete markers, see Working with delete markers. * *(dict) --* Information about the delete marker. * **Owner** *(dict) --* The account that created the delete marker. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **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** *(datetime) --* Date and time when the object was last modified. * **Name** *(string) --* The bucket name. * **Prefix** *(string) --* Selects objects that start with the value supplied by this parameter. * **Delimiter** *(string) --* The delimiter grouping the included keys. A delimiter is a character that you specify to group keys. All keys that contain the same string between the prefix and the first occurrence of the delimiter are grouped under a single result element in "CommonPrefixes". These groups are counted as one result against the "max-keys" limitation. These keys are not returned elsewhere in the response. * **MaxKeys** *(integer) --* Specifies the maximum number of objects to return. * **CommonPrefixes** *(list) --* All of the keys rolled up into a common prefix count as a single return when calculating the number of returns. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode object key names in the XML response. If you specify the "encoding-type" request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements: "KeyMarker, NextKeyMarker, Prefix, Key", and "Delimiter". * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **NextToken** *(string) --* A token to resume pagination. S3 / Paginator / ListBuckets ListBuckets *********** class S3.Paginator.ListBuckets paginator = client.get_paginator('list_buckets') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_buckets()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Prefix='string', BucketRegion='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Prefix** (*string*) -- Limits the response to bucket names that begin with the specified bucket name prefix. * **BucketRegion** (*string*) -- Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services Region must be expressed according to the Amazon Web Services Region code, such as "us-west-2" for the US West (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints. Note: Requests made to a Regional endpoint that is different from the "bucket-region" parameter are not supported. For example, if you want to limit the response to your buckets in Region "us-west-2", the request must be made to an endpoint in Region "us-west-2". * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Buckets': [ { 'Name': 'string', 'CreationDate': datetime(2015, 1, 1), 'BucketRegion': 'string', 'BucketArn': 'string' }, ], 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Prefix': 'string', 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Buckets** *(list) --* The list of buckets owned by the requester. * *(dict) --* In terms of implementation, a Bucket is a resource. * **Name** *(string) --* The name of the bucket. * **CreationDate** *(datetime) --* Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy. * **BucketRegion** *(string) --* "BucketRegion" indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * **Owner** *(dict) --* The owner of the buckets listed. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Prefix** *(string) --* If "Prefix" was sent with the request, it is included in the response. All bucket names in the response begin with the specified bucket name prefix. * **NextToken** *(string) --* A token to resume pagination. S3 / Paginator / ListParts ListParts ********* class S3.Paginator.ListParts paginator = client.get_paginator('list_parts') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_parts()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Bucket='string', Key='string', UploadId='string', RequestPayer='requester', ExpectedBucketOwner='string', SSECustomerAlgorithm='string', SSECustomerKey='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to which the parts are being uploaded. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Object key for which the multipart upload was initiated. * **UploadId** (*string*) -- **[REQUIRED]** Upload ID identifying the multipart upload whose parts are being listed. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **SSECustomerAlgorithm** (*string*) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'AbortDate': datetime(2015, 1, 1), 'AbortRuleId': 'string', 'Bucket': 'string', 'Key': 'string', 'UploadId': 'string', 'PartNumberMarker': 123, 'MaxParts': 123, 'IsTruncated': True|False, 'Parts': [ { 'PartNumber': 123, 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'Size': 123, 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, ], 'Initiator': { 'ID': 'string', 'DisplayName': 'string' }, 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AbortDate** *(datetime) --* If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and the prefix in the lifecycle rule matches the object name in the request, then the response includes this header indicating when the initiated multipart upload will become eligible for abort operation. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration. The response will also include the "x-amz-abort-rule-id" header that will provide the ID of the lifecycle configuration rule that defines this action. Note: This functionality is not supported for directory buckets. * **AbortRuleId** *(string) --* This header is returned along with the "x-amz-abort-date" header. It identifies applicable lifecycle configuration rule that defines the action to abort incomplete multipart uploads. Note: This functionality is not supported for directory buckets. * **Bucket** *(string) --* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or access point alias if used. * **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) --* Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. * **MaxParts** *(integer) --* Maximum number of parts that were allowed in the response. * **IsTruncated** *(boolean) --* Indicates whether the returned list of parts is truncated. A true value indicates that the list was truncated. A list can be truncated if the number of parts exceeds the limit returned in the MaxParts element. * **Parts** *(list) --* Container for elements related to a particular part. A response can contain zero or more "Part" elements. * *(dict) --* Container for elements related to a part. * **PartNumber** *(integer) --* Part number identifying the part. This is a positive integer between 1 and 10,000. * **LastModified** *(datetime) --* Date and time at which the part was uploaded. * **ETag** *(string) --* Entity tag returned when the part was uploaded. * **Size** *(integer) --* Size in bytes of the uploaded part data. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the part. This checksum is present if the object was uploaded with the "CRC32" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the part. This checksum is present if the object was uploaded with the "CRC32C" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" checksum of the part. This checksum is present if the object was uploaded with the "SHA1" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" checksum of the part. This checksum is present if the object was uploaded with the "SHA256" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Initiator** *(dict) --* Container element that identifies who initiated the multipart upload. If the initiator is an Amazon Web Services account, this element provides the same information as the "Owner" element. If the initiator is an IAM User, this element provides the user ARN and display name. * **ID** *(string) --* If the principal is an Amazon Web Services account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value. Note: **Directory buckets** - If the principal is an Amazon Web Services account, it provides the Amazon Web Services account ID. If the principal is an IAM User, it provides a user ARN value. * **DisplayName** *(string) --* Name of the Principal. Note: This functionality is not supported for directory buckets. * **Owner** *(dict) --* Container element that identifies the object owner, after the object is created. If multipart upload is initiated by an IAM user, this element provides the parent account ID and display name. Note: **Directory buckets** - The bucket owner is returned as the object owner for all the parts. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **StorageClass** *(string) --* The class of storage used to store the uploaded object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** *(string) --* The algorithm that was used to create a checksum of the object. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in "CreateMultipartUpload" request. For more information, see Checking object integrity in the Amazon S3 User Guide. * **NextToken** *(string) --* A token to resume pagination. S3 / Paginator / ListDirectoryBuckets ListDirectoryBuckets ******************** class S3.Paginator.ListDirectoryBuckets paginator = client.get_paginator('list_directory_buckets') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_directory_buckets()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max- items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Buckets': [ { 'Name': 'string', 'CreationDate': datetime(2015, 1, 1), 'BucketRegion': 'string', 'BucketArn': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Buckets** *(list) --* The list of buckets owned by the requester. * *(dict) --* In terms of implementation, a Bucket is a resource. * **Name** *(string) --* The name of the bucket. * **CreationDate** *(datetime) --* Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy. * **BucketRegion** *(string) --* "BucketRegion" indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * **NextToken** *(string) --* A token to resume pagination. S3 / Paginator / ListMultipartUploads ListMultipartUploads ******************** class S3.Paginator.ListMultipartUploads paginator = client.get_paginator('list_multipart_uploads') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_multipart_uploads()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Bucket='string', Delimiter='string', EncodingType='url', Prefix='string', ExpectedBucketOwner='string', RequestPayer='requester', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to which the multipart upload was initiated. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delimiter** (*string*) -- Character you use to group keys. All keys that contain the same string between the prefix, if specified, and the first occurrence of the delimiter after the prefix are grouped under a single result element, "CommonPrefixes". If you don't specify the prefix parameter, then the substring starts at the beginning of the key. The keys that are grouped under "CommonPrefixes" result element are not returned elsewhere in the response. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **Prefix** (*string*) -- Lists in-progress uploads only for those keys that begin with the specified prefix. You can use prefixes to separate a bucket into different grouping of keys. (You can think of using "prefix" to make groups in the same way that you'd use a folder in a file system.) Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Bucket': 'string', 'KeyMarker': 'string', 'UploadIdMarker': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxUploads': 123, 'IsTruncated': True|False, 'Uploads': [ { 'UploadId': 'string', 'Key': 'string', 'Initiated': datetime(2015, 1, 1), 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Initiator': { 'ID': 'string', 'DisplayName': 'string' }, 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT' }, ], 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'RequestCharged': 'requester', 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Bucket** *(string) --* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or access point alias if used. * **KeyMarker** *(string) --* The key at or after which the listing began. * **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. Otherwise, any multipart uploads for a key equal to the key-marker might be included in the list only if they have an upload ID lexicographically greater than the specified "upload-id-marker". Note: This functionality is not supported for directory buckets. * **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. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **Delimiter** *(string) --* Contains the delimiter you specified in the request. If you don't specify a delimiter in your request, this element is absent from the response. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **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** *(list) --* Container for elements related to a particular multipart upload. A response can contain zero or more "Upload" elements. * *(dict) --* Container for the "MultipartUpload" for the Amazon S3 object. * **UploadId** *(string) --* Upload ID that identifies the multipart upload. * **Key** *(string) --* Key of the object for which the multipart upload was initiated. * **Initiated** *(datetime) --* Date and time at which the multipart upload was initiated. * **StorageClass** *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **Owner** *(dict) --* Specifies the owner of the object that is part of the multipart upload. Note: **Directory buckets** - The bucket owner is returned as the object owner for all the objects. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Initiator** *(dict) --* Identifies who initiated the multipart upload. * **ID** *(string) --* If the principal is an Amazon Web Services account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value. Note: **Directory buckets** - If the principal is an Amazon Web Services account, it provides the Amazon Web Services account ID. If the principal is an IAM User, it provides a user ARN value. * **DisplayName** *(string) --* Name of the Principal. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** *(string) --* The algorithm that was used to create a checksum of the object. * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **CommonPrefixes** *(list) --* If you specify a delimiter in the request, then the result returns each distinct key prefix containing the delimiter in a "CommonPrefixes" element. The distinct key prefixes are returned in the "Prefix" child element. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode object keys in the response. If you specify the "encoding-type" request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements: "Delimiter", "KeyMarker", "Prefix", "NextKeyMarker", "Key". * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **NextToken** *(string) --* A token to resume pagination. S3 / Paginator / ListObjectsV2 ListObjectsV2 ************* class S3.Paginator.ListObjectsV2 paginator = client.get_paginator('list_objects_v2') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_objects_v2()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Bucket='string', Delimiter='string', EncodingType='url', Prefix='string', FetchOwner=True|False, StartAfter='string', RequestPayer='requester', ExpectedBucketOwner='string', OptionalObjectAttributes=[ 'RestoreStatus', ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delimiter** (*string*) -- A delimiter is a character that you use to group keys. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the "StartAfter" value. Note: * **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **Directory buckets** - When you query "ListObjectsV2" with a delimiter during in-progress multipart uploads, the "CommonPrefixes" response parameter contains the prefixes that are associated with the in-progress multipart uploads. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **Prefix** (*string*) -- Limits the response to keys that begin with the specified prefix. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **FetchOwner** (*boolean*) -- The owner field is not present in "ListObjectsV2" by default. If you want to return the owner field with each key in the result, then set the "FetchOwner" field to "true". Note: **Directory buckets** - For directory buckets, the bucket owner is returned as the object owner for all objects. * **StartAfter** (*string*) -- StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. StartAfter can be any key in the bucket. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that she or he will be charged for the list objects request in V2 style. Bucket owners need not specify this parameter in their requests. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. Note: This functionality is not supported for directory buckets. * *(string) --* * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'Contents': [ { 'Key': 'string', 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'ChecksumAlgorithm': [ 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ], 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'Size': 123, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'RestoreStatus': { 'IsRestoreInProgress': True|False, 'RestoreExpiryDate': datetime(2015, 1, 1) } }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'KeyCount': 123, 'ContinuationToken': 'string', 'StartAfter': 'string', 'RequestCharged': 'requester', 'NextToken': 'string' } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* Set to "false" if all of the results were returned. Set to "true" if more keys are available to return. If the number of results exceeds that specified by "MaxKeys", all of the results might not be returned. * **Contents** *(list) --* Metadata about each object returned. * *(dict) --* An object consists of data and its descriptive metadata. * **Key** *(string) --* The name that you assign to an object. You use the object key to retrieve the object. * **LastModified** *(datetime) --* Creation date of the object. * **ETag** *(string) --* The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below: * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data. * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data. * If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest. Note: **Directory buckets** - MD5 is not supported by directory buckets. * **ChecksumAlgorithm** *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Size** *(integer) --* Size in bytes of the object * **StorageClass** *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **Owner** *(dict) --* The owner of the object Note: **Directory buckets** - The bucket owner is returned as the object owner. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **RestoreStatus** *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" * **Name** *(string) --* The bucket name. * **Prefix** *(string) --* Keys that begin with the indicated prefix. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **Delimiter** *(string) --* Causes keys that contain the same string between the "prefix" and the first occurrence of the delimiter to be rolled up into a single result element in the "CommonPrefixes" collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the "MaxKeys" value. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **MaxKeys** *(integer) --* Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. * **CommonPrefixes** *(list) --* All of the keys (up to 1,000) that share the same prefix are grouped together. When counting the total numbers of returns by this API operation, this group of keys is considered as one item. A response can contain "CommonPrefixes" only if you specify a delimiter. "CommonPrefixes" contains all (if there are any) keys between "Prefix" and the next occurrence of the string specified by a delimiter. "CommonPrefixes" lists keys that act like subdirectories in the directory specified by "Prefix". For example, if the prefix is "notes/" and the delimiter is a slash ( "/") as in "notes/summer/july", the common prefix is "notes/summer/". All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. Note: * **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **Directory buckets** - When you query "ListObjectsV2" with a delimiter during in-progress multipart uploads, the "CommonPrefixes" response parameter contains the prefixes that are associated with the in-progress multipart uploads. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode object key names in the XML response. If you specify the "encoding-type" request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements: "Delimiter, Prefix, Key," and "StartAfter". * **KeyCount** *(integer) --* "KeyCount" is the number of keys returned with this request. "KeyCount" will always be less than or equal to the "MaxKeys" field. For example, if you ask for 50 keys, your result will include 50 keys or fewer. * **ContinuationToken** *(string) --* If "ContinuationToken" was sent with the request, it is included in the response. You can use the returned "ContinuationToken" for pagination of the list response. * **StartAfter** *(string) --* If StartAfter was sent with the request, it is included in the response. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **NextToken** *(string) --* A token to resume pagination. S3 / Paginator / ListObjects ListObjects *********** class S3.Paginator.ListObjects paginator = client.get_paginator('list_objects') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3.Client.list_objects()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Bucket='string', Delimiter='string', EncodingType='url', Prefix='string', RequestPayer='requester', ExpectedBucketOwner='string', OptionalObjectAttributes=[ 'RestoreStatus', ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the objects. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id .region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*AccountId*.s3-accesspoint.*Region* .amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delimiter** (*string*) -- A delimiter is a character that you use to group keys. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **Prefix** (*string*) -- Limits the response to keys that begin with the specified prefix. * **RequestPayer** (*string*) -- Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'Marker': 'string', 'NextMarker': 'string', 'Contents': [ { 'Key': 'string', 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'ChecksumAlgorithm': [ 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ], 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'Size': 123, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'RestoreStatus': { 'IsRestoreInProgress': True|False, 'RestoreExpiryDate': datetime(2015, 1, 1) } }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'RequestCharged': 'requester', 'NextToken': 'string' } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria. * **Marker** *(string) --* Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request. * **NextMarker** *(string) --* When the response is truncated (the "IsTruncated" element value in the response is "true"), you can use the key name in this field as the "marker" parameter in the subsequent request to get the next set of objects. Amazon S3 lists objects in alphabetical order. Note: This element is returned only if you have the "delimiter" request parameter specified. If the response does not include the "NextMarker" element and it is truncated, you can use the value of the last "Key" element in the response as the "marker" parameter in the subsequent request to get the next set of object keys. * **Contents** *(list) --* Metadata about each object returned. * *(dict) --* An object consists of data and its descriptive metadata. * **Key** *(string) --* The name that you assign to an object. You use the object key to retrieve the object. * **LastModified** *(datetime) --* Creation date of the object. * **ETag** *(string) --* The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below: * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data. * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data. * If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest. Note: **Directory buckets** - MD5 is not supported by directory buckets. * **ChecksumAlgorithm** *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Size** *(integer) --* Size in bytes of the object * **StorageClass** *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **Owner** *(dict) --* The owner of the object Note: **Directory buckets** - The bucket owner is returned as the object owner. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **RestoreStatus** *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" * **Name** *(string) --* The bucket name. * **Prefix** *(string) --* Keys that begin with the indicated prefix. * **Delimiter** *(string) --* Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the "CommonPrefixes" collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the "MaxKeys" value. * **MaxKeys** *(integer) --* The maximum number of keys returned in the response body. * **CommonPrefixes** *(list) --* All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number of returns. A response can contain "CommonPrefixes" only if you specify a delimiter. "CommonPrefixes" contains all (if there are any) keys between "Prefix" and the next occurrence of the string specified by the delimiter. "CommonPrefixes" lists keys that act like subdirectories in the directory specified by "Prefix". For example, if the prefix is "notes/" and the delimiter is a slash ( "/"), as in "notes/summer/july", the common prefix is "notes/summer/". All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **NextToken** *(string) --* A token to resume pagination. BucketRequestPayment / Action / get_available_subresources get_available_subresources ************************** S3.BucketRequestPayment.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketRequestPayment / Action / put put *** S3.BucketRequestPayment.put(**kwargs) Note: This operation is not supported for directory buckets. 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. For more information, see Requester Pays Buckets. The following operations are related to "PutBucketRequestPayment": * CreateBucket * GetBucketRequestPayment See also: AWS API Documentation **Request Syntax** response = bucket_request_payment.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', RequestPaymentConfiguration={ 'Payer': 'Requester'|'BucketOwner' }, ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **RequestPaymentConfiguration** (*dict*) -- **[REQUIRED]** Container for Payer. * **Payer** *(string) --* **[REQUIRED]** Specifies who pays for the download and request fees. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketRequestPayment / Action / load load **** S3.BucketRequestPayment.load() Calls "S3.Client.get_bucket_request_payment()" to update the attributes of the BucketRequestPayment resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_request_payment.load() Returns: None S3 / Resource / BucketRequestPayment BucketRequestPayment ******************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketRequestPayment(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketRequestPayment: import boto3 s3 = boto3.resource('s3') bucket_request_payment = s3.BucketRequestPayment('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketRequestPayment's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * payer Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketRequestPayment / Identifier / bucket_name bucket_name *********** S3.BucketRequestPayment.bucket_name *(string)* The BucketRequestPayment's bucket_name identifier. This **must** be set. BucketRequestPayment / Sub-Resource / Bucket Bucket ****** S3.BucketRequestPayment.Bucket() Creates a Bucket resource.: bucket = bucket_request_payment.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketRequestPayment / Action / reload reload ****** S3.BucketRequestPayment.reload() Calls "S3.Client.get_bucket_request_payment()" to update the attributes of the BucketRequestPayment resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_request_payment.reload() Returns: None BucketRequestPayment / Attribute / payer payer ***** S3.BucketRequestPayment.payer * *(string) --* Specifies who pays for the download and request fees. S3 / Client / get_bucket_inventory_configuration get_bucket_inventory_configuration ********************************** S3.Client.get_bucket_inventory_configuration(**kwargs) Note: This operation is not supported for directory buckets. Returns an S3 Inventory configuration (identified by the inventory configuration ID) from the bucket. To use this operation, you must have permissions to perform the "s3:GetInventoryConfiguration" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about the Amazon S3 inventory feature, see Amazon S3 Inventory. The following operations are related to "GetBucketInventoryConfiguration": * DeleteBucketInventoryConfiguration * ListBucketInventoryConfigurations * PutBucketInventoryConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_inventory_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the inventory configuration to retrieve. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the inventory configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'InventoryConfiguration': { 'Destination': { 'S3BucketDestination': { 'AccountId': 'string', 'Bucket': 'string', 'Format': 'CSV'|'ORC'|'Parquet', 'Prefix': 'string', 'Encryption': { 'SSES3': {}, 'SSEKMS': { 'KeyId': 'string' } } } }, 'IsEnabled': True|False, 'Filter': { 'Prefix': 'string' }, 'Id': 'string', 'IncludedObjectVersions': 'All'|'Current', 'OptionalFields': [ 'Size'|'LastModifiedDate'|'StorageClass'|'ETag'|'IsMultipartUploaded'|'ReplicationStatus'|'EncryptionStatus'|'ObjectLockRetainUntilDate'|'ObjectLockMode'|'ObjectLockLegalHoldStatus'|'IntelligentTieringAccessTier'|'BucketKeyStatus'|'ChecksumAlgorithm'|'ObjectAccessControlList'|'ObjectOwner', ], 'Schedule': { 'Frequency': 'Daily'|'Weekly' } } } **Response Structure** * *(dict) --* * **InventoryConfiguration** *(dict) --* Specifies the inventory configuration. * **Destination** *(dict) --* Contains information about where to publish the inventory results. * **S3BucketDestination** *(dict) --* Contains the bucket name, file format, bucket owner (optional), and prefix (optional) where inventory results are published. * **AccountId** *(string) --* The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Note: Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. * **Bucket** *(string) --* The Amazon Resource Name (ARN) of the bucket where inventory results will be published. * **Format** *(string) --* Specifies the output format of the inventory results. * **Prefix** *(string) --* The prefix that is prepended to all inventory results. * **Encryption** *(dict) --* Contains the type of server-side encryption used to encrypt the inventory results. * **SSES3** *(dict) --* Specifies the use of SSE-S3 to encrypt delivered inventory reports. * **SSEKMS** *(dict) --* Specifies the use of SSE-KMS to encrypt delivered inventory reports. * **KeyId** *(string) --* Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports. * **IsEnabled** *(boolean) --* Specifies whether the inventory is enabled or disabled. If set to "True", an inventory list is generated. If set to "False", no inventory list is generated. * **Filter** *(dict) --* Specifies an inventory filter. The inventory only includes objects that meet the filter's criteria. * **Prefix** *(string) --* The prefix that an object must have to be included in the inventory results. * **Id** *(string) --* The ID used to identify the inventory configuration. * **IncludedObjectVersions** *(string) --* Object versions to include in the inventory list. If set to "All", the list includes all the object versions, which adds the version-related fields "VersionId", "IsLatest", and "DeleteMarker" to the list. If set to "Current", the list does not contain these version-related fields. * **OptionalFields** *(list) --* Contains the optional fields that are included in the inventory results. * *(string) --* * **Schedule** *(dict) --* Specifies the schedule for generating inventory results. * **Frequency** *(string) --* Specifies how frequently inventory results are produced. S3 / Client / put_bucket_replication put_bucket_replication ********************** S3.Client.put_bucket_replication(**kwargs) Note: This operation is not supported for directory buckets. Creates a replication configuration or replaces an existing one. For more information, see Replication in the *Amazon S3 User Guide*. Specify the replication configuration in the request body. In the replication configuration, you provide the name of the destination bucket or buckets where you want Amazon S3 to replicate objects, the IAM role that Amazon S3 can assume to replicate objects on your behalf, and other relevant information. You can invoke this request for a specific Amazon Web Services Region by using the aws:RequestedRegion condition key. A replication configuration must include at least one rule, and can contain a maximum of 1,000. Each rule identifies a subset of objects to replicate by filtering the objects in the source bucket. To choose additional subsets of objects to replicate, add a rule for each subset. To specify a subset of the objects in the source bucket to apply a replication rule to, add the Filter element as a child of the Rule element. You can filter objects based on an object key prefix, one or more object tags, or both. When you add the Filter element in the configuration, you must also add the following elements: "DeleteMarkerReplication", "Status", and "Priority". Note: If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see Backward Compatibility. For information about enabling versioning on a bucket, see Using Versioning. Handling Replication of Encrypted Objects By default, Amazon S3 doesn't replicate objects that are stored at rest using server-side encryption with KMS keys. To replicate Amazon Web Services KMS-encrypted objects, add the following: "SourceSelectionCriteria", "SseKmsEncryptedObjects", "Status", "EncryptionConfiguration", and "ReplicaKmsKeyID". For information about replication configuration, see Replicating Objects Created with SSE Using KMS keys. For information on "PutBucketReplication" errors, see List of replication-related error codes Permissions To create a "PutBucketReplication" request, you must have "s3:PutReplicationConfiguration" permissions for the bucket. By default, a resource owner, in this case the Amazon Web Services account that created the bucket, can perform this operation. The resource owner can also grant others permissions to perform the operation. For more information about permissions, see Specifying Permissions in a Policy and Managing Access Permissions to Your Amazon S3 Resources. Note: To perform this operation, the user or role performing the action must have the iam:PassRole permission. The following operations are related to "PutBucketReplication": * GetBucketReplication * DeleteBucketReplication See also: AWS API Documentation **Request Syntax** response = client.put_bucket_replication( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ReplicationConfiguration={ 'Role': 'string', 'Rules': [ { 'ID': 'string', 'Priority': 123, 'Prefix': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'Status': 'Enabled'|'Disabled', 'SourceSelectionCriteria': { 'SseKmsEncryptedObjects': { 'Status': 'Enabled'|'Disabled' }, 'ReplicaModifications': { 'Status': 'Enabled'|'Disabled' } }, 'ExistingObjectReplication': { 'Status': 'Enabled'|'Disabled' }, 'Destination': { 'Bucket': 'string', 'Account': 'string', 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'AccessControlTranslation': { 'Owner': 'Destination' }, 'EncryptionConfiguration': { 'ReplicaKmsKeyID': 'string' }, 'ReplicationTime': { 'Status': 'Enabled'|'Disabled', 'Time': { 'Minutes': 123 } }, 'Metrics': { 'Status': 'Enabled'|'Disabled', 'EventThreshold': { 'Minutes': 123 } } }, 'DeleteMarkerReplication': { 'Status': 'Enabled'|'Disabled' } }, ] }, Token='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ReplicationConfiguration** (*dict*) -- **[REQUIRED]** A container for replication rules. You can add up to 1,000 rules. The maximum size of a replication configuration is 2 MB. * **Role** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects. For more information, see How to Set Up Replication in the *Amazon S3 User Guide*. * **Rules** *(list) --* **[REQUIRED]** A container for one or more replication rules. A replication configuration must have at least one rule and can contain a maximum of 1,000 rules. * *(dict) --* Specifies which Amazon S3 objects to replicate and where to store the replicas. * **ID** *(string) --* A unique identifier for the rule. The maximum value is 255 characters. * **Priority** *(integer) --* The priority indicates which rule has precedence whenever two or more replication rules conflict. Amazon S3 will attempt to replicate objects according to all replication rules. However, if there are two or more rules with the same destination bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority. For more information, see Replication in the *Amazon S3 User Guide*. * **Prefix** *(string) --* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in a bucket, specify an empty string. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Filter** *(dict) --* A filter that identifies the subset of objects to which the replication rule applies. A "Filter" must specify exactly one "Prefix", "Tag", or an "And" child element. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* A container for specifying a tag key and value. The rule applies only to objects that have the tag in their tag set. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **And** *(dict) --* A container for specifying rule filters. The filters determine the subset of objects to which the rule applies. This element is required only if you specify more than one filter. For example: * If you specify both a "Prefix" and a "Tag" filter, wrap these filters in an "And" tag. * If you specify a filter based on multiple tags, wrap the "Tag" elements in an "And" tag. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the rule applies. * **Tags** *(list) --* An array of tags containing key and value pairs. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **Status** *(string) --* **[REQUIRED]** Specifies whether the rule is enabled. * **SourceSelectionCriteria** *(dict) --* A container that describes additional filters for identifying the source objects that you want to replicate. You can choose to enable or disable the replication of these objects. Currently, Amazon S3 supports only the filter that you can specify for objects created with server-side encryption using a customer managed key stored in Amazon Web Services Key Management Service (SSE-KMS). * **SseKmsEncryptedObjects** *(dict) --* A container for filter information for the selection of Amazon S3 objects encrypted with Amazon Web Services KMS. If you include "SourceSelectionCriteria" in the replication configuration, this element is required. * **Status** *(string) --* **[REQUIRED]** Specifies whether Amazon S3 replicates objects created with server-side encryption using an Amazon Web Services KMS key stored in Amazon Web Services Key Management Service. * **ReplicaModifications** *(dict) --* A filter that you can specify for selections for modifications on replicas. Amazon S3 doesn't replicate replica modifications by default. In the latest version of replication configuration (when "Filter" is specified), you can specify this element and set the status to "Enabled" to replicate modifications on replicas. Note: If you don't specify the "Filter" element, Amazon S3 assumes that the replication configuration is the earlier version, V1. In the earlier version, this element is not allowed * **Status** *(string) --* **[REQUIRED]** Specifies whether Amazon S3 replicates modifications on replicas. * **ExistingObjectReplication** *(dict) --* Optional configuration to replicate existing source bucket objects. Note: This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the *Amazon S3 User Guide*. * **Status** *(string) --* **[REQUIRED]** Specifies whether Amazon S3 replicates existing source bucket objects. * **Destination** *(dict) --* **[REQUIRED]** A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC). * **Bucket** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to store the results. * **Account** *(string) --* Destination bucket owner account ID. In a cross- account scenario, if you direct Amazon S3 to change replica ownership to the Amazon Web Services account that owns the destination bucket by specifying the "AccessControlTranslation" property, this is the account ID of the destination bucket owner. For more information, see Replication Additional Configuration: Changing the Replica Owner in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to use when replicating objects, such as S3 Standard or reduced redundancy. By default, Amazon S3 uses the storage class of the source object to create the object replica. For valid values, see the "StorageClass" element of the PUT Bucket replication action in the *Amazon S3 API Reference*. "FSX_OPENZFS" is not an accepted value when replicating objects. * **AccessControlTranslation** *(dict) --* Specify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the Amazon Web Services account that owns the destination bucket. If this is not specified in the replication configuration, the replicas are owned by same Amazon Web Services account that owns the source object. * **Owner** *(string) --* **[REQUIRED]** Specifies the replica ownership. For default and valid values, see PUT bucket replication in the *Amazon S3 API Reference*. * **EncryptionConfiguration** *(dict) --* A container that provides information about encryption. If "SourceSelectionCriteria" is specified, you must specify this element. * **ReplicaKmsKeyID** *(string) --* Specifies the ID (Key ARN or Alias ARN) of the customer managed Amazon Web Services KMS key stored in Amazon Web Services Key Management Service (KMS) for the destination bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the *Amazon Web Services Key Management Service Developer Guide*. * **ReplicationTime** *(dict) --* A container specifying S3 Replication Time Control (S3 RTC), including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a "Metrics" block. * **Status** *(string) --* **[REQUIRED]** Specifies whether the replication time is enabled. * **Time** *(dict) --* **[REQUIRED]** A container specifying the time by which replication should be complete for all objects and operations on objects. * **Minutes** *(integer) --* Contains an integer specifying time in minutes. Valid value: 15 * **Metrics** *(dict) --* A container specifying replication metrics-related settings enabling replication metrics and events. * **Status** *(string) --* **[REQUIRED]** Specifies whether the replication metrics are enabled. * **EventThreshold** *(dict) --* A container specifying the time threshold for emitting the "s3:Replication:OperationMissedThreshold" event. * **Minutes** *(integer) --* Contains an integer specifying time in minutes. Valid value: 15 * **DeleteMarkerReplication** *(dict) --* Specifies whether Amazon S3 replicates delete markers. If you specify a "Filter" in your replication configuration, you must also include a "DeleteMarkerReplication" element. If your "Filter" includes a "Tag" element, the "DeleteMarkerReplication" "Status" must be set to Disabled, because Amazon S3 does not support replicating delete markers for tag-based rules. For an example configuration, see Basic Rule Configuration. For more information about delete marker replication, see Basic Rule Configuration. Note: If you are using an earlier version of the replication configuration, Amazon S3 handles replication of delete markers differently. For more information, see Backward Compatibility. * **Status** *(string) --* Indicates whether to replicate delete markers. Note: Indicates whether to replicate delete markers. * **Token** (*string*) -- A token to allow Object Lock to be enabled for an existing bucket. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example sets replication configuration on a bucket. response = client.put_bucket_replication( Bucket='examplebucket', ReplicationConfiguration={ 'Role': 'arn:aws:iam::123456789012:role/examplerole', 'Rules': [ { 'Destination': { 'Bucket': 'arn:aws:s3:::destinationbucket', 'StorageClass': 'STANDARD', }, 'Prefix': '', 'Status': 'Enabled', }, ], }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket_website delete_bucket_website ********************* S3.Client.delete_bucket_website(**kwargs) Note: This operation is not supported for directory buckets. This action removes the website configuration for a bucket. Amazon S3 returns a "200 OK" response upon successfully deleting a website configuration on the specified bucket. You will get a "200 OK" response if the website configuration you are trying to delete does not exist on the bucket. Amazon S3 returns a "404" response if the bucket specified in the request does not exist. This DELETE action requires the "S3:DeleteBucketWebsite" permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the "S3:DeleteBucketWebsite" permission. For more information about hosting websites, see Hosting Websites on Amazon S3. The following operations are related to "DeleteBucketWebsite": * GetBucketWebsite * PutBucketWebsite See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_website( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name for which you want to remove the website configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example deletes bucket website configuration. response = client.delete_bucket_website( Bucket='examplebucket', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_paginator get_paginator ************* S3.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. S3 / Client / create_multipart_upload create_multipart_upload *********************** S3.Client.create_multipart_upload(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. 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 UploadPart). You also include this upload ID in the final request to either complete or abort the multipart upload request. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. Note: 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 stops charging you for storing them only after you either complete or abort a multipart upload. If you have configured a lifecycle rule to abort incomplete multipart uploads, the created multipart upload must be completed 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 Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration. Note: * **Directory buckets** - S3 Lifecycle is not supported by directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Request signing 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 Authenticating Requests (Amazon Web Services Signature Version 4) in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - To perform a multipart upload with encryption using an Key Management Service (KMS) KMS key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 Multipart upload API and permissions and Protecting data using server-side encryption with Amazon Web Services KMS in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Encryption * **General purpose buckets** - Server-side encryption is for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts it when you access it. Amazon S3 automatically encrypts all new objects that are uploaded to an S3 bucket. When doing a multipart upload, if you don't specify encryption information in your request, the encryption setting of the uploaded parts is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with an Key Management Service (KMS) key (SSE-KMS), or a customer-provided encryption key (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer- provided key to encrypt the uploaded parts. When you perform a CreateMultipartUpload operation, if you want to use a different type of encryption setting for the uploaded parts, you can request that Amazon S3 encrypts the object with a different encryption key (such as an Amazon S3 managed key, a KMS key, or a customer-provided key). When the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. If you choose to provide your own encryption key, the request headers you provide in UploadPart and UploadPartCopy requests must match the headers you used in the "CreateMultipartUpload" request. * Use KMS keys (SSE-KMS) that include the Amazon Web Services managed key ( "aws/s3") and KMS customer managed keys stored in Key Management Service (KMS) – If you want Amazon Web Services to manage the keys used to encrypt data, specify the following headers in the request. * "x-amz-server-side-encryption" * "x-amz-server-side-encryption-aws-kms-key-id" * "x-amz-server-side-encryption-context" Note: * If you specify "x-amz-server-side-encryption:aws:kms", but don't provide "x-amz-server-side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3" key) in KMS to protect the data. * To perform a multipart upload with encryption by using an Amazon Web Services KMS key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey*" 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 Multipart upload API and permissions and Protecting data using server-side encryption with Amazon Web Services KMS in the *Amazon S3 User Guide*. * 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 is in a different account from the key, then you must have the permissions on both the key policy and your IAM user or role. * All "GET" and "PUT" requests for an object protected by KMS fail if you don't make them by using Secure Sockets Layer (SSL), Transport Layer Security (TLS), or Signature Version 4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the *Amazon S3 User Guide*. For more information about server-side encryption with KMS keys (SSE-KMS), see Protecting Data Using Server-Side Encryption with KMS keys in the *Amazon S3 User Guide*. * Use customer-provided encryption keys (SSE-C) – If you want to manage your own encryption keys, provide all the following headers in the request. * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about server-side encryption with customer- provided encryption keys (SSE-C), see Protecting data using server-side encryption with customer-provided encryption keys (SSE-C) in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz- server-side-encryption", "x-amz-server-side-encryption-aws-kms- key-id", "x-amz-server-side-encryption-context", and "x-amz- server-side-encryption-bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. Note: For directory buckets, when you perform a "CreateMultipartUpload" operation and an "UploadPartCopy" operation, the request headers you provide in the "CreateMultipartUpload" request must match the default encryption configuration of the destination bucket.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "CreateMultipartUpload": * UploadPart * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = client.create_multipart_upload( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Bucket='string', CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentType='string', Expires=datetime(2015, 1, 1), GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Key='string', Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumType='COMPOSITE'|'FULL_OBJECT' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. Amazon S3 supports a set of predefined ACLs, known as *canned ACLs*. Each canned ACL has a predefined set of grantees and permissions. For more information, see Canned ACL in the *Amazon S3 User Guide*. By default, all objects are private. Only the owner has full access control. When uploading an object, you can grant access permissions to individual Amazon Web Services accounts or to predefined groups defined by Amazon S3. These permissions are then added to the access control list (ACL) on the new object. For more information, see Using ACLs. One way to grant the permissions using the request headers is to specify a canned ACL with the "x-amz-acl" request header. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket where the multipart upload is initiated and where the object is uploaded. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **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. Note: For directory buckets, only the "aws-chunked" value is supported in this header field. * **ContentLanguage** (*string*) -- The language that the content is in. * **ContentType** (*string*) -- A standard MIME type describing the format of the object data. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. * **GrantFullControl** (*string*) -- Specify access permissions explicitly to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Specify access permissions explicitly to allow grantee to read the object data and its metadata. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Specify access permissions explicitly to allows grantee to read the object ACL. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Specify access permissions explicitly to allows grantee to allow grantee to write the ACL for the applicable object. By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-read" header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata: "x-amz-grant-read: id="11112222333", id="444455556666"" Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Key** (*string*) -- **[REQUIRED]** Object key for which the multipart upload is to be initiated. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- Specifies the Object Lock mode that you want to apply to the uploaded object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- Specifies the date and time when you want the Object Lock to expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether you want to apply a legal hold to the uploaded object. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** (*string*) -- Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide. Return type: dict Returns: **Response Syntax** { 'AbortDate': datetime(2015, 1, 1), 'AbortRuleId': 'string', 'Bucket': 'string', 'Key': 'string', 'UploadId': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester', 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT' } **Response Structure** * *(dict) --* * **AbortDate** *(datetime) --* If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and the prefix in the lifecycle rule matches the object name in the request, the response includes this header. The header indicates when the initiated multipart upload becomes eligible for an abort operation. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. The response also includes the "x-amz-abort-rule-id" header that provides the ID of the lifecycle configuration rule that defines the abort action. Note: This functionality is not supported for directory buckets. * **AbortRuleId** *(string) --* This header is returned along with the "x-amz-abort-date" header. It identifies the applicable lifecycle configuration rule that defines the action to abort incomplete multipart uploads. Note: This functionality is not supported for directory buckets. * **Bucket** *(string) --* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or access point alias if used. Note: Access points are not supported by directory buckets. * **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 you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. * **BucketKeyEnabled** *(boolean) --* Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** *(string) --* The algorithm that was used to create a checksum of the object. * **ChecksumType** *(string) --* Indicates the checksum type that you want Amazon S3 to use to calculate the object’s checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide. **Examples** The following example initiates a multipart upload. response = client.create_multipart_upload( Bucket='examplebucket', Key='largeobject', ) print(response) Expected Output: { 'Bucket': 'examplebucket', 'Key': 'largeobject', 'UploadId': 'ibZBv_75gd9r8lH_gqXatLdxMVpAlj6ZQjEs.OwyF3953YdwbcQnMA2BLGn8Lx12fQNICtMw5KyteFeHw.Sjng--', 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_public_access_block put_public_access_block *********************** S3.Client.put_public_access_block(**kwargs) Note: This operation is not supported for directory buckets. Creates or modifies the "PublicAccessBlock" configuration for an Amazon S3 bucket. To use this operation, you must have the "s3:PutBucketPublicAccessBlock" permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. Warning: When Amazon S3 evaluates the "PublicAccessBlock" configuration for a bucket or an object, it checks the "PublicAccessBlock" configuration for both the bucket (or the bucket that contains the object) and the bucket owner's account. If the "PublicAccessBlock" configurations are different between the bucket and the account, Amazon S3 uses the most restrictive combination of the bucket-level and account-level settings. For more information about when Amazon S3 considers a bucket or an object public, see The Meaning of "Public". The following operations are related to "PutPublicAccessBlock": * GetPublicAccessBlock * DeletePublicAccessBlock * GetBucketPolicyStatus * Using Amazon S3 Block Public Access See also: AWS API Documentation **Request Syntax** response = client.put_public_access_block( Bucket='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', PublicAccessBlockConfiguration={ 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose "PublicAccessBlock" configuration you want to set. * **ContentMD5** (*string*) -- The MD5 hash of the "PutPublicAccessBlock" request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **PublicAccessBlockConfiguration** (*dict*) -- **[REQUIRED]** The "PublicAccessBlock" configuration that you want to apply to this Amazon S3 bucket. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the *Amazon S3 User Guide*. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket. Setting this element to "TRUE" causes the following behavior: * PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to "TRUE" restricts access to this bucket to only Amazon Web Services service principals and authorized users within this account if the bucket has a public policy. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / delete_object_tagging delete_object_tagging ********************* S3.Client.delete_object_tagging(**kwargs) Note: This operation is not supported for directory buckets. Removes the entire tag set from the specified object. For more information about managing object tags, see Object Tagging. To use this operation, you must have permission to perform the "s3:DeleteObjectTagging" action. To delete tags of a specific object version, add the "versionId" query parameter in the request. You will need permission for the "s3:DeleteObjectVersionTagging" action. The following operations are related to "DeleteObjectTagging": * PutObjectTagging * GetObjectTagging See also: AWS API Documentation **Request Syntax** response = client.delete_object_tagging( Bucket='string', Key='string', VersionId='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the objects from which to remove the tags. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The key that identifies the object in the bucket from which to remove all tags. * **VersionId** (*string*) -- The versionId of the object that the tag-set will be removed from. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'VersionId': 'string' } **Response Structure** * *(dict) --* * **VersionId** *(string) --* The versionId of the object the tag-set was removed from. **Examples** The following example removes tag set associated with the specified object version. The request specifies both the object key and object version. response = client.delete_object_tagging( Bucket='examplebucket', Key='HappyFace.jpg', VersionId='ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI', ) print(response) Expected Output: { 'VersionId': 'ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI', 'ResponseMetadata': { '...': '...', }, } The following example removes tag set associated with the specified object. If the bucket is versioning enabled, the operation removes tag set from the latest object version. response = client.delete_object_tagging( Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'VersionId': 'null', 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_policy_status get_bucket_policy_status ************************ S3.Client.get_bucket_policy_status(**kwargs) Note: This operation is not supported for directory buckets. Retrieves the policy status for an Amazon S3 bucket, indicating whether the bucket is public. In order to use this operation, you must have the "s3:GetBucketPolicyStatus" permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. For more information about when Amazon S3 considers a bucket public, see The Meaning of "Public". The following operations are related to "GetBucketPolicyStatus": * Using Amazon S3 Block Public Access * GetPublicAccessBlock * PutPublicAccessBlock * DeletePublicAccessBlock See also: AWS API Documentation **Request Syntax** response = client.get_bucket_policy_status( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose policy status you want to retrieve. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'PolicyStatus': { 'IsPublic': True|False } } **Response Structure** * *(dict) --* * **PolicyStatus** *(dict) --* The policy status for the specified bucket. * **IsPublic** *(boolean) --* The policy status for this bucket. "TRUE" indicates that this bucket is public. "FALSE" indicates that the bucket is not public. S3 / Client / restore_object restore_object ************** S3.Client.restore_object(**kwargs) Note: This operation is not supported for directory buckets. Restores an archived copy of an object back into Amazon S3 This functionality is not supported for Amazon S3 on Outposts. This action performs the following types of requests: * "restore an archive" - Restore an archived object For more information about the "S3" structure in the request body, see the following: * PutObject * Managing Access with ACLs in the *Amazon S3 User Guide* * Protecting Data Using Server-Side Encryption in the *Amazon S3 User Guide* Permissions To use this operation, you must have permissions to perform the "s3:RestoreObject" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources in the *Amazon S3 User Guide*. Restoring objects Objects that you archive to the S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive storage class, and S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep Archive tiers, are not accessible in real time. For objects in the S3 Glacier Flexible Retrieval or S3 Glacier Deep Archive storage classes, you must first initiate a restore request, and then wait until a temporary copy of the object is available. If you want a permanent copy of the object, create a copy of it in the Amazon S3 Standard storage class in your S3 bucket. To access an archived object, you must restore the object for the duration (number of days) that you specify. For objects in the Archive Access or Deep Archive Access tiers of S3 Intelligent-Tiering, you must first initiate a restore request, and then wait until the object is moved into the Frequent Access tier. To restore a specific object version, you can provide a version ID. If you don't provide a version ID, Amazon S3 restores the current version. When restoring an archived object, you can specify one of the following data access tier options in the "Tier" element of the request body: * "Expedited" - Expedited retrievals allow you to quickly access your data stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier when occasional urgent requests for restoring archives are required. For all but the largest archived objects (250 MB+), data accessed using Expedited retrievals is typically made available within 1–5 minutes. Provisioned capacity ensures that retrieval capacity for Expedited retrievals is available when you need it. Expedited retrievals and provisioned capacity are not available for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. * "Standard" - Standard retrievals allow you to access any of your archived objects within several hours. This is the default option for retrieval requests that do not specify the retrieval option. Standard retrievals typically finish within 3–5 hours for objects stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. They typically finish within 12 hours for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. Standard retrievals are free for objects stored in S3 Intelligent-Tiering. * "Bulk" - Bulk retrievals free for objects stored in the S3 Glacier Flexible Retrieval and S3 Intelligent-Tiering storage classes, enabling you to retrieve large amounts, even petabytes, of data at no cost. Bulk retrievals typically finish within 5–12 hours for objects stored in the S3 Glacier Flexible Retrieval storage class or S3 Intelligent-Tiering Archive tier. Bulk retrievals are also the lowest-cost retrieval option when restoring objects from S3 Glacier Deep Archive. They typically finish within 48 hours for objects stored in the S3 Glacier Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. For more information about archive retrieval options and provisioned capacity for "Expedited" data access, see Restoring Archived Objects in the *Amazon S3 User Guide*. You can use Amazon S3 restore speed upgrade to change the restore speed to a faster speed while it is in progress. For more information, see Upgrading the speed of an in-progress restore in the *Amazon S3 User Guide*. To get the status of object restoration, you can send a "HEAD" request. Operations return the "x-amz-restore" header, which provides information about the restoration status, in the response. You can use Amazon S3 event notifications to notify you when a restore is initiated or completed. For more information, see Configuring Amazon S3 Event Notifications in the *Amazon S3 User Guide*. After restoring an archived object, you can update the restoration period by reissuing the request with a new period. Amazon S3 updates the restoration period relative to the current time and charges only for the request-there are no data transfer charges. You cannot update the restoration period when Amazon S3 is actively processing your current restore request for the object. If your bucket has a lifecycle configuration with a rule that includes an expiration action, the object expiration overrides the life span that you specify in a restore request. For example, if you restore an object copy for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes the object in 3 days. For more information about lifecycle configuration, see PutBucketLifecycleConfiguration and Object Lifecycle Management in *Amazon S3 User Guide*. Responses A successful action returns either the "200 OK" or "202 Accepted" status code. * If the object is not previously restored, then Amazon S3 returns "202 Accepted" in the response. * If the object is previously restored, Amazon S3 returns "200 OK" in the response. * Special errors: * *Code: RestoreAlreadyInProgress* * *Cause: Object restore is already in progress.* * *HTTP Status Code: 409 Conflict* * *SOAP Fault Code Prefix: Client* * * *Code: GlacierExpeditedRetrievalNotAvailable* * *Cause: expedited retrievals are currently not available. Try again later. (Returned if there is insufficient capacity to process the Expedited request. This error applies only to Expedited retrievals and not to S3 Standard or Bulk retrievals.)* * *HTTP Status Code: 503* * *SOAP Fault Code Prefix: N/A* The following operations are related to "RestoreObject": * PutBucketLifecycleConfiguration * GetBucketNotificationConfiguration See also: AWS API Documentation **Request Syntax** response = client.restore_object( Bucket='string', Key='string', VersionId='string', RestoreRequest={ 'Days': 123, 'GlacierJobParameters': { 'Tier': 'Standard'|'Bulk'|'Expedited' }, 'Type': 'SELECT', 'Tier': 'Standard'|'Bulk'|'Expedited', 'Description': 'string', 'SelectParameters': { 'InputSerialization': { 'CSV': { 'FileHeaderInfo': 'USE'|'IGNORE'|'NONE', 'Comments': 'string', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string', 'AllowQuotedRecordDelimiter': True|False }, 'CompressionType': 'NONE'|'GZIP'|'BZIP2', 'JSON': { 'Type': 'DOCUMENT'|'LINES' }, 'Parquet': {} }, 'ExpressionType': 'SQL', 'Expression': 'string', 'OutputSerialization': { 'CSV': { 'QuoteFields': 'ALWAYS'|'ASNEEDED', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string' }, 'JSON': { 'RecordDelimiter': 'string' } } }, 'OutputLocation': { 'S3': { 'BucketName': 'string', 'Prefix': 'string', 'Encryption': { 'EncryptionType': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'KMSKeyId': 'string', 'KMSContext': 'string' }, 'CannedACL': 'private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', 'AccessControlList': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Tagging': { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, 'UserMetadata': [ { 'Name': 'string', 'Value': 'string' }, ], 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS' } } }, RequestPayer='requester', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object to restore. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Object key for which the action was initiated. * **VersionId** (*string*) -- VersionId used to reference a specific version of the object. * **RestoreRequest** (*dict*) -- Container for restore job parameters. * **Days** *(integer) --* Lifetime of the active copy in days. Do not use with restores that specify "OutputLocation". The Days element is required for regular restores, and must not be provided for select requests. * **GlacierJobParameters** *(dict) --* S3 Glacier related parameters pertaining to this job. Do not use with restores that specify "OutputLocation". * **Tier** *(string) --* **[REQUIRED]** Retrieval tier at which the restore will be processed. * **Type** *(string) --* Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more Type of restore request. * **Tier** *(string) --* Retrieval tier at which the restore will be processed. * **Description** *(string) --* The optional description for the job. * **SelectParameters** *(dict) --* Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more Describes the parameters for Select job types. * **InputSerialization** *(dict) --* **[REQUIRED]** Describes the serialization format of the object. * **CSV** *(dict) --* Describes the serialization of a CSV-encoded object. * **FileHeaderInfo** *(string) --* Describes the first line of input. Valid values are: * "NONE": First line is not a header. * "IGNORE": First line is a header, but you can't use the header values to indicate the column in an expression. You can use column position (such as _1, _2, …) to indicate the column ( "SELECT s._1 FROM OBJECT s"). * "Use": First line is a header, and you can use the header value to identify a column in an expression ( "SELECT "name" FROM OBJECT"). * **Comments** *(string) --* A single character used to indicate that a row should be ignored when the character is present at the start of that row. You can specify any character to indicate a comment line. The default character is "#". Default: "#" * **QuoteEscapeCharacter** *(string) --* A single character used for escaping the quotation mark character inside an already escaped value. For example, the value """" a , b """" is parsed as "" a , b "". * **RecordDelimiter** *(string) --* A single character used to separate individual records in the input. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* A single character used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". Type: String Default: """ Ancestors: "CSV" * **AllowQuotedRecordDelimiter** *(boolean) --* Specifies that CSV field values may contain quoted record delimiters and such records should be allowed. Default value is FALSE. Setting this value to TRUE may lower performance. * **CompressionType** *(string) --* Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default Value: NONE. * **JSON** *(dict) --* Specifies JSON as object's input serialization format. * **Type** *(string) --* The type of JSON. Valid values: Document, Lines. * **Parquet** *(dict) --* Specifies Parquet as object's input serialization format. * **ExpressionType** *(string) --* **[REQUIRED]** The type of the provided expression (for example, SQL). * **Expression** *(string) --* **[REQUIRED]** Warning: Amazon S3 Select is no longer available to new customers. Existing customers of Amazon S3 Select can continue to use the feature as usual. Learn more The expression that is used to query the object. * **OutputSerialization** *(dict) --* **[REQUIRED]** Describes how the results of the Select job are serialized. * **CSV** *(dict) --* Describes the serialization of CSV-encoded Select results. * **QuoteFields** *(string) --* Indicates whether to use quotation marks around output fields. * "ALWAYS": Always use quotation marks for output fields. * "ASNEEDED": Use quotation marks for output fields when needed. * **QuoteEscapeCharacter** *(string) --* The single character used for escaping the quote character inside an already escaped value. * **RecordDelimiter** *(string) --* A single character used to separate individual records in the output. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* The value used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". * **JSON** *(dict) --* Specifies JSON as request's output serialization format. * **RecordDelimiter** *(string) --* The value used to separate individual records in the output. If no value is specified, Amazon S3 uses a newline character ('n'). * **OutputLocation** *(dict) --* Describes the location where the restore job's output is stored. * **S3** *(dict) --* Describes an S3 location that will receive the results of the restore request. * **BucketName** *(string) --* **[REQUIRED]** The name of the bucket where the restore results will be placed. * **Prefix** *(string) --* **[REQUIRED]** The prefix that is prepended to the restore results for this request. * **Encryption** *(dict) --* Contains the type of server-side encryption used. * **EncryptionType** *(string) --* **[REQUIRED]** The server-side encryption algorithm used when storing job results in Amazon S3 (for example, AES256, "aws:kms"). * **KMSKeyId** *(string) --* If the encryption type is "aws:kms", this optional value specifies the ID of the symmetric encryption customer managed key to use for encryption of job results. Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in KMS in the *Amazon Web Services Key Management Service Developer Guide*. * **KMSContext** *(string) --* If the encryption type is "aws:kms", this optional value can be used to specify the encryption context for the restore results. * **CannedACL** *(string) --* The canned ACL to apply to the restore results. * **AccessControlList** *(list) --* A list of grants that control access to the staged results. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Tagging** *(dict) --* The tag-set that is applied to the restore results. * **TagSet** *(list) --* **[REQUIRED]** A collection for a set of tags * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **UserMetadata** *(list) --* A list of metadata to store with the restore results in S3. * *(dict) --* A metadata key-value pair to store with an object. * **Name** *(string) --* Name of the object. * **Value** *(string) --* Value of the object. * **StorageClass** *(string) --* The class of storage used to store the restore results. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester', 'RestoreOutputPath': 'string' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **RestoreOutputPath** *(string) --* Indicates the path in the provided S3 output location where Select results will be restored to. **Exceptions** * "S3.Client.exceptions.ObjectAlreadyInActiveTierError" **Examples** The following example restores for one day an archived copy of an object back into Amazon S3 bucket. response = client.restore_object( Bucket='examplebucket', Key='archivedobjectkey', RestoreRequest={ 'Days': 1, 'GlacierJobParameters': { 'Tier': 'Expedited', }, }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket_tagging delete_bucket_tagging ********************* S3.Client.delete_bucket_tagging(**kwargs) Note: This operation is not supported for directory buckets. Deletes the tags from the bucket. To use this operation, you must have permission to perform the "s3:PutBucketTagging" action. By default, the bucket owner has this permission and can grant this permission to others. The following operations are related to "DeleteBucketTagging": * GetBucketTagging * PutBucketTagging See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_tagging( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket that has the tag set to be removed. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example deletes bucket tags. response = client.delete_bucket_tagging( Bucket='examplebucket', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / list_bucket_metrics_configurations list_bucket_metrics_configurations ********************************** S3.Client.list_bucket_metrics_configurations(**kwargs) Note: This operation is not supported for directory buckets. Lists the metrics configurations for the bucket. The metrics configurations are only for the request metrics of the bucket and do not provide information on daily storage metrics. You can have up to 1,000 configurations per bucket. This action supports list pagination and does not return more than 100 configurations at a time. Always check the "IsTruncated" element in the response. If there are no more configurations to list, "IsTruncated" is set to false. If there are more configurations to list, "IsTruncated" is set to true, and there is a value in "NextContinuationToken". You use the "NextContinuationToken" value to continue the pagination of the list by passing the value in "continuation-token" in the request to "GET" the next page. To use this operation, you must have permissions to perform the "s3:GetMetricsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For more information about metrics configurations and CloudWatch request metrics, see Monitoring Metrics with Amazon CloudWatch. The following operations are related to "ListBucketMetricsConfigurations": * PutBucketMetricsConfiguration * GetBucketMetricsConfiguration * DeleteBucketMetricsConfiguration See also: AWS API Documentation **Request Syntax** response = client.list_bucket_metrics_configurations( Bucket='string', ContinuationToken='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the metrics configurations to retrieve. * **ContinuationToken** (*string*) -- The marker that is used to continue a metrics configuration listing that has been truncated. Use the "NextContinuationToken" from a previously truncated list response to continue the listing. The continuation token is an opaque value that Amazon S3 understands. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'ContinuationToken': 'string', 'NextContinuationToken': 'string', 'MetricsConfigurationList': [ { 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'AccessPointArn': 'string', 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'AccessPointArn': 'string' } } }, ] } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* Indicates whether the returned list of metrics configurations is complete. A value of true indicates that the list is not complete and the NextContinuationToken will be provided for a subsequent request. * **ContinuationToken** *(string) --* The marker that is used as a starting point for this metrics configuration list response. This value is present if it was sent in the request. * **NextContinuationToken** *(string) --* The marker used to continue a metrics configuration listing that has been truncated. Use the "NextContinuationToken" from a previously truncated list response to continue the listing. The continuation token is an opaque value that Amazon S3 understands. * **MetricsConfigurationList** *(list) --* The list of metrics configurations for a bucket. * *(dict) --* Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket. If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration. * **Id** *(string) --* The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores. * **Filter** *(dict) --* Specifies a metrics configuration filter. The metrics configuration will only include objects that meet the filter's criteria. A filter must be a prefix, an object tag, an access point ARN, or a conjunction (MetricsAndOperator). * **Prefix** *(string) --* The prefix used when evaluating a metrics filter. * **Tag** *(dict) --* The tag used when evaluating a metrics filter. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **AccessPointArn** *(string) --* The access point ARN used when evaluating a metrics filter. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates, and an object must match all of the predicates in order for the filter to apply. * **Prefix** *(string) --* The prefix used when evaluating an AND predicate. * **Tags** *(list) --* The list of tags used when evaluating an AND predicate. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **AccessPointArn** *(string) --* The access point ARN used when evaluating an "AND" predicate. S3 / Client / put_bucket_lifecycle_configuration put_bucket_lifecycle_configuration ********************************** S3.Client.put_bucket_lifecycle_configuration(**kwargs) Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. Keep in mind that this will overwrite an existing lifecycle configuration, so if you want to retain any configuration details, they must be included in the new lifecycle configuration. For information about lifecycle configuration, see Managing your storage lifecycle. Note: Bucket lifecycle configuration now supports specifying a lifecycle rule using an object key name prefix, one or more object tags, object size, or any combination of these. Accordingly, this section describes the latest API. The previous version of the API supported filtering based only on an object key name prefix, which is supported for backward compatibility. For the related API description, see PutBucketLifecycle.Rules Permissions HTTP Host header syntax You specify the lifecycle configuration in your request body. The lifecycle configuration is specified as XML consisting of one or more rules. An Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not adjustable. Bucket lifecycle configuration supports specifying a lifecycle rule using an object key name prefix, one or more object tags, object size, or any combination of these. Accordingly, this section describes the latest API. The previous version of the API supported filtering based only on an object key name prefix, which is supported for backward compatibility for general purpose buckets. For the related API description, see PutBucketLifecycle. Note: Lifecyle configurations for directory buckets only support expiring objects and cancelling multipart uploads. Expiring of versioned objects,transitions and tag filters are not supported. A lifecycle rule consists of the following: * A filter identifying a subset of objects to which the rule applies. The filter can be based on a key name prefix, object tags, object size, or any combination of these. * A status indicating whether the rule is in effect. * One or more lifecycle transition and expiration actions that you want Amazon S3 to perform on the objects identified by the filter. If the state of your bucket is versioning-enabled or versioning-suspended, you can have many versions of the same object (one current version and zero or more noncurrent versions). Amazon S3 provides predefined actions that you can specify for current and noncurrent object versions. For more information, see Object Lifecycle Management and Lifecycle Configuration Elements. * **General purpose bucket permissions** - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the "s3:PutLifecycleConfiguration" permission. You can also explicitly deny permissions. An explicit deny also supersedes any other permissions. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them permissions for the following actions: * "s3:DeleteObject" * "s3:DeleteObjectVersion" * "s3:PutLifecycleConfiguration" For more information about permissions, see Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - You must have the "s3express:PutLifecycleConfiguration" permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource. For more information about directory bucket policies and permissions, see Authorizing Regional endpoint APIs with IAM in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". The following operations are related to "PutBucketLifecycleConfiguration": * GetBucketLifecycleConfiguration * DeleteBucketLifecycle See also: AWS API Documentation **Request Syntax** response = client.put_bucket_lifecycle_configuration( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', LifecycleConfiguration={ 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Prefix': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 } }, 'Status': 'Enabled'|'Disabled', 'Transitions': [ { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR' }, ], 'NoncurrentVersionTransitions': [ { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'NewerNoncurrentVersions': 123 }, ], 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] }, ExpectedBucketOwner='string', TransitionDefaultMinimumObjectSize='varies_by_storage_class'|'all_storage_classes_128K' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to set the configuration. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **LifecycleConfiguration** (*dict*) -- Container for lifecycle rules. You can add as many as 1,000 rules. * **Rules** *(list) --* **[REQUIRED]** A lifecycle rule for individual objects in an Amazon S3 bucket. * *(dict) --* A lifecycle rule for individual objects in an Amazon S3 bucket. For more information see, Managing your storage lifecycle in the *Amazon S3 User Guide*. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. This is no longer used; use "Filter" instead. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Filter** *(dict) --* The "Filter" is used to identify objects that a Lifecycle Rule applies to. A "Filter" must have exactly one of "Prefix", "Tag", "ObjectSizeGreaterThan", "ObjectSizeLessThan", or "And" specified. "Filter" is required if the "LifecycleRule" does not contain a "Prefix" element. For more information about "Tag" filters, see Adding filters to Lifecycle rules in the *Amazon S3 User Guide*. Note: "Tag" filters are not supported for directory buckets. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* This tag must exist in the object's tag set in order for the rule to apply. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **And** *(dict) --* This is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates. The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the rule to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **Status** *(string) --* **[REQUIRED]** If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. * **Transitions** *(list) --* Specifies when an Amazon S3 object transitions to a specified storage class. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransitions** *(list) --* Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific 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 a specific storage class at a set period in the object's lifetime. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **TransitionDefaultMinimumObjectSize** (*string*) -- Indicates which default minimum object size behavior is applied to the lifecycle configuration. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * "all_storage_classes_128K" - Objects smaller than 128 KB will not transition to any storage class by default. * "varies_by_storage_class" - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom "ObjectSizeGreaterThan" or "ObjectSizeLessThan" in the body of your transition rule. Custom filters always take precedence over the default transition behavior. Return type: dict Returns: **Response Syntax** { 'TransitionDefaultMinimumObjectSize': 'varies_by_storage_class'|'all_storage_classes_128K' } **Response Structure** * *(dict) --* * **TransitionDefaultMinimumObjectSize** *(string) --* Indicates which default minimum object size behavior is applied to the lifecycle configuration. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * "all_storage_classes_128K" - Objects smaller than 128 KB will not transition to any storage class by default. * "varies_by_storage_class" - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom "ObjectSizeGreaterThan" or "ObjectSizeLessThan" in the body of your transition rule. Custom filters always take precedence over the default transition behavior. **Examples** The following example replaces existing lifecycle configuration, if any, on the specified bucket. response = client.put_bucket_lifecycle_configuration( Bucket='examplebucket', LifecycleConfiguration={ 'Rules': [ { 'Expiration': { 'Days': 3650, }, 'Filter': { 'Prefix': 'documents/', }, 'ID': 'TestOnly', 'Status': 'Enabled', 'Transitions': [ { 'Days': 365, 'StorageClass': 'GLACIER', }, ], }, ], }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / download_file download_file ************* S3.Client.download_file(Bucket, Key, Filename, ExtraArgs=None, Callback=None, Config=None) Download an S3 object to a file. Usage: import boto3 s3 = boto3.client('s3') s3.download_file('amzn-s3-demo-bucket', 'hello.txt', '/tmp/hello.txt') Similar behavior as S3Transfer's download_file() method, except that parameters are capitalized. Detailed examples can be found at *S3Transfer's Usage*. Parameters: * **Bucket** (*str*) -- The name of the bucket to download from. * **Key** (*str*) -- The name of the key to download from. * **Filename** (*str*) -- The path to the file to download to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the download. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the transfer. S3 / Client / list_buckets list_buckets ************ S3.Client.list_buckets(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Returns a list of all buckets owned by the authenticated sender of the request. To grant IAM permission to use this operation, you must add the "s3:ListAllMyBuckets" policy action. For information about Amazon S3 buckets, see Creating, configuring, and working with Amazon S3 buckets. Warning: We strongly recommend using only paginated "ListBuckets" requests. Unpaginated "ListBuckets" requests are only supported for Amazon Web Services accounts set to the default general purpose bucket quota of 10,000. If you have an approved general purpose bucket quota above 10,000, you must send paginated "ListBuckets" requests to list your account’s buckets. All unpaginated "ListBuckets" requests will be rejected for Amazon Web Services accounts with a general purpose bucket quota greater than 10,000. See also: AWS API Documentation **Request Syntax** response = client.list_buckets( MaxBuckets=123, ContinuationToken='string', Prefix='string', BucketRegion='string' ) Parameters: * **MaxBuckets** (*integer*) -- Maximum number of buckets to be returned in response. When the number is more than the count of buckets that are owned by an Amazon Web Services account, return all the buckets in response. * **ContinuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on this bucket with a token. "ContinuationToken" is obfuscated and is not a real key. You can use this "ContinuationToken" for pagination of the list results. Length Constraints: Minimum length of 0. Maximum length of 1024. Required: No. Note: If you specify the "bucket-region", "prefix", or "continuation-token" query parameters without using "max- buckets" to set the maximum number of buckets returned in the response, Amazon S3 applies a default page size of 10,000 and provides a continuation token if there are more buckets. * **Prefix** (*string*) -- Limits the response to bucket names that begin with the specified bucket name prefix. * **BucketRegion** (*string*) -- Limits the response to buckets that are located in the specified Amazon Web Services Region. The Amazon Web Services Region must be expressed according to the Amazon Web Services Region code, such as "us-west-2" for the US West (Oregon) Region. For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints. Note: Requests made to a Regional endpoint that is different from the "bucket-region" parameter are not supported. For example, if you want to limit the response to your buckets in Region "us-west-2", the request must be made to an endpoint in Region "us-west-2". Return type: dict Returns: **Response Syntax** { 'Buckets': [ { 'Name': 'string', 'CreationDate': datetime(2015, 1, 1), 'BucketRegion': 'string', 'BucketArn': 'string' }, ], 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'ContinuationToken': 'string', 'Prefix': 'string' } **Response Structure** * *(dict) --* * **Buckets** *(list) --* The list of buckets owned by the requester. * *(dict) --* In terms of implementation, a Bucket is a resource. * **Name** *(string) --* The name of the bucket. * **CreationDate** *(datetime) --* Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy. * **BucketRegion** *(string) --* "BucketRegion" indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * **Owner** *(dict) --* The owner of the buckets listed. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **ContinuationToken** *(string) --* "ContinuationToken" is included in the response when there are more buckets that can be listed with pagination. The next "ListBuckets" request to Amazon S3 can be continued with this "ContinuationToken". "ContinuationToken" is obfuscated and is not a real bucket. * **Prefix** *(string) --* If "Prefix" was sent with the request, it is included in the response. All bucket names in the response begin with the specified bucket name prefix. S3 / Client / rename_object rename_object ************* S3.Client.rename_object(**kwargs) Renames an existing object in a directory bucket that uses the S3 Express One Zone storage class. You can use "RenameObject" by specifying an existing object’s name as the source and the new name of the object as the destination within the same directory bucket. Note: "RenameObject" is only supported for objects stored in the S3 Express One Zone storage class. To prevent overwriting an object, you can use the "If-None-Match" conditional header. * **If-None-Match** - Renames the object only if an object with the specified name does not already exist in the directory bucket. If you don't want to overwrite an existing object, you can add the "If-None-Match" conditional header with the value "‘*’" in the "RenameObject" request. Amazon S3 then returns a "412 Precondition Failed" error if the object with the specified name already exists. For more information, see RFC 7232. Permissions To grant access to the "RenameObject" operation on a directory bucket, we recommend that you use the "CreateSession" operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the "CreateSession" API call on the directory bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. The Amazon Web Services CLI and SDKs will create and manage your session including refreshing the session token automatically to avoid service interruptions when a session expires. In your bucket policy, you can specify the "s3express:SessionMode" condition key to control who can create a "ReadWrite" or "ReadOnly" session. A "ReadWrite" session is required for executing all the Zonal endpoint API operations, including "RenameObject". For more information about authorization, see CreateSession. To learn more about Zonal endpoint API operations, see Authorizing Zonal endpoint API operations with CreateSession in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". See also: AWS API Documentation **Request Syntax** response = client.rename_object( Bucket='string', Key='string', RenameSource='string', DestinationIfMatch='string', DestinationIfNoneMatch='string', DestinationIfModifiedSince=datetime(2015, 1, 1), DestinationIfUnmodifiedSince=datetime(2015, 1, 1), SourceIfMatch='string', SourceIfNoneMatch='string', SourceIfModifiedSince=datetime(2015, 1, 1), SourceIfUnmodifiedSince=datetime(2015, 1, 1), ClientToken='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name of the directory bucket containing the object. You must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region-code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Key name of the object to rename. * **RenameSource** (*string*) -- **[REQUIRED]** Specifies the source for the rename operation. The value must be URL encoded. * **DestinationIfMatch** (*string*) -- Renames the object only if the ETag (entity tag) value provided during the operation matches the ETag of the object in S3. The "If-Match" header field makes the request method conditional on ETags. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. Expects the ETag value as a string. * **DestinationIfNoneMatch** (*string*) -- Renames the object only if the destination does not already exist in the specified directory bucket. If the object does exist when you send a request with "If-None-Match:*", the S3 API will return a "412 Precondition Failed" error, preventing an overwrite. The "If-None-Match" header prevents overwrites of existing data by validating that there's not an object with the same key name already in your directory bucket. Expects the "*" character (asterisk). * **DestinationIfModifiedSince** (*datetime*) -- Renames the object if the destination exists and if it has been modified since the specified time. * **DestinationIfUnmodifiedSince** (*datetime*) -- Renames the object if it hasn't been modified since the specified time. * **SourceIfMatch** (*string*) -- Renames the object if the source exists and if its entity tag (ETag) matches the specified ETag. * **SourceIfNoneMatch** (*string*) -- Renames the object if the source exists and if its entity tag (ETag) is different than the specified ETag. If an asterisk ( "*") character is provided, the operation will fail and return a "412 Precondition Failed" error. * **SourceIfModifiedSince** (*datetime*) -- Renames the object if the source exists and if it has been modified since the specified time. * **SourceIfUnmodifiedSince** (*datetime*) -- Renames the object if the source exists and hasn't been modified since the specified time. * **ClientToken** (*string*) -- A unique string with a max of 64 ASCII characters in the ASCII range of 33 - 126. Note: "RenameObject" supports idempotency using a client token. To make an idempotent API request using "RenameObject", specify a client token in the request. You should not reuse the same client token for other API requests. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails and an "IdempotentParameterMismatch" error is returned. This field is autopopulated if not provided. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3.Client.exceptions.IdempotencyParameterMismatch" S3 / Client / can_paginate can_paginate ************ S3.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. S3 / Client / get_bucket_intelligent_tiering_configuration get_bucket_intelligent_tiering_configuration ******************************************** S3.Client.get_bucket_intelligent_tiering_configuration(**kwargs) Note: This operation is not supported for directory buckets. Gets the S3 Intelligent-Tiering configuration from the specified bucket. The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost- effective storage access tier, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings in three low latency and high throughput access tiers. To get the lowest storage cost on data that can be accessed in minutes to hours, you can choose to activate additional archiving capabilities. The S3 Intelligent-Tiering storage class is the ideal storage class for data with unknown, changing, or unpredictable access patterns, independent of object size or retention period. If the size of an object is less than 128 KB, it is not monitored and not eligible for auto-tiering. Smaller objects can be stored, but they are always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering storage class. For more information, see Storage class for automatically optimizing frequently and infrequently accessed objects. Operations related to "GetBucketIntelligentTieringConfiguration" include: * DeleteBucketIntelligentTieringConfiguration * PutBucketIntelligentTieringConfiguration * ListBucketIntelligentTieringConfigurations See also: AWS API Documentation **Request Syntax** response = client.get_bucket_intelligent_tiering_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose configuration you want to modify or retrieve. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the S3 Intelligent-Tiering configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'IntelligentTieringConfiguration': { 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'Status': 'Enabled'|'Disabled', 'Tierings': [ { 'Days': 123, 'AccessTier': 'ARCHIVE_ACCESS'|'DEEP_ARCHIVE_ACCESS' }, ] } } **Response Structure** * *(dict) --* * **IntelligentTieringConfiguration** *(dict) --* Container for S3 Intelligent-Tiering configuration. * **Id** *(string) --* The ID used to identify the S3 Intelligent-Tiering configuration. * **Filter** *(dict) --* Specifies a bucket filter. The configuration only includes objects that meet the filter's criteria. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates, and an object must match all of the predicates in order for the filter to apply. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the configuration applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the configuration to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **Status** *(string) --* Specifies the status of the configuration. * **Tierings** *(list) --* Specifies the S3 Intelligent-Tiering storage class tier of the configuration. * *(dict) --* The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead. * **Days** *(integer) --* The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days). * **AccessTier** *(string) --* S3 Intelligent-Tiering access tier. See Storage class for automatically optimizing frequently and infrequently accessed objects for a list of access tiers in the S3 Intelligent-Tiering storage class. S3 / Client / delete_bucket_inventory_configuration delete_bucket_inventory_configuration ************************************* S3.Client.delete_bucket_inventory_configuration(**kwargs) Note: This operation is not supported for directory buckets. Deletes an S3 Inventory configuration (identified by the inventory ID) from the bucket. To use this operation, you must have permissions to perform the "s3:PutInventoryConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about the Amazon S3 inventory feature, see Amazon S3 Inventory. Operations related to "DeleteBucketInventoryConfiguration" include: * GetBucketInventoryConfiguration * PutBucketInventoryConfiguration * ListBucketInventoryConfigurations See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_inventory_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the inventory configuration to delete. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the inventory configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / delete_bucket_policy delete_bucket_policy ******************** S3.Client.delete_bucket_policy(**kwargs) Deletes the policy of a specified bucket. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must both have the "DeleteBucketPolicy" permissions on the specified bucket and belong to the bucket owner's account in order to use this operation. If you don't have "DeleteBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: To ensure that bucket owners don't inadvertently lock themselves out of their own buckets, the root principal in a bucket owner's Amazon Web Services account can perform the "GetBucketPolicy", "PutBucketPolicy", and "DeleteBucketPolicy" API actions, even if their bucket policy explicitly denies the root principal's access. Bucket owner root principals can only be blocked from performing these API actions by VPC endpoint policies and Amazon Web Services Organizations policies. * **General purpose bucket permissions** - The "s3:DeleteBucketPolicy" permission is required in a policy. For more information about general purpose buckets bucket policies, see Using Bucket Policies and User Policies in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:DeleteBucketPolicy" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "DeleteBucketPolicy" * CreateBucket * DeleteObject See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_policy( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None **Examples** The following example deletes bucket policy on the specified bucket. response = client.delete_bucket_policy( Bucket='examplebucket', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_object_attributes get_object_attributes ********************* S3.Client.get_object_attributes(**kwargs) Retrieves all of the metadata from an object without returning the object itself. This operation is useful if you're interested only in an object's metadata. "GetObjectAttributes" combines the functionality of "HeadObject" and "ListParts". All of the data returned with both of those individual calls can be returned with a single call to "GetObjectAttributes". Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - To use "GetObjectAttributes", you must have READ access to the object. The other permissions that you need to use this operation depend on whether the bucket is versioned and if a version ID is passed in the "GetObjectAttributes" request. * If you pass a version ID in your request, you need both the "s3:GetObjectVersion" and "s3:GetObjectVersionAttributes" permissions. * If you do not pass a version ID in your request, you need the "s3:GetObject" and "s3:GetObjectAttributes" permissions. For more information, see Specifying Permissions in a Policy in the *Amazon S3 User Guide*. If the object that you request does not exist, the error Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" ("no such key") error. * If you don't have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Forbidden" ("access denied") error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Encryption Note: Encryption request headers, like "x-amz-server-side-encryption", should not be sent for "HEAD" requests if your object uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3 managed encryption keys (SSE-S3). The "x-amz-server- side-encryption" header is used when you "PUT" an object to S3 and want to specify the encryption method. If you include this header in a "GET" request for an object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. It's because the encryption method can't be changed when you retrieve the object. If you encrypted an object when you stored the object in Amazon S3 by using server-side encryption with customer-provided encryption keys (SSE-C), then when you retrieve the metadata from the object, you must use the following headers. These headers provide the server with the encryption key required to retrieve the object's metadata. The headers are: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: **Directory bucket permissions** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.Versioning **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. Conditional request headers Consider the following when using request headers: * If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows, then Amazon S3 returns the HTTP status code "200 OK" and the data requested: * "If-Match" condition evaluates to "true". * "If-Unmodified-Since" condition evaluates to "false". For more information about conditional requests, see RFC 7232. * If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows, then Amazon S3 returns the HTTP status code "304 Not Modified": * "If-None-Match" condition evaluates to "false". * "If-Modified-Since" condition evaluates to "true". For more information about conditional requests, see RFC 7232. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following actions are related to "GetObjectAttributes": * GetObject * GetObjectAcl * GetObjectLegalHold * GetObjectLockConfiguration * GetObjectRetention * GetObjectTagging * HeadObject * ListParts See also: AWS API Documentation **Request Syntax** response = client.get_object_attributes( Bucket='string', Key='string', VersionId='string', MaxParts=123, PartNumberMarker=123, SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', ExpectedBucketOwner='string', ObjectAttributes=[ 'ETag'|'Checksum'|'ObjectParts'|'StorageClass'|'ObjectSize', ] ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket that contains the object. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The object key. * **VersionId** (*string*) -- The version ID used to reference a specific version of the object. Note: S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. * **MaxParts** (*integer*) -- Sets the maximum number of parts to return. For more information, see Uploading and copying objects using multipart upload in Amazon S3 in the *Amazon Simple Storage Service user guide*. * **PartNumberMarker** (*integer*) -- Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. For more information, see Uploading and copying objects using multipart upload in Amazon S3 in the *Amazon Simple Storage Service user guide*. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ObjectAttributes** (*list*) -- **[REQUIRED]** Specifies the fields at the root level that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'LastModified': datetime(2015, 1, 1), 'VersionId': 'string', 'RequestCharged': 'requester', 'ETag': 'string', 'Checksum': { 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT' }, 'ObjectParts': { 'TotalPartsCount': 123, 'PartNumberMarker': 123, 'NextPartNumberMarker': 123, 'MaxParts': 123, 'IsTruncated': True|False, 'Parts': [ { 'PartNumber': 123, 'Size': 123, 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, ] }, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'ObjectSize': 123 } **Response Structure** * *(dict) --* * **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. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **LastModified** *(datetime) --* Date and time when the object was last modified. * **VersionId** *(string) --* The version ID of the object. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ETag** *(string) --* An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. * **Checksum** *(dict) --* The checksum or digest of the object. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This checksum is present if the object was uploaded with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ObjectParts** *(dict) --* A collection of parts associated with a multipart upload. * **TotalPartsCount** *(integer) --* The total number of parts. * **PartNumberMarker** *(integer) --* The marker for the current part. * **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 "PartNumberMarker" request parameter in a subsequent request. * **MaxParts** *(integer) --* The maximum number of parts allowed in the response. * **IsTruncated** *(boolean) --* Indicates whether the returned list of parts is truncated. A value of "true" indicates that the list was truncated. A list can be truncated if the number of parts exceeds the limit returned in the "MaxParts" element. * **Parts** *(list) --* A container for elements related to a particular part. A response can contain zero or more "Parts" elements. Note: * **General purpose buckets** - For "GetObjectAttributes", if an additional checksum (including "x-amz-checksum-crc32", "x-amz-checksum- crc32c", "x-amz-checksum-sha1", or "x-amz-checksum- sha256") isn't applied to the object specified in the request, the response doesn't return the "Part" element. * **Directory buckets** - For "GetObjectAttributes", regardless of whether an additional checksum is applied to the object specified in the request, the response returns the "Part" element. * *(dict) --* A container for elements related to an individual part. * **PartNumber** *(integer) --* The part number identifying the part. This value is a positive integer between 1 and 10,000. * **Size** *(integer) --* The size of the uploaded part in bytes. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC32" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC32C" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" checksum of the part. This checksum is present if the multipart upload request was created with the "SHA1" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" checksum of the part. This checksum is present if the multipart upload request was created with the "SHA256" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* Provides the storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. For more information, see Storage Classes. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **ObjectSize** *(integer) --* The size of the object in bytes. **Exceptions** * "S3.Client.exceptions.NoSuchKey" S3 / Client / put_bucket_metrics_configuration put_bucket_metrics_configuration ******************************** S3.Client.put_bucket_metrics_configuration(**kwargs) Note: This operation is not supported for directory buckets. Sets a metrics configuration (specified by the metrics configuration ID) for the bucket. You can have up to 1,000 metrics configurations per bucket. If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. To use this operation, you must have permissions to perform the "s3:PutMetricsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about CloudWatch request metrics for Amazon S3, see Monitoring Metrics with Amazon CloudWatch. The following operations are related to "PutBucketMetricsConfiguration": * DeleteBucketMetricsConfiguration * GetBucketMetricsConfiguration * ListBucketMetricsConfigurations "PutBucketMetricsConfiguration" has the following special error: * Error code: "TooManyConfigurations" * Description: You are attempting to create a new configuration but have already reached the 1,000-configuration limit. * HTTP Status Code: HTTP 400 Bad Request See also: AWS API Documentation **Request Syntax** response = client.put_bucket_metrics_configuration( Bucket='string', Id='string', MetricsConfiguration={ 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'AccessPointArn': 'string', 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'AccessPointArn': 'string' } } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which the metrics configuration is set. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores. * **MetricsConfiguration** (*dict*) -- **[REQUIRED]** Specifies the metrics configuration. * **Id** *(string) --* **[REQUIRED]** The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores. * **Filter** *(dict) --* Specifies a metrics configuration filter. The metrics configuration will only include objects that meet the filter's criteria. A filter must be a prefix, an object tag, an access point ARN, or a conjunction (MetricsAndOperator). * **Prefix** *(string) --* The prefix used when evaluating a metrics filter. * **Tag** *(dict) --* The tag used when evaluating a metrics filter. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **AccessPointArn** *(string) --* The access point ARN used when evaluating a metrics filter. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates, and an object must match all of the predicates in order for the filter to apply. * **Prefix** *(string) --* The prefix used when evaluating an AND predicate. * **Tags** *(list) --* The list of tags used when evaluating an AND predicate. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **AccessPointArn** *(string) --* The access point ARN used when evaluating an "AND" predicate. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / put_bucket_website put_bucket_website ****************** S3.Client.put_bucket_website(**kwargs) Note: This operation is not supported for directory buckets. Sets the configuration of the website that is specified in the "website" subresource. To configure a bucket as a website, you can add this subresource on the bucket with website configuration information such as the file name of the index document and any redirect rules. For more information, see Hosting Websites on Amazon S3. This PUT action requires the "S3:PutBucketWebsite" permission. By default, only the bucket owner can configure the website attached to a bucket; however, bucket owners can allow other users to set the website configuration by writing a bucket policy that grants them the "S3:PutBucketWebsite" permission. To redirect all website requests sent to the bucket's website endpoint, you add a website configuration with the following elements. Because all requests are sent to another website, you don't need to provide index document name for the bucket. * "WebsiteConfiguration" * "RedirectAllRequestsTo" * "HostName" * "Protocol" If you want granular control over redirects, you can use the following elements to add routing rules that describe conditions for redirecting requests and information about the redirect destination. In this case, the website configuration must provide an index document for the bucket, because some requests might not be redirected. * "WebsiteConfiguration" * "IndexDocument" * "Suffix" * "ErrorDocument" * "Key" * "RoutingRules" * "RoutingRule" * "Condition" * "HttpErrorCodeReturnedEquals" * "KeyPrefixEquals" * "Redirect" * "Protocol" * "HostName" * "ReplaceKeyPrefixWith" * "ReplaceKeyWith" * "HttpRedirectCode" Amazon S3 has a limitation of 50 routing rules per website configuration. If you require more than 50 routing rules, you can use object redirect. For more information, see Configuring an Object Redirect in the *Amazon S3 User Guide*. The maximum request length is limited to 128 KB. See also: AWS API Documentation **Request Syntax** response = client.put_bucket_website( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', WebsiteConfiguration={ 'ErrorDocument': { 'Key': 'string' }, 'IndexDocument': { 'Suffix': 'string' }, 'RedirectAllRequestsTo': { 'HostName': 'string', 'Protocol': 'http'|'https' }, 'RoutingRules': [ { 'Condition': { 'HttpErrorCodeReturnedEquals': 'string', 'KeyPrefixEquals': 'string' }, 'Redirect': { 'HostName': 'string', 'HttpRedirectCode': 'string', 'Protocol': 'http'|'https', 'ReplaceKeyPrefixWith': 'string', 'ReplaceKeyWith': 'string' } }, ] }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **WebsiteConfiguration** (*dict*) -- **[REQUIRED]** Container for the request. * **ErrorDocument** *(dict) --* The name of the error document for the website. * **Key** *(string) --* **[REQUIRED]** The object key name to use when a 4XX class error occurs. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **IndexDocument** *(dict) --* The name of the index document for the website. * **Suffix** *(string) --* **[REQUIRED]** A suffix that is appended to a request that is for a directory on the website endpoint. (For example, 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **RedirectAllRequestsTo** *(dict) --* The redirect behavior for every request to this bucket's website endpoint. Warning: If you specify this property, you can't specify any other property. * **HostName** *(string) --* **[REQUIRED]** Name of the host where requests are redirected. * **Protocol** *(string) --* Protocol to use when redirecting requests. The default is the protocol that is used in the original request. * **RoutingRules** *(list) --* Rules that define when a redirect is applied and the redirect behavior. * *(dict) --* Specifies the redirect behavior and when a redirect is applied. For more information about routing rules, see Configuring advanced conditional redirects in the *Amazon S3 User Guide*. * **Condition** *(dict) --* 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Redirect** *(dict) --* **[REQUIRED]** 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 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 when redirecting requests. The default is the protocol that is used in the original request. * **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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **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 siblings is present. Can be present only if "ReplaceKeyPrefixWith" is not provided. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example adds website configuration to a bucket. response = client.put_bucket_website( Bucket='examplebucket', ContentMD5='', WebsiteConfiguration={ 'ErrorDocument': { 'Key': 'error.html', }, 'IndexDocument': { 'Suffix': 'index.html', }, }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_object_tagging put_object_tagging ****************** S3.Client.put_object_tagging(**kwargs) Note: This operation is not supported for directory buckets. Sets the supplied tag-set to an object that already exists in a bucket. A tag is a key-value pair. For more information, see Object Tagging. You can associate tags with an object by sending a PUT request against the tagging subresource that is associated with the object. You can retrieve tags by sending a GET request. For more information, see GetObjectTagging. For tagging-related restrictions related to characters and encodings, see Tag Restrictions. Note that Amazon S3 limits the maximum number of tags to 10 tags per object. To use this operation, you must have permission to perform the "s3:PutObjectTagging" action. By default, the bucket owner has this permission and can grant this permission to others. To put tags of any other version, use the "versionId" query parameter. You also need permission for the "s3:PutObjectVersionTagging" action. "PutObjectTagging" has the following special errors. For more Amazon S3 errors see, Error Responses. * "InvalidTag" - The tag provided was not a valid tag. This error can occur if the tag did not pass input validation. For more information, see Object Tagging. * "MalformedXML" - The XML provided does not match the schema. * "OperationAborted" - A conflicting conditional action is currently in progress against this resource. Please try again. * "InternalError" - The service was unable to apply the provided tag to the object. The following operations are related to "PutObjectTagging": * GetObjectTagging * DeleteObjectTagging See also: AWS API Documentation **Request Syntax** response = client.put_object_tagging( Bucket='string', Key='string', VersionId='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', Tagging={ 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, ExpectedBucketOwner='string', RequestPayer='requester' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Name of the object key. * **VersionId** (*string*) -- The versionId of the object that the tag-set will be added to. * **ContentMD5** (*string*) -- The MD5 hash for the request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **Tagging** (*dict*) -- **[REQUIRED]** Container for the "TagSet" and "Tag" elements * **TagSet** *(list) --* **[REQUIRED]** A collection for a set of tags * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Return type: dict Returns: **Response Syntax** { 'VersionId': 'string' } **Response Structure** * *(dict) --* * **VersionId** *(string) --* The versionId of the object the tag-set was added to. **Examples** The following example adds tags to an existing object. response = client.put_object_tagging( Bucket='examplebucket', Key='HappyFace.jpg', Tagging={ 'TagSet': [ { 'Key': 'Key3', 'Value': 'Value3', }, { 'Key': 'Key4', 'Value': 'Value4', }, ], }, ) print(response) Expected Output: { 'VersionId': 'null', 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_bucket_cors put_bucket_cors *************** S3.Client.put_bucket_cors(**kwargs) Note: This operation is not supported for directory buckets. Sets the "cors" configuration for your bucket. If the configuration exists, Amazon S3 replaces it. To use this operation, you must be allowed to perform the "s3:PutBucketCORS" action. By default, the bucket owner has this permission and can grant it to others. You set this configuration on a bucket so that the bucket can service cross-origin requests. For example, you might want to enable a request whose origin is "http://www.example.com" to access your Amazon S3 bucket at "my.example.bucket.com" by using the browser's "XMLHttpRequest" capability. To enable cross-origin resource sharing (CORS) on a bucket, you add the "cors" subresource to the bucket. The "cors" subresource is an XML document in which you configure rules that identify origins and the HTTP methods that can be executed on your bucket. The document is limited to 64 KB in size. When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS request) against a bucket, it evaluates the "cors" configuration on the bucket and uses the first "CORSRule" rule that matches the incoming browser request to enable a cross-origin request. For a rule to match, the following conditions must be met: * The request's "Origin" header must match "AllowedOrigin" elements. * The request method (for example, GET, PUT, HEAD, and so on) or the "Access-Control-Request-Method" header in case of a pre- flight "OPTIONS" request must be one of the "AllowedMethod" elements. * Every header specified in the "Access-Control-Request-Headers" request header of a pre-flight request must match an "AllowedHeader" element. For more information about CORS, go to Enabling Cross-Origin Resource Sharing in the *Amazon S3 User Guide*. The following operations are related to "PutBucketCors": * GetBucketCors * DeleteBucketCors * RESTOPTIONSobject See also: AWS API Documentation **Request Syntax** response = client.put_bucket_cors( Bucket='string', CORSConfiguration={ 'CORSRules': [ { 'ID': 'string', 'AllowedHeaders': [ 'string', ], 'AllowedMethods': [ 'string', ], 'AllowedOrigins': [ 'string', ], 'ExposeHeaders': [ 'string', ], 'MaxAgeSeconds': 123 }, ] }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket impacted by the >>``<>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. * VPC endpoints don't support cross-Region requests (including copies). If you're using VPC endpoints, your source and destination buckets should be in the same Amazon Web Services Region as your VPC endpoint. 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. For more information about how to enable a Region for your account, see Enable or disable a Region for standalone accounts in the *Amazon Web Services Account Management Guide*. Warning: 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 Bad Request" error. For more information, see Transfer Acceleration.Authentication and authorization All "CopyObject" requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the "x-amz-" prefix, including "x -amz-copy-source", must be signed. For more information, see REST Authentication. **Directory buckets** - You must use the IAM credentials to authenticate and authorize your access to the "CopyObject" API operation, instead of using the temporary security credentials through the "CreateSession" API operation. Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. Permissions You must have *read* access to the source object and *write* access to the destination bucket. * **General purpose bucket permissions** - You must have permissions in an IAM policy based on the source and destination bucket types in a "CopyObject" operation. * If the source object is in a general purpose bucket, you must have "s3:GetObject" permission to read the source object that is being copied. * If the destination bucket is a general purpose bucket, you must have "s3:PutObject" permission to write the object copy to the destination bucket. * **Directory bucket permissions** - You must have permissions in a bucket policy or an IAM identity-based policy based on the source and destination bucket types in a "CopyObject" operation. * If the source object that you want to copy is in a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to read the object. By default, the session is in the "ReadWrite" mode. If you want to restrict the access, you can explicitly set the "s3express:SessionMode" condition key to "ReadOnly" on the copy source bucket. * If the copy destination is a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to write the object to the destination. The "s3express:SessionMode" condition key can't be set to "ReadOnly" on the copy destination bucket. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. Response and special errors When the request is an HTTP 1.1 request, the response is chunk encoded. When the request is not an HTTP 1.1 request, the response would not contain the "Content-Length". You always need to read the entire response body to check if the copy succeeds. * If the copy is successful, you receive a response with information about the copied object. * A copy request might return an error when Amazon S3 receives the copy request or while Amazon S3 is copying the files. A "200 OK" response can contain either a success or an error. * 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 "200 OK" response. For example, in a cross-region copy, you may encounter throttling and receive a "200 OK" response. For more information, see Resolve the Error 200 response when copying objects to Amazon S3. The "200 OK" status code means the copy was accepted, but it doesn't mean the copy is complete. Another example is when you disconnect from Amazon S3 before the copy is complete, Amazon S3 might cancel the copy and you may receive a "200 OK" response. You must stay connected to Amazon S3 until the entire response is successfully received and processed. If you call this API operation directly, make sure to design your application to parse the content of the response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply error handling per your configuration settings (including automatically retrying the request as appropriate). If the condition persists, the SDKs throw an exception (or, for the SDKs that don't use exceptions, they return an error). Charge The copy request charge is based on the storage class and Region that you specify for the destination object. The request can also result in a data retrieval charge for the source if the source storage class bills for data retrieval. If the copy source is in a different region, the data transfer is billed to the copy source account. For pricing information, see Amazon S3 pricing. HTTP Host header syntax * **Directory buckets** - The HTTP Host header syntax is "Bucket- name.s3express-zone-id.region-code.amazonaws.com". * **Amazon S3 on Outposts** - When you use this action with S3 on Outposts through the REST API, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". The hostname isn't required when you use the Amazon Web Services CLI or SDKs. The following operations are related to "CopyObject": * PutObject * GetObject See also: AWS API Documentation **Request Syntax** response = client.copy_object( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Bucket='string', CacheControl='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentType='string', CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}, CopySourceIfMatch='string', CopySourceIfModifiedSince=datetime(2015, 1, 1), CopySourceIfNoneMatch='string', CopySourceIfUnmodifiedSince=datetime(2015, 1, 1), Expires=datetime(2015, 1, 1), GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Key='string', Metadata={ 'string': 'string' }, MetadataDirective='COPY'|'REPLACE', TaggingDirective='COPY'|'REPLACE', ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, CopySourceSSECustomerAlgorithm='string', CopySourceSSECustomerKey='string', RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string', ExpectedSourceBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned access control list (ACL) to apply to the object. When you copy an object, the ACL metadata is not preserved and is set to "private" by default. Only the owner has full access control. To override the default ACL setting, specify a new ACL when you generate a copy request. For more information, see Using ACLs. If the destination 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * If your destination 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. * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Bucket** (*string*) -- **[REQUIRED]** The name of the destination bucket. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. Note: Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP "400 Bad Request" error with the error code "InvalidRequest". **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must use the Outpost bucket access point ARN or the access point alias for the destination bucket. You can only copy objects within the same Outpost bucket. It's not supported to copy objects across different Amazon Web Services Outposts, between buckets on the same Outposts, or between Outposts buckets and any other bucket types. For more information about S3 on Outposts, see What is S3 on Outposts? in the *S3 on Outposts guide*. When you use this action with S3 on Outposts through the REST API, you must direct requests to the S3 on Outposts hostname, in the format "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". The hostname isn't required when you use the Amazon Web Services CLI or SDKs. * **CacheControl** (*string*) -- Specifies the caching behavior along the request/reply chain. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm that you want Amazon S3 to use to create the checksum for the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. When you copy an object, if the source object has a checksum, that checksum value will be copied to the new object by default. If the "CopyObject" request does not include this "x -amz-checksum-algorithm" header, the checksum algorithm will be copied from the source object to the destination object (if it's present on the source object). You can optionally specify a different checksum algorithm to use with the "x-amz- checksum-algorithm" header. Unrecognized or unsupported values will respond with the HTTP status code "400 Bad Request". Note: For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. Indicates whether an object should be displayed in a web browser or downloaded as a file. It allows specifying the desired filename for the downloaded file. * **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. Note: For directory buckets, only the "aws-chunked" value is supported in this header field. * **ContentLanguage** (*string*) -- The language the content is in. * **ContentType** (*string*) -- A standard MIME type that describes the format of the object data. * **CopySource** (*str** or **dict*) -- **[REQUIRED]** The name of the source bucket, key name of the source object, and optional version ID of the source object. You can either provide this value as a string or a dictionary. The string form is {bucket}/{key} or {bucket}/{key}?versionId={versionId} if you want to copy a specific version. You can also provide this value as a dictionary. The dictionary format is recommended over the string format because it is more explicit. The dictionary format is: {'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}. Note that the VersionId key is optional and may be omitted. To specify an S3 access point, provide the access point ARN for the "Bucket" key in the copy source dictionary. If you want to provide the copy source for an S3 access point as a string instead of a dictionary, the ARN provided must be the full S3 access point object ARN (i.e. {accesspoint_arn}/object/{key}) * **CopySourceIfMatch** (*string*) -- Copies the object if its entity tag (ETag) matches the specified tag. If both the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request and evaluate as follows, Amazon S3 returns "200 OK" and copies the data: * "x-amz-copy-source-if-match" condition evaluates to true * "x-amz-copy-source-if-unmodified-since" condition evaluates to false * **CopySourceIfModifiedSince** (*datetime*) -- Copies the object if it has been modified since the specified time. If both the "x-amz-copy-source-if-none-match" and "x-amz-copy- source-if-modified-since" headers are present in the request and evaluate as follows, Amazon S3 returns the "412 Precondition Failed" response code: * "x-amz-copy-source-if-none-match" condition evaluates to false * "x-amz-copy-source-if-modified-since" condition evaluates to true * **CopySourceIfNoneMatch** (*string*) -- Copies the object if its entity tag (ETag) is different than the specified ETag. If both the "x-amz-copy-source-if-none-match" and "x-amz-copy- source-if-modified-since" headers are present in the request and evaluate as follows, Amazon S3 returns the "412 Precondition Failed" response code: * "x-amz-copy-source-if-none-match" condition evaluates to false * "x-amz-copy-source-if-modified-since" condition evaluates to true * **CopySourceIfUnmodifiedSince** (*datetime*) -- Copies the object if it hasn't been modified since the specified time. If both the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request and evaluate as follows, Amazon S3 returns "200 OK" and copies the data: * "x-amz-copy-source-if-match" condition evaluates to true * "x-amz-copy-source-if-unmodified-since" condition evaluates to false * **Expires** (*datetime*) -- 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. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Key** (*string*) -- **[REQUIRED]** The key of the destination object. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **MetadataDirective** (*string*) -- Specifies whether the metadata is copied from the source object or replaced with metadata that's provided in the request. When copying an object, you can preserve all metadata (the default) or specify new metadata. If this header isn’t specified, "COPY" is the default behavior. **General purpose bucket** - For general purpose buckets, when you grant permissions, you can use the "s3:x-amz-metadata- directive" condition key to enforce certain metadata behavior when objects are uploaded. For more information, see Amazon S3 condition key examples in the *Amazon S3 User Guide*. Note: "x-amz-website-redirect-location" is unique to each object and is not copied when using the "x-amz-metadata-directive" header. To copy the value, you must specify "x-amz-website- redirect-location" in the request header. * **TaggingDirective** (*string*) -- Specifies whether the object tag-set is copied from the source object or replaced with the tag-set that's provided in the request. The default value is "COPY". Note: **Directory buckets** - For directory buckets in a "CopyObject" operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a "501 Not Implemented" status code. When the destination bucket is a directory bucket, you will receive a "501 Not Implemented" response in any of the following situations: * When you attempt to "COPY" the tag-set from an S3 source object that has non-empty tags. * When you attempt to "REPLACE" the tag-set of a source object and set a non-empty value to "x-amz-tagging". * When you don't set the "x-amz-tagging-directive" header and the source object has non-empty tags. This is because the default value of "x-amz-tagging-directive" is "COPY". Because only the empty tag-set is supported for directory buckets in a "CopyObject" operation, the following situations are allowed: * When you attempt to "COPY" the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a general purpose bucket source object that has non-empty tags and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and don't set the "x-amz-tagging" value of the directory bucket destination object. This is because the default value of "x-amz-tagging" is the empty value. * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a "400 Bad Request" response. Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy. With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the *Amazon S3 User Guide*. **General purpose buckets** * For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy. * When you perform a "CopyObject" operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. **Directory buckets** * For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. * To encrypt new object copies to a directory bucket with SSE- KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key ( "aws/s3") isn't supported. Your SSE- KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a "CopyObject" operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- If the "x-amz-storage-class" header is not used, the copied object will be stored in the "STANDARD" Storage Class by default. The "STANDARD" storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. Note: * **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". * **Amazon S3 on Outposts** - S3 on Outposts only uses the "OUTPOSTS" Storage Class. You can use the "CopyObject" action to change the storage class of an object that is already stored in Amazon S3 by using the "x-amz-storage-class" header. For more information, see Storage Classes in the *Amazon S3 User Guide*. Before using an object as a source object for the copy operation, you must restore a copy of it if it meets any of the following conditions: * The storage class of the source object is "GLACIER" or "DEEP_ARCHIVE". * The storage class of the source object is "INTELLIGENT_TIERING" and it's S3 Intelligent-Tiering access tier is "Archive Access" or "Deep Archive Access". For more information, see RestoreObject and Copying Objects in the *Amazon S3 User Guide*. * **WebsiteRedirectLocation** (*string*) -- If the destination bucket is configured as a website, redirects requests for this object copy to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. This value is unique to each object and is not copied when using the "x-amz- metadata-directive" header. Instead, you may opt to provide this header in combination with the "x-amz-metadata-directive" header. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). When you perform a "CopyObject" operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 S3 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. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the destination bucket is a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the *Amazon S3 User Guide*. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. **General purpose buckets** - This value must be explicitly added to specify encryption context for "CopyObject" requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object. Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key. For more information, see Amazon S3 Bucket Keys in the *Amazon S3 User Guide*. Note: **Directory buckets** - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **CopySourceSSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the source object (for example, "AES256"). If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. * **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 the same one that was used when the source object was created. If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. * **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 that the encryption key was transmitted without error. If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying. Note: This functionality is not supported when the source object is in a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object copy in the destination bucket. This value must be used in conjunction with the "x-amz- tagging-directive" if you choose "REPLACE" for the "x-amz- tagging-directive". If you choose "COPY" for the "x-amz- tagging-directive", you don't need to set the "x-amz-tagging" header, because the tag-set will be copied from the source object directly. The tag-set must be encoded as URL Query parameters. The default value is the empty value. Note: **Directory buckets** - For directory buckets in a "CopyObject" operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a "501 Not Implemented" status code. When the destination bucket is a directory bucket, you will receive a "501 Not Implemented" response in any of the following situations: * When you attempt to "COPY" the tag-set from an S3 source object that has non-empty tags. * When you attempt to "REPLACE" the tag-set of a source object and set a non-empty value to "x-amz-tagging". * When you don't set the "x-amz-tagging-directive" header and the source object has non-empty tags. This is because the default value of "x-amz-tagging-directive" is "COPY". Because only the empty tag-set is supported for directory buckets in a "CopyObject" operation, the following situations are allowed: * When you attempt to "COPY" the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a general purpose bucket source object that has non-empty tags and set the "x-amz-tagging" value of the directory bucket destination object to empty. * When you attempt to "REPLACE" the tag-set of a directory bucket source object and don't set the "x-amz-tagging" value of the directory bucket destination object. This is because the default value of "x-amz-tagging" is the empty value. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to the object copy. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want the Object Lock of the object copy to expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether you want to apply a legal hold to the object copy. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ExpectedSourceBucketOwner** (*string*) -- The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'CopyObjectResult': { 'ETag': 'string', 'LastModified': datetime(2015, 1, 1), 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, 'Expiration': 'string', 'CopySourceVersionId': 'string', 'VersionId': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **CopyObjectResult** *(dict) --* Container for all response elements. * **ETag** *(string) --* Returns the ETag of the new object. The ETag reflects only changes to the contents of an object, not its metadata. * **LastModified** *(datetime) --* Creation date of the object. * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This checksum is present if the object being copied was uploaded with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expiration** *(string) --* If the object expiration is configured, the response includes this header. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **CopySourceVersionId** *(string) --* Version ID of the source object that was copied. Note: This functionality is not supported when the source object is in a directory bucket. * **VersionId** *(string) --* Version ID of the newly created copy. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded UTF-8 string holding JSON with the encryption context key-value pairs. * **BucketKeyEnabled** *(boolean) --* Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.ObjectNotInActiveTierError" **Examples** The following example copies an object from one bucket to another. response = client.copy_object( Bucket='destinationbucket', CopySource='/sourcebucket/HappyFacejpg', Key='HappyFaceCopyjpg', ) print(response) Expected Output: { 'CopyObjectResult': { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'LastModified': datetime(2016, 12, 15, 17, 38, 53, 3, 350, 0), }, 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_bucket_versioning put_bucket_versioning ********************* S3.Client.put_bucket_versioning(**kwargs) Note: This operation is not supported for directory buckets. Note: When you enable versioning on a bucket for the first time, it might take a short amount of time for the change to be fully propagated. While this change is propagating, you might encounter intermittent "HTTP 404 NoSuchKey" errors for requests to objects created or updated after enabling versioning. We recommend that you wait for 15 minutes after enabling versioning before issuing write operations ( "PUT" or "DELETE") on objects in the bucket. Sets the versioning state of an existing bucket. You can set the versioning state with one of the following values: **Enabled**—Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID. **Suspended**—Disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null. If the versioning state has never been set on a bucket, it has no versioning state; a GetBucketVersioning request does not return a versioning state value. In order to enable MFA Delete, you must be the bucket owner. If you are the bucket owner and want to enable MFA Delete in the bucket versioning configuration, you must include the "x-amz-mfa request" header and the "Status" and the "MfaDelete" request elements in a request to set the versioning state of the bucket. Warning: If you have an object expiration lifecycle configuration in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle configuration will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle and Versioning. The following operations are related to "PutBucketVersioning": * CreateBucket * DeleteBucket * GetBucketVersioning See also: AWS API Documentation **Request Syntax** response = client.put_bucket_versioning( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', MFA='string', VersioningConfiguration={ 'MFADelete': 'Enabled'|'Disabled', 'Status': 'Enabled'|'Suspended' }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. * **VersioningConfiguration** (*dict*) -- **[REQUIRED]** Container for setting the versioning state. * **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. * **Status** *(string) --* The versioning state of the bucket. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example sets versioning configuration on bucket. The configuration enables versioning on the bucket. response = client.put_bucket_versioning( Bucket='examplebucket', VersioningConfiguration={ 'MFADelete': 'Disabled', 'Status': 'Enabled', }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_logging get_bucket_logging ****************** S3.Client.get_bucket_logging(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Returns the logging status of a bucket and the permissions users have to view and modify that status. The following operations are related to "GetBucketLogging": * CreateBucket * PutBucketLogging See also: AWS API Documentation **Request Syntax** response = client.get_bucket_logging( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name for which to get the logging information. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'LoggingEnabled': { 'TargetBucket': 'string', 'TargetGrants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE' }, ], 'TargetPrefix': 'string', 'TargetObjectKeyFormat': { 'SimplePrefix': {}, 'PartitionedPrefix': { 'PartitionDateSource': 'EventTime'|'DeliveryTime' } } } } **Response Structure** * *(dict) --* * **LoggingEnabled** *(dict) --* Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For more information, see PUT Bucket logging in the *Amazon S3 API Reference*. * **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** *(list) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions for server access log delivery in the *Amazon S3 User Guide*. * *(dict) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions server access log delivery in the *Amazon S3 User Guide*. * **Grantee** *(dict) --* Container for the person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Logging permissions assigned to the grantee for the bucket. * **TargetPrefix** *(string) --* A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. * **TargetObjectKeyFormat** *(dict) --* Amazon S3 key format for log objects. * **SimplePrefix** *(dict) --* To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}. * **PartitionedPrefix** *(dict) --* Partitioned S3 key for log objects. * **PartitionDateSource** *(string) --* Specifies the partition date source for the partitioned prefix. "PartitionDateSource" can be "EventTime" or "DeliveryTime". For "DeliveryTime", the time in the log file names corresponds to the delivery time for the log files. For "EventTime", The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key. S3 / Client / list_bucket_inventory_configurations list_bucket_inventory_configurations ************************************ S3.Client.list_bucket_inventory_configurations(**kwargs) Note: This operation is not supported for directory buckets. Returns a list of S3 Inventory configurations for the bucket. You can have up to 1,000 analytics configurations per bucket. This action supports list pagination and does not return more than 100 configurations at a time. Always check the "IsTruncated" element in the response. If there are no more configurations to list, "IsTruncated" is set to false. If there are more configurations to list, "IsTruncated" is set to true, and there is a value in "NextContinuationToken". You use the "NextContinuationToken" value to continue the pagination of the list by passing the value in continuation-token in the request to "GET" the next page. To use this operation, you must have permissions to perform the "s3:GetInventoryConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about the Amazon S3 inventory feature, see Amazon S3 Inventory The following operations are related to "ListBucketInventoryConfigurations": * GetBucketInventoryConfiguration * DeleteBucketInventoryConfiguration * PutBucketInventoryConfiguration See also: AWS API Documentation **Request Syntax** response = client.list_bucket_inventory_configurations( Bucket='string', ContinuationToken='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the inventory configurations to retrieve. * **ContinuationToken** (*string*) -- The marker used to continue an inventory configuration listing that has been truncated. Use the "NextContinuationToken" from a previously truncated list response to continue the listing. The continuation token is an opaque value that Amazon S3 understands. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'ContinuationToken': 'string', 'InventoryConfigurationList': [ { 'Destination': { 'S3BucketDestination': { 'AccountId': 'string', 'Bucket': 'string', 'Format': 'CSV'|'ORC'|'Parquet', 'Prefix': 'string', 'Encryption': { 'SSES3': {}, 'SSEKMS': { 'KeyId': 'string' } } } }, 'IsEnabled': True|False, 'Filter': { 'Prefix': 'string' }, 'Id': 'string', 'IncludedObjectVersions': 'All'|'Current', 'OptionalFields': [ 'Size'|'LastModifiedDate'|'StorageClass'|'ETag'|'IsMultipartUploaded'|'ReplicationStatus'|'EncryptionStatus'|'ObjectLockRetainUntilDate'|'ObjectLockMode'|'ObjectLockLegalHoldStatus'|'IntelligentTieringAccessTier'|'BucketKeyStatus'|'ChecksumAlgorithm'|'ObjectAccessControlList'|'ObjectOwner', ], 'Schedule': { 'Frequency': 'Daily'|'Weekly' } }, ], 'IsTruncated': True|False, 'NextContinuationToken': 'string' } **Response Structure** * *(dict) --* * **ContinuationToken** *(string) --* If sent in the request, the marker that is used as a starting point for this inventory configuration list response. * **InventoryConfigurationList** *(list) --* The list of inventory configurations for a bucket. * *(dict) --* Specifies the S3 Inventory configuration for an Amazon S3 bucket. For more information, see GET Bucket inventory in the *Amazon S3 API Reference*. * **Destination** *(dict) --* Contains information about where to publish the inventory results. * **S3BucketDestination** *(dict) --* Contains the bucket name, file format, bucket owner (optional), and prefix (optional) where inventory results are published. * **AccountId** *(string) --* The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Note: Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. * **Bucket** *(string) --* The Amazon Resource Name (ARN) of the bucket where inventory results will be published. * **Format** *(string) --* Specifies the output format of the inventory results. * **Prefix** *(string) --* The prefix that is prepended to all inventory results. * **Encryption** *(dict) --* Contains the type of server-side encryption used to encrypt the inventory results. * **SSES3** *(dict) --* Specifies the use of SSE-S3 to encrypt delivered inventory reports. * **SSEKMS** *(dict) --* Specifies the use of SSE-KMS to encrypt delivered inventory reports. * **KeyId** *(string) --* Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports. * **IsEnabled** *(boolean) --* Specifies whether the inventory is enabled or disabled. If set to "True", an inventory list is generated. If set to "False", no inventory list is generated. * **Filter** *(dict) --* Specifies an inventory filter. The inventory only includes objects that meet the filter's criteria. * **Prefix** *(string) --* The prefix that an object must have to be included in the inventory results. * **Id** *(string) --* The ID used to identify the inventory configuration. * **IncludedObjectVersions** *(string) --* Object versions to include in the inventory list. If set to "All", the list includes all the object versions, which adds the version-related fields "VersionId", "IsLatest", and "DeleteMarker" to the list. If set to "Current", the list does not contain these version- related fields. * **OptionalFields** *(list) --* Contains the optional fields that are included in the inventory results. * *(string) --* * **Schedule** *(dict) --* Specifies the schedule for generating inventory results. * **Frequency** *(string) --* Specifies how frequently inventory results are produced. * **IsTruncated** *(boolean) --* Tells whether the returned list of inventory configurations is complete. A value of true indicates that the list is not complete and the NextContinuationToken is provided for a subsequent request. * **NextContinuationToken** *(string) --* The marker used to continue this inventory configuration listing. Use the "NextContinuationToken" from this response to continue the listing in a subsequent request. The continuation token is an opaque value that Amazon S3 understands. S3 / Client / list_bucket_intelligent_tiering_configurations list_bucket_intelligent_tiering_configurations ********************************************** S3.Client.list_bucket_intelligent_tiering_configurations(**kwargs) Note: This operation is not supported for directory buckets. Lists the S3 Intelligent-Tiering configuration from the specified bucket. The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost- effective storage access tier, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings in three low latency and high throughput access tiers. To get the lowest storage cost on data that can be accessed in minutes to hours, you can choose to activate additional archiving capabilities. The S3 Intelligent-Tiering storage class is the ideal storage class for data with unknown, changing, or unpredictable access patterns, independent of object size or retention period. If the size of an object is less than 128 KB, it is not monitored and not eligible for auto-tiering. Smaller objects can be stored, but they are always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering storage class. For more information, see Storage class for automatically optimizing frequently and infrequently accessed objects. Operations related to "ListBucketIntelligentTieringConfigurations" include: * DeleteBucketIntelligentTieringConfiguration * PutBucketIntelligentTieringConfiguration * GetBucketIntelligentTieringConfiguration See also: AWS API Documentation **Request Syntax** response = client.list_bucket_intelligent_tiering_configurations( Bucket='string', ContinuationToken='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose configuration you want to modify or retrieve. * **ContinuationToken** (*string*) -- The "ContinuationToken" that represents a placeholder from where this request should begin. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'ContinuationToken': 'string', 'NextContinuationToken': 'string', 'IntelligentTieringConfigurationList': [ { 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'Status': 'Enabled'|'Disabled', 'Tierings': [ { 'Days': 123, 'AccessTier': 'ARCHIVE_ACCESS'|'DEEP_ARCHIVE_ACCESS' }, ] }, ] } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* Indicates whether the returned list of analytics configurations is complete. A value of "true" indicates that the list is not complete and the "NextContinuationToken" will be provided for a subsequent request. * **ContinuationToken** *(string) --* The "ContinuationToken" that represents a placeholder from where this request should begin. * **NextContinuationToken** *(string) --* The marker used to continue this inventory configuration listing. Use the "NextContinuationToken" from this response to continue the listing in a subsequent request. The continuation token is an opaque value that Amazon S3 understands. * **IntelligentTieringConfigurationList** *(list) --* The list of S3 Intelligent-Tiering configurations for a bucket. * *(dict) --* Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. For information about the S3 Intelligent-Tiering storage class, see Storage class for automatically optimizing frequently and infrequently accessed objects. * **Id** *(string) --* The ID used to identify the S3 Intelligent-Tiering configuration. * **Filter** *(dict) --* Specifies a bucket filter. The configuration only includes objects that meet the filter's criteria. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates, and an object must match all of the predicates in order for the filter to apply. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the configuration applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the configuration to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **Status** *(string) --* Specifies the status of the configuration. * **Tierings** *(list) --* Specifies the S3 Intelligent-Tiering storage class tier of the configuration. * *(dict) --* The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead. * **Days** *(integer) --* The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days). * **AccessTier** *(string) --* S3 Intelligent-Tiering access tier. See Storage class for automatically optimizing frequently and infrequently accessed objects for a list of access tiers in the S3 Intelligent-Tiering storage class. S3 / Client / get_bucket_notification_configuration get_bucket_notification_configuration ************************************* S3.Client.get_bucket_notification_configuration(**kwargs) Note: This operation is not supported for directory buckets. Returns the notification configuration of a bucket. If notifications are not enabled on the bucket, the action returns an empty "NotificationConfiguration" element. By default, you must be the bucket owner to read the notification configuration of a bucket. However, the bucket owner can use a bucket policy to grant permission to other users to read this configuration with the "s3:GetBucketNotification" permission. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. For more information about setting and reading the notification configuration on a bucket, see Setting Up Notification of Bucket Events. For more information about bucket policies, see Using Bucket Policies. The following action is related to "GetBucketNotification": * PutBucketNotification See also: AWS API Documentation **Request Syntax** response = client.get_bucket_notification_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the notification configuration. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'TopicConfigurations': [ { 'Id': 'string', 'TopicArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'QueueConfigurations': [ { 'Id': 'string', 'QueueArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'LambdaFunctionConfigurations': [ { 'Id': 'string', 'LambdaFunctionArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'EventBridgeConfiguration': {} } **Response Structure** * *(dict) --* A container for specifying the notification configuration of the bucket. If this element is empty, notifications are turned off for the bucket. * **TopicConfigurations** *(list) --* The topic to which notifications are sent and the events for which notifications are generated. * *(dict) --* A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **TopicArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* The Amazon S3 bucket event about which to send notifications. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **QueueConfigurations** *(list) --* The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. * *(dict) --* Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **QueueArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* A collection of bucket events for which to send notifications * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **LambdaFunctionConfigurations** *(list) --* Describes the Lambda functions to invoke and the events for which to invoke them. * *(dict) --* A container for specifying the configuration for Lambda notifications. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **LambdaFunctionArn** *(string) --* The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes when the specified event type occurs. * **Events** *(list) --* The Amazon S3 bucket event for which to invoke the Lambda function. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **EventBridgeConfiguration** *(dict) --* Enables delivery of events to Amazon EventBridge. S3 / Client / delete_bucket_analytics_configuration delete_bucket_analytics_configuration ************************************* S3.Client.delete_bucket_analytics_configuration(**kwargs) Note: This operation is not supported for directory buckets. Deletes an analytics configuration for the bucket (specified by the analytics configuration ID). To use this operation, you must have permissions to perform the "s3:PutAnalyticsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about the Amazon S3 analytics feature, see Amazon S3 Analytics – Storage Class Analysis. The following operations are related to "DeleteBucketAnalyticsConfiguration": * GetBucketAnalyticsConfiguration * ListBucketAnalyticsConfigurations * PutBucketAnalyticsConfiguration See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_analytics_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket from which an analytics configuration is deleted. * **Id** (*string*) -- **[REQUIRED]** The ID that identifies the analytics configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / update_bucket_metadata_inventory_table_configuration update_bucket_metadata_inventory_table_configuration **************************************************** S3.Client.update_bucket_metadata_inventory_table_configuration(**kwargs) Enables or disables a live inventory table for an S3 Metadata configuration on a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Permissions To use this operation, you must have the following permissions. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. If you want to encrypt your inventory table with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions in your KMS key policy. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. * "s3:UpdateBucketMetadataInventoryTableConfiguration" * "s3tables:CreateTableBucket" * "s3tables:CreateNamespace" * "s3tables:GetTable" * "s3tables:CreateTable" * "s3tables:PutTablePolicy" * "s3tables:PutTableEncryption" * "kms:DescribeKey" The following operations are related to "UpdateBucketMetadataInventoryTableConfiguration": * CreateBucketMetadataConfiguration * DeleteBucketMetadataConfiguration * GetBucketMetadataConfiguration * UpdateBucketMetadataJournalTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.update_bucket_metadata_inventory_table_configuration( Bucket='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', InventoryTableConfiguration={ 'ConfigurationState': 'ENABLED'|'DISABLED', 'EncryptionConfiguration': { 'SseAlgorithm': 'aws:kms'|'AES256', 'KmsKeyArn': 'string' } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that corresponds to the metadata configuration that you want to enable or disable an inventory table for. * **ContentMD5** (*string*) -- The "Content-MD5" header for the inventory table configuration. * **ChecksumAlgorithm** (*string*) -- The checksum algorithm to use with your inventory table configuration. * **InventoryTableConfiguration** (*dict*) -- **[REQUIRED]** The contents of your inventory table configuration. * **ConfigurationState** *(string) --* **[REQUIRED]** The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled. * **EncryptionConfiguration** *(dict) --* The encryption configuration for the inventory table. * **SseAlgorithm** *(string) --* **[REQUIRED]** The encryption type specified for a metadata table. To specify server-side encryption with Key Management Service (KMS) keys (SSE-KMS), use the "aws:kms" value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the "AES256" value. * **KmsKeyArn** *(string) --* If server-side encryption with Key Management Service (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that's located in the same Region as the general purpose bucket that corresponds to the metadata table configuration. * **ExpectedBucketOwner** (*string*) -- The expected owner of the general purpose bucket that corresponds to the metadata table configuration that you want to enable or disable an inventory table for. Returns: None S3 / Client / upload_file upload_file *********** S3.Client.upload_file(Filename, Bucket, Key, ExtraArgs=None, Callback=None, Config=None) Upload a file to an S3 object. Usage: import boto3 s3 = boto3.client('s3') s3.upload_file('/tmp/hello.txt', 'amzn-s3-demo-bucket', 'hello.txt') Similar behavior as S3Transfer's upload_file() method, except that argument names are capitalized. Detailed examples can be found at *S3Transfer's Usage*. Parameters: * **Filename** (*str*) -- The path to the file to upload. * **Bucket** (*str*) -- The name of the bucket to upload to. * **Key** (*str*) -- The name of the key to upload to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed upload arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the upload. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the transfer. S3 / Client / get_bucket_metrics_configuration get_bucket_metrics_configuration ******************************** S3.Client.get_bucket_metrics_configuration(**kwargs) Note: This operation is not supported for directory buckets. Gets a metrics configuration (specified by the metrics configuration ID) from the bucket. Note that this doesn't include the daily storage metrics. To use this operation, you must have permissions to perform the "s3:GetMetricsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about CloudWatch request metrics for Amazon S3, see Monitoring Metrics with Amazon CloudWatch. The following operations are related to "GetBucketMetricsConfiguration": * PutBucketMetricsConfiguration * DeleteBucketMetricsConfiguration * ListBucketMetricsConfigurations * Monitoring Metrics with Amazon CloudWatch See also: AWS API Documentation **Request Syntax** response = client.get_bucket_metrics_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the metrics configuration to retrieve. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'MetricsConfiguration': { 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'AccessPointArn': 'string', 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'AccessPointArn': 'string' } } } } **Response Structure** * *(dict) --* * **MetricsConfiguration** *(dict) --* Specifies the metrics configuration. * **Id** *(string) --* The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores. * **Filter** *(dict) --* Specifies a metrics configuration filter. The metrics configuration will only include objects that meet the filter's criteria. A filter must be a prefix, an object tag, an access point ARN, or a conjunction (MetricsAndOperator). * **Prefix** *(string) --* The prefix used when evaluating a metrics filter. * **Tag** *(dict) --* The tag used when evaluating a metrics filter. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **AccessPointArn** *(string) --* The access point ARN used when evaluating a metrics filter. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates, and an object must match all of the predicates in order for the filter to apply. * **Prefix** *(string) --* The prefix used when evaluating an AND predicate. * **Tags** *(list) --* The list of tags used when evaluating an AND predicate. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **AccessPointArn** *(string) --* The access point ARN used when evaluating an "AND" predicate. S3 / Client / create_session create_session ************** S3.Client.create_session(**kwargs) Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets. For more information about Zonal endpoint API operations that include the Availability Zone in the request endpoint, see S3 Express One Zone APIs in the *Amazon S3 User Guide*. To make Zonal endpoint API requests on a directory bucket, use the "CreateSession" API operation. Specifically, you grant "s3express:CreateSession" permission to a bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM credentials to make the "CreateSession" API request on the bucket, which returns temporary security credentials that include the access key ID, secret access key, session token, and expiration. These credentials have associated permissions to access the Zonal endpoint API operations. After the session is created, you don’t need to use other policies to grant permissions to each Zonal endpoint API individually. Instead, in your Zonal endpoint API requests, you sign your requests by applying the temporary security credentials of the session to the request headers and following the SigV4 protocol for authentication. You also apply the session token to the "x-amz-s3session-token" request header for authorization. Temporary security credentials are scoped to the bucket and expire after 5 minutes. After the expiration time, any calls that you make with those credentials will fail. You must use IAM credentials again to make a "CreateSession" API request that generates a new set of temporary credentials for use. Temporary credentials cannot be extended or refreshed beyond the original specified interval. If you use Amazon Web Services SDKs, SDKs handle the session token refreshes automatically to avoid service interruptions when a session expires. We recommend that you use the Amazon Web Services SDKs to initiate and manage requests to the CreateSession API. For more information, see Performance guidelines and design patterns in the *Amazon S3 User Guide*. Note: * You must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format "https://bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. * "CopyObject" API operation - Unlike other Zonal endpoint API operations, the "CopyObject" API operation doesn't use the temporary security credentials returned from the "CreateSession" API operation for authentication and authorization. For information about authentication and authorization of the "CopyObject" API operation on directory buckets, see CopyObject. * "HeadBucket" API operation - Unlike other Zonal endpoint API operations, the "HeadBucket" API operation doesn't use the temporary security credentials returned from the "CreateSession" API operation for authentication and authorization. For information about authentication and authorization of the "HeadBucket" API operation on directory buckets, see HeadBucket. Permissions To obtain temporary security credentials, you must create a bucket policy or an IAM identity-based policy that grants "s3express:CreateSession" permission to the bucket. In a policy, you can have the "s3express:SessionMode" condition key to control who can create a "ReadWrite" or "ReadOnly" session. For more information about "ReadWrite" or "ReadOnly" sessions, see x-amz- create-session-mode. For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. To grant cross-account access to Zonal endpoint API operations, the bucket policy should also grant both accounts the "s3express:CreateSession" permission. If you want to encrypt objects with SSE-KMS, you must also have the "kms:GenerateDataKey" and the "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the target KMS key. Encryption For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server- side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. For Zonal endpoint (object-level) API operations except CopyObject and UploadPartCopy, you authenticate and authorize requests through CreateSession for low latency. To encrypt new objects in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Then, when a session is created for Zonal endpoint API operations, new objects are automatically encrypted and decrypted with SSE-KMS and S3 Bucket Keys during the session. Note: Only 1 customer managed key is supported per directory bucket for the lifetime of the bucket. The Amazon Web Services managed key ( "aws/s3") isn't supported. After you specify SSE-KMS as your bucket's default encryption configuration with a customer managed key, you can't change the customer managed key for the bucket's SSE-KMS configuration. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, you can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server-side- encryption-context", and "x-amz-server-side-encryption-bucket-key- enabled") from the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. Also, in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), it's not supported to override the values of the encryption settings from the "CreateSession" request.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". See also: AWS API Documentation **Request Syntax** response = client.create_session( SessionMode='ReadOnly'|'ReadWrite', Bucket='string', ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False ) Parameters: * **SessionMode** (*string*) -- Specifies the mode of the session that will be created, either "ReadWrite" or "ReadOnly". By default, a "ReadWrite" session is created. A "ReadWrite" session is capable of executing all the Zonal endpoint API operations on a directory bucket. A "ReadOnly" session is constrained to execute the following Zonal endpoint API operations: "GetObject", "HeadObject", "ListObjectsV2", "GetObjectAttributes", "ListParts", and "ListMultipartUploads". * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket that you create a session for. * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm to use when you store objects in the directory bucket. For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **SSEKMSKeyId** (*string*) -- If you specify "x-amz-server-side-encryption" with "aws:kms", you must specify the "x-amz-server-side-encryption-aws-kms- key-id" header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP "400 Bad Request" error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key- value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. **General purpose buckets** - This value must be explicitly added during "CopyObject" operations if you want an additional encryption context for your object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS). S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. Return type: dict Returns: **Response Syntax** { 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'Credentials': { 'AccessKeyId': 'string', 'SecretAccessKey': 'string', 'SessionToken': 'string', 'Expiration': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store objects in the directory bucket. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSEKMSKeyId** *(string) --* If you specify "x-amz-server-side-encryption" with "aws:kms", this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. * **BucketKeyEnabled** *(boolean) --* Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS). * **Credentials** *(dict) --* The established temporary security credentials for the created session. * **AccessKeyId** *(string) --* A unique identifier that's associated with a secret access key. The access key ID and the secret access key are used together to sign programmatic Amazon Web Services requests cryptographically. * **SecretAccessKey** *(string) --* A key that's used with the access key ID to cryptographically sign programmatic Amazon Web Services requests. Signing a request identifies the sender and prevents the request from being altered. * **SessionToken** *(string) --* A part of the temporary security credentials. The session token is used to validate the temporary security credentials. * **Expiration** *(datetime) --* Temporary security credentials expire after a specified interval. After temporary credentials expire, any calls that you make with those credentials will fail. So you must generate a new set of temporary credentials. Temporary credentials cannot be extended or refreshed beyond the original specified interval. **Exceptions** * "S3.Client.exceptions.NoSuchBucket" S3 / Client / list_objects_v2 list_objects_v2 *************** S3.Client.list_objects_v2(**kwargs) Returns some or all (up to 1,000) of the objects in a bucket with each request. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. A "200 OK" response can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately. For more information about listing objects, see Listing object keys programmatically in the *Amazon S3 User Guide*. To get a list of your buckets, see ListBuckets. Note: * **General purpose bucket** - For general purpose buckets, "ListObjectsV2" doesn't return prefixes that are related only to in-progress multipart uploads. * **Directory buckets** - For directory buckets, "ListObjectsV2" response includes the prefixes that are related only to in- progress multipart uploads. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - To use this operation, you must have READ access to the bucket. You must have permission to perform the "s3:ListBucket" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Sorting order of returned objects * **General purpose bucket** - For general purpose buckets, "ListObjectsV2" returns objects in lexicographical order based on their key names. * **Directory bucket** - For directory buckets, "ListObjectsV2" does not return objects in lexicographical order. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". Warning: This section describes the latest revision of this action. We recommend that you use this revised API operation for application development. For backward compatibility, Amazon S3 continues to support the prior version of this API operation, ListObjects. The following operations are related to "ListObjectsV2": * GetObject * PutObject * CreateBucket See also: AWS API Documentation **Request Syntax** response = client.list_objects_v2( Bucket='string', Delimiter='string', EncodingType='url', MaxKeys=123, Prefix='string', ContinuationToken='string', FetchOwner=True|False, StartAfter='string', RequestPayer='requester', ExpectedBucketOwner='string', OptionalObjectAttributes=[ 'RestoreStatus', ] ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delimiter** (*string*) -- A delimiter is a character that you use to group keys. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the "StartAfter" value. Note: * **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **Directory buckets** - When you query "ListObjectsV2" with a delimiter during in-progress multipart uploads, the "CommonPrefixes" response parameter contains the prefixes that are associated with the in-progress multipart uploads. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent-encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **MaxKeys** (*integer*) -- Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. * **Prefix** (*string*) -- Limits the response to keys that begin with the specified prefix. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **ContinuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on this bucket with a token. "ContinuationToken" is obfuscated and is not a real key. You can use this "ContinuationToken" for pagination of the list results. * **FetchOwner** (*boolean*) -- The owner field is not present in "ListObjectsV2" by default. If you want to return the owner field with each key in the result, then set the "FetchOwner" field to "true". Note: **Directory buckets** - For directory buckets, the bucket owner is returned as the object owner for all objects. * **StartAfter** (*string*) -- StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. StartAfter can be any key in the bucket. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that she or he will be charged for the list objects request in V2 style. Bucket owners need not specify this parameter in their requests. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. Note: This functionality is not supported for directory buckets. * *(string) --* Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'Contents': [ { 'Key': 'string', 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'ChecksumAlgorithm': [ 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ], 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'Size': 123, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'RestoreStatus': { 'IsRestoreInProgress': True|False, 'RestoreExpiryDate': datetime(2015, 1, 1) } }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'KeyCount': 123, 'ContinuationToken': 'string', 'NextContinuationToken': 'string', 'StartAfter': 'string', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* Set to "false" if all of the results were returned. Set to "true" if more keys are available to return. If the number of results exceeds that specified by "MaxKeys", all of the results might not be returned. * **Contents** *(list) --* Metadata about each object returned. * *(dict) --* An object consists of data and its descriptive metadata. * **Key** *(string) --* The name that you assign to an object. You use the object key to retrieve the object. * **LastModified** *(datetime) --* Creation date of the object. * **ETag** *(string) --* The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below: * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data. * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE- KMS, have ETags that are not an MD5 digest of their object data. * If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest. Note: **Directory buckets** - MD5 is not supported by directory buckets. * **ChecksumAlgorithm** *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Size** *(integer) --* Size in bytes of the object * **StorageClass** *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **Owner** *(dict) --* The owner of the object Note: **Directory buckets** - The bucket owner is returned as the object owner. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **RestoreStatus** *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" * **Name** *(string) --* The bucket name. * **Prefix** *(string) --* Keys that begin with the indicated prefix. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **Delimiter** *(string) --* Causes keys that contain the same string between the "prefix" and the first occurrence of the delimiter to be rolled up into a single result element in the "CommonPrefixes" collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the "MaxKeys" value. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **MaxKeys** *(integer) --* Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. * **CommonPrefixes** *(list) --* All of the keys (up to 1,000) that share the same prefix are grouped together. When counting the total numbers of returns by this API operation, this group of keys is considered as one item. A response can contain "CommonPrefixes" only if you specify a delimiter. "CommonPrefixes" contains all (if there are any) keys between "Prefix" and the next occurrence of the string specified by a delimiter. "CommonPrefixes" lists keys that act like subdirectories in the directory specified by "Prefix". For example, if the prefix is "notes/" and the delimiter is a slash ( "/") as in "notes/summer/july", the common prefix is "notes/summer/". All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. Note: * **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **Directory buckets** - When you query "ListObjectsV2" with a delimiter during in-progress multipart uploads, the "CommonPrefixes" response parameter contains the prefixes that are associated with the in-progress multipart uploads. For more information about multipart uploads, see Multipart Upload Overview in the *Amazon S3 User Guide*. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode object key names in the XML response. If you specify the "encoding-type" request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements: "Delimiter, Prefix, Key," and "StartAfter". * **KeyCount** *(integer) --* "KeyCount" is the number of keys returned with this request. "KeyCount" will always be less than or equal to the "MaxKeys" field. For example, if you ask for 50 keys, your result will include 50 keys or fewer. * **ContinuationToken** *(string) --* If "ContinuationToken" was sent with the request, it is included in the response. You can use the returned "ContinuationToken" for pagination of the list response. * **NextContinuationToken** *(string) --* "NextContinuationToken" is sent when "isTruncated" is true, which means there are more keys in the bucket that can be listed. The next list requests to Amazon S3 can be continued with this "NextContinuationToken". "NextContinuationToken" is obfuscated and is not a real key * **StartAfter** *(string) --* If StartAfter was sent with the request, it is included in the response. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchBucket" **Examples** The following example retrieves object list. The request specifies max keys to limit response to include only 2 object keys. response = client.list_objects_v2( Bucket='examplebucket', MaxKeys='2', ) print(response) Expected Output: { 'Contents': [ { 'ETag': '"70ee1738b6b21e2c8a43f3a5ab0eee71"', 'Key': 'happyface.jpg', 'LastModified': datetime(2014, 11, 21, 19, 40, 5, 4, 325, 0), 'Size': 11, 'StorageClass': 'STANDARD', }, { 'ETag': '"becf17f89c30367a9a44495d62ed521a-1"', 'Key': 'test.jpg', 'LastModified': datetime(2014, 5, 2, 4, 51, 50, 4, 122, 0), 'Size': 4192256, 'StorageClass': 'STANDARD', }, ], 'IsTruncated': True, 'KeyCount': '2', 'MaxKeys': '2', 'Name': 'examplebucket', 'NextContinuationToken': '1w41l63U0xa8q7smH50vCxyTQqdxo69O3EmK28Bi5PcROI4wI/EyIJg==', 'Prefix': '', 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_ownership_controls get_bucket_ownership_controls ***************************** S3.Client.get_bucket_ownership_controls(**kwargs) Note: This operation is not supported for directory buckets. Retrieves "OwnershipControls" for an Amazon S3 bucket. To use this operation, you must have the "s3:GetBucketOwnershipControls" permission. For more information about Amazon S3 permissions, see Specifying permissions in a policy. Note: A bucket doesn't have "OwnershipControls" settings in the following cases: * The bucket was created before the "BucketOwnerEnforced" ownership setting was introduced and you've never explicitly applied this value * You've manually deleted the bucket ownership control value using the "DeleteBucketOwnershipControls" API operation. By default, Amazon S3 sets "OwnershipControls" for all newly created buckets. For information about Amazon S3 Object Ownership, see Using Object Ownership. The following operations are related to "GetBucketOwnershipControls": * PutBucketOwnershipControls * DeleteBucketOwnershipControls See also: AWS API Documentation **Request Syntax** response = client.get_bucket_ownership_controls( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose "OwnershipControls" you want to retrieve. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'OwnershipControls': { 'Rules': [ { 'ObjectOwnership': 'BucketOwnerPreferred'|'ObjectWriter'|'BucketOwnerEnforced' }, ] } } **Response Structure** * *(dict) --* * **OwnershipControls** *(dict) --* The "OwnershipControls" (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) currently in effect for this Amazon S3 bucket. * **Rules** *(list) --* The container element for an ownership control rule. * *(dict) --* The container element for an ownership control rule. * **ObjectOwnership** *(string) --* The container element for object ownership for a bucket's ownership controls. "BucketOwnerPreferred" - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the "bucket-owner-full- control" canned ACL. "ObjectWriter" - The uploading account will own the object if the object is uploaded with the "bucket- owner-full-control" canned ACL. "BucketOwnerEnforced" - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or specify bucket owner full control ACLs (such as the predefined "bucket-owner-full-control" canned ACL or a custom ACL in XML format that grants the same permissions). By default, "ObjectOwnership" is set to "BucketOwnerEnforced" and ACLs are disabled. We recommend keeping ACLs disabled, except in uncommon use cases where you must control access for each object individually. For more information about S3 Object Ownership, see Controlling ownership of objects and disabling ACLs for your bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets use the bucket owner enforced setting for S3 Object Ownership. S3 / Client / get_bucket_versioning get_bucket_versioning ********************* S3.Client.get_bucket_versioning(**kwargs) Note: This operation is not supported for directory buckets. Returns the versioning state of a bucket. To retrieve the versioning state of a bucket, you must be the bucket owner. This implementation also returns the MFA Delete status of the versioning state. If the MFA Delete status is "enabled", the bucket owner must use an authentication device to change the versioning state of the bucket. The following operations are related to "GetBucketVersioning": * GetObject * PutObject * DeleteObject See also: AWS API Documentation **Request Syntax** response = client.get_bucket_versioning( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the versioning information. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Status': 'Enabled'|'Suspended', 'MFADelete': 'Enabled'|'Disabled' } **Response Structure** * *(dict) --* * **Status** *(string) --* The versioning state of the bucket. * **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. **Examples** The following example retrieves bucket versioning configuration. response = client.get_bucket_versioning( Bucket='examplebucket', ) print(response) Expected Output: { 'MFADelete': 'Disabled', 'Status': 'Enabled', 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_object_acl put_object_acl ************** S3.Client.put_object_acl(**kwargs) Note: This operation is not supported for directory buckets. Uses the "acl" subresource to set the access control list (ACL) permissions for a new or existing object in an S3 bucket. You must have the "WRITE_ACP" permission to set the ACL of an object. For more information, see What permissions can I grant? in the *Amazon S3 User Guide*. This functionality is not supported for Amazon S3 on Outposts. Depending on your application needs, you can choose to set the ACL on an object using either the request body or the headers. For example, if you have an existing application that updates a bucket ACL using the request body, you can continue to use that approach. For more information, see Access Control List (ACL) Overview in the *Amazon S3 User Guide*. Warning: If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. You must use policies to grant access to your bucket and the objects in it. Requests to set ACLs or update ACLs fail and return the "AccessControlListNotSupported" error code. Requests to read ACLs are still supported. For more information, see Controlling object ownership in the *Amazon S3 User Guide*.Permissions You can set access permissions using one of the following methods: * Specify a canned ACL with the "x-amz-acl" request header. Amazon S3 supports a set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify the canned ACL name as the value of >>``<<>ID<><>GranteesEmail<> " DisplayName is optional and ignored in the request. * By URI: "<>http://acs.amazonaws.com/group s/global/AuthenticatedUsers<>" * By Email address: "<>Grantees@email.com<>lt;/Grantee>" The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the CanonicalUser. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference.Versioning The ACL of an object is set at the object version level. By default, PUT sets the ACL of the current version of an object. To set the ACL of a different version, use the "versionId" subresource. The following operations are related to "PutObjectAcl": * CopyObject * GetObject See also: AWS API Documentation **Request Syntax** response = client.put_object_acl( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', AccessControlPolicy={ 'Grants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Owner': { 'DisplayName': 'string', 'ID': 'string' } }, Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', Key='string', RequestPayer='requester', VersionId='string', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. For more information, see Canned ACL. * **AccessControlPolicy** (*dict*) -- Contains the elements that set the ACL permissions for an object per grantee. * **Grants** *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Owner** *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Bucket** (*string*) -- **[REQUIRED]** The bucket name that contains the object to which you want to attach the ACL. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **GrantFullControl** (*string*) -- Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to list the objects in the bucket. This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the bucket ACL. This functionality is not supported for Amazon S3 on Outposts. * **GrantWrite** (*string*) -- Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. This functionality is not supported for Amazon S3 on Outposts. * **Key** (*string*) -- **[REQUIRED]** Key for which the PUT action was initiated. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchKey" **Examples** The following example adds grants to an object ACL. The first permission grants user1 and user2 FULL_CONTROL and the AllUsers group READ permission. response = client.put_object_acl( AccessControlPolicy={ }, Bucket='examplebucket', GrantFullControl='emailaddress=user1@example.com,emailaddress=user2@example.com', GrantRead='uri=http://acs.amazonaws.com/groups/global/AllUsers', Key='HappyFace.jpg', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_object get_object ********** S3.Client.get_object(**kwargs) Retrieves an object from Amazon S3. In the "GetObject" request, specify the full key name for the object. **General purpose buckets** - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg", specify the object key name as "/photos/2006/February/sample.jpg". For a path-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "examplebucket", specify the object key name as "/examplebucket/photos/2006/February/sample.jpg". For more information about request types, see HTTP Host Header Bucket Specification in the *Amazon S3 User Guide*. **Directory buckets** - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "amzn-s3-demo-bucket--usw2-az1--x-s3", specify the object key name as "/photos/2006/February/sample.jpg". Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - You must have the required permissions in a policy. To use "GetObject", you must have the "READ" access to the object (or version). If you grant "READ" access to the anonymous user, the "GetObject" operation returns the object without using an authorization header. For more information, see Specifying permissions in a policy in the *Amazon S3 User Guide*. If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. If the object that you request doesn’t exist, the error that Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" error. * If you don’t have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Access Denied" error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted using SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Storage classes If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a copy using RestoreObject. Otherwise, this operation returns an "InvalidObjectState" error. For information about restoring archived objects, see Restoring Archived Objects in the *Amazon S3 User Guide*. **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". Encryption Encryption request headers, like "x-amz-server-side-encryption", should not be sent for the "GetObject" requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your "GetObject" requests for the object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. Overriding response header values through the request There are times when you want to override certain response header values of a "GetObject" response. For example, you might override the "Content-Disposition" response header value through your "GetObject" request. You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code "200 OK" is returned. The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. The response headers that you can override for the "GetObject" response are "Cache-Control", "Content-Disposition", "Content- Encoding", "Content-Language", "Content-Type", and "Expires". To override values for a set of response headers in the "GetObject" response, you can use the following query parameters in the request. * "response-cache-control" * "response-content-disposition" * "response-content-encoding" * "response-content-language" * "response-content-type" * "response-expires" Note: When you use these parameters, you must sign the request by using either an Authorization header or a presigned URL. These parameters cannot be used with an unsigned (anonymous) request.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "GetObject": * ListBuckets * GetObjectAcl See also: AWS API Documentation **Request Syntax** response = client.get_object( Bucket='string', IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Key='string', Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **Object Lambda access points** - When you use this action with an Object Lambda access point, you must direct requests to the Object Lambda access point hostname. The Object Lambda access point hostname takes the form *AccessPointName*-*AccountId*.s3-object- lambda.*Region*.amazonaws.com. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified in this header; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" status code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified in this header; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" HTTP status code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Key** (*string*) -- **[REQUIRED]** Key of the object to get. * **Range** (*string*) -- Downloads the specified byte range of an object. For more information about the HTTP Range header, see https://www.rfc- editor.org/rfc/rfc9110.html#name-range. Note: Amazon S3 doesn't support retrieving multiple ranges of data per "GET" request. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. By default, the "GetObject" operation returns the current version of an object. To return a different version, use the "versionId" subresource. Note: * If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. * If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. For more information about versioning, see PutBucketVersioning. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the object (for example, "AES256"). If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- Specifies the customer-provided encryption key that you originally provided for Amazon S3 to encrypt the data before storing it. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the "x-amz-server-side-encryption-customer- algorithm" header. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. Useful for downloading just a part of an object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this mode must be enabled. Return type: dict Returns: **Response Syntax** { 'Body': StreamingBody(), 'DeleteMarker': True|False, 'AcceptRanges': 'string', 'Expiration': 'string', 'Restore': 'string', 'LastModified': datetime(2015, 1, 1), 'ContentLength': 123, 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'MissingMeta': 123, 'VersionId': 'string', 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'ContentRange': 'string', 'ContentType': 'string', 'Expires': datetime(2015, 1, 1), 'ExpiresString': 'string', 'WebsiteRedirectLocation': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'Metadata': { 'string': 'string' }, 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', 'PartsCount': 123, 'TagCount': 123, 'ObjectLockMode': 'GOVERNANCE'|'COMPLIANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'ObjectLockLegalHoldStatus': 'ON'|'OFF' } **Response Structure** * *(dict) --* * **Body** ("StreamingBody") -- Object data. * **DeleteMarker** *(boolean) --* Indicates whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response. Note: * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes "x-amz-delete-marker: true" in the response. * If the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **AcceptRanges** *(string) --* Indicates that a range of bytes was specified in the request. * **Expiration** *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **Restore** *(string) --* Provides information about object restoration action and expiration time of the restored object copy. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **LastModified** *(datetime) --* Date and time when the object was last modified. **General purpose buckets** - When you specify a "versionId" of the object in your request, if the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **ContentLength** *(integer) --* Size of the body in bytes. * **ETag** *(string) --* An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in the "CreateMultipartUpload" request. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **MissingMeta** *(integer) --* This is set to the number of metadata entries not returned in the headers that are prefixed with "x-amz-meta-". 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. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. * **CacheControl** *(string) --* Specifies caching behavior along the request/reply chain. * **ContentDisposition** *(string) --* Specifies presentational information for the object. * **ContentEncoding** *(string) --* Indicates 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. * **ContentRange** *(string) --* The portion of the object returned in the response. * **ContentType** *(string) --* A standard MIME type describing the format of the object data. * **Expires** *(datetime) --* The date and time at which the object is no longer cacheable. Note: This member has been deprecated. Please use "ExpiresString" instead. * **ExpiresString** *(string) --* The raw, unparsed value of the "Expires" field. * **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. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **Metadata** *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **StorageClass** *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ReplicationStatus** *(string) --* Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule. Note: This functionality is not supported for directory buckets. * **PartsCount** *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. * **TagCount** *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** *(string) --* The Object Lock mode that's currently in place for this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date and time when this object's Object Lock will expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** *(string) --* Indicates whether this object has an active legal hold. This field is only returned if you have permission to view an object's legal hold status. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchKey" * "S3.Client.exceptions.InvalidObjectState" **Examples** The following example retrieves an object for an S3 bucket. response = client.get_object( Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'AcceptRanges': 'bytes', 'ContentLength': '3191', 'ContentType': 'image/jpeg', 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'LastModified': datetime(2016, 12, 15, 1, 19, 41, 3, 350, 0), 'Metadata': { }, 'TagCount': 2, 'VersionId': 'null', 'ResponseMetadata': { '...': '...', }, } The following example retrieves an object for an S3 bucket. The request specifies the range header to retrieve a specific byte range. response = client.get_object( Bucket='examplebucket', Key='SampleFile.txt', Range='bytes=0-9', ) print(response) Expected Output: { 'AcceptRanges': 'bytes', 'ContentLength': '10', 'ContentRange': 'bytes 0-9/43', 'ContentType': 'text/plain', 'ETag': '"0d94420ffd0bc68cd3d152506b97a9cc"', 'LastModified': datetime(2014, 10, 9, 22, 57, 28, 3, 282, 0), 'Metadata': { }, 'VersionId': 'null', 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_analytics_configuration get_bucket_analytics_configuration ********************************** S3.Client.get_bucket_analytics_configuration(**kwargs) Note: This operation is not supported for directory buckets. This implementation of the GET action returns an analytics configuration (identified by the analytics configuration ID) from the bucket. To use this operation, you must have permissions to perform the "s3:GetAnalyticsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources in the *Amazon S3 User Guide*. For information about Amazon S3 analytics feature, see Amazon S3 Analytics – Storage Class Analysis in the *Amazon S3 User Guide*. The following operations are related to "GetBucketAnalyticsConfiguration": * DeleteBucketAnalyticsConfiguration * ListBucketAnalyticsConfigurations * PutBucketAnalyticsConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_analytics_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket from which an analytics configuration is retrieved. * **Id** (*string*) -- **[REQUIRED]** The ID that identifies the analytics configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'AnalyticsConfiguration': { 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'StorageClassAnalysis': { 'DataExport': { 'OutputSchemaVersion': 'V_1', 'Destination': { 'S3BucketDestination': { 'Format': 'CSV', 'BucketAccountId': 'string', 'Bucket': 'string', 'Prefix': 'string' } } } } } } **Response Structure** * *(dict) --* * **AnalyticsConfiguration** *(dict) --* The configuration and any analyses for the analytics filter. * **Id** *(string) --* The ID that identifies the analytics configuration. * **Filter** *(dict) --* The filter used to describe a set of objects for analyses. A filter must have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no filter is provided, all objects will be considered in any analysis. * **Prefix** *(string) --* The prefix to use when evaluating an analytics filter. * **Tag** *(dict) --* The tag to use when evaluating an analytics filter. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating an analytics filter. The operator must have at least two predicates. * **Prefix** *(string) --* The prefix to use when evaluating an AND predicate: The prefix that an object must have to be included in the metrics results. * **Tags** *(list) --* The list of tags to use when evaluating an AND predicate. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **StorageClassAnalysis** *(dict) --* Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes. * **DataExport** *(dict) --* Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported. * **OutputSchemaVersion** *(string) --* The version of the output schema to use when exporting data. Must be "V_1". * **Destination** *(dict) --* The place to store the data for an analysis. * **S3BucketDestination** *(dict) --* A destination signifying output to an S3 bucket. * **Format** *(string) --* Specifies the file format used when exporting data to Amazon S3. * **BucketAccountId** *(string) --* The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Note: Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. * **Bucket** *(string) --* The Amazon Resource Name (ARN) of the bucket to which data is exported. * **Prefix** *(string) --* The prefix to use when exporting data. The prefix is prepended to all results. S3 / Client / put_bucket_accelerate_configuration put_bucket_accelerate_configuration *********************************** S3.Client.put_bucket_accelerate_configuration(**kwargs) Note: This operation is not supported for directory buckets. Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer Acceleration is a bucket-level feature that enables you to perform faster data transfers to Amazon S3. To use this operation, you must have permission to perform the "s3:PutAccelerateConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. The Transfer Acceleration state of a bucket can be set to one of the following two values: * Enabled – Enables accelerated data transfers to the bucket. * Suspended – Disables accelerated data transfers to the bucket. The GetBucketAccelerateConfiguration action returns the transfer acceleration state of a bucket. After setting the Transfer Acceleration state of a bucket to Enabled, it might take up to thirty minutes before the data transfer rates to the bucket increase. The name of the bucket used for Transfer Acceleration must be DNS- compliant and must not contain periods ("."). For more information about transfer acceleration, see Transfer Acceleration. The following operations are related to "PutBucketAccelerateConfiguration": * GetBucketAccelerateConfiguration * CreateBucket See also: AWS API Documentation **Request Syntax** response = client.put_bucket_accelerate_configuration( Bucket='string', AccelerateConfiguration={ 'Status': 'Enabled'|'Suspended' }, ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which the accelerate configuration is set. * **AccelerateConfiguration** (*dict*) -- **[REQUIRED]** Container for setting the transfer acceleration state. * **Status** *(string) --* Specifies the transfer acceleration status of the bucket. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Returns: None S3 / Client / get_bucket_lifecycle get_bucket_lifecycle ******************** S3.Client.get_bucket_lifecycle(**kwargs) Warning: For an updated version of this API, see GetBucketLifecycleConfiguration. If you configured a bucket lifecycle using the "filter" element, you should see the updated version of this topic. This topic is provided for backward compatibility. Note: This operation is not supported for directory buckets. Returns the lifecycle configuration information set on the bucket. For information about lifecycle configuration, see Object Lifecycle Management. To use this operation, you must have permission to perform the "s3:GetLifecycleConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. "GetBucketLifecycle" has the following special error: * Error code: "NoSuchLifecycleConfiguration" * Description: The lifecycle configuration does not exist. * HTTP Status Code: 404 Not Found * SOAP Fault Code Prefix: Client The following operations are related to "GetBucketLifecycle": * GetBucketLifecycleConfiguration * PutBucketLifecycle * DeleteBucketLifecycle Danger: This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity. See also: AWS API Documentation **Request Syntax** response = client.get_bucket_lifecycle( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the lifecycle information. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Prefix': 'string', 'Status': 'Enabled'|'Disabled', 'Transition': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR' }, 'NoncurrentVersionTransition': { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'NewerNoncurrentVersions': 123 }, 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] } **Response Structure** * *(dict) --* * **Rules** *(list) --* Container for a lifecycle rule. * *(dict) --* Specifies lifecycle rules for an Amazon S3 bucket. For more information, see Put Bucket Lifecycle Configuration in the *Amazon S3 API Reference*. For examples, see Put Bucket Lifecycle Configuration Examples. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value can't be longer than 255 characters. * **Prefix** *(string) --* Object key prefix that identifies one or more objects to which this rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Status** *(string) --* If "Enabled", the rule is currently being applied. If "Disabled", the rule is not currently being applied. * **Transition** *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransition** *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. **Examples** The following example gets ACL on the specified bucket. response = client.get_bucket_lifecycle( Bucket='acl1', ) print(response) Expected Output: { 'Rules': [ { 'Expiration': { 'Days': 1, }, 'ID': 'delete logs', 'Prefix': '123/', 'Status': 'Enabled', }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_waiter get_waiter ********** S3.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" S3 / Client / create_bucket_metadata_table_configuration create_bucket_metadata_table_configuration ****************************************** S3.Client.create_bucket_metadata_table_configuration(**kwargs) Warning: We recommend that you create your S3 Metadata configurations by using the V2 CreateBucketMetadataConfiguration API operation. We no longer recommend using the V1 "CreateBucketMetadataTableConfiguration" API operation.If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table. Creates a V1 S3 Metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Permissions To use this operation, you must have the following permissions. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. If you also want to integrate your table bucket with Amazon Web Services analytics services so that you can query your metadata table, you need additional permissions. For more information, see Integrating Amazon S3 Tables with Amazon Web Services analytics services in the *Amazon S3 User Guide*. * "s3:CreateBucketMetadataTableConfiguration" * "s3tables:CreateNamespace" * "s3tables:GetTable" * "s3tables:CreateTable" * "s3tables:PutTablePolicy" The following operations are related to "CreateBucketMetadataTableConfiguration": * DeleteBucketMetadataTableConfiguration * GetBucketMetadataTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.create_bucket_metadata_table_configuration( Bucket='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', MetadataTableConfiguration={ 'S3TablesDestination': { 'TableBucketArn': 'string', 'TableName': 'string' } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that you want to create the metadata table configuration for. * **ContentMD5** (*string*) -- The "Content-MD5" header for the metadata table configuration. * **ChecksumAlgorithm** (*string*) -- The checksum algorithm to use with your metadata table configuration. * **MetadataTableConfiguration** (*dict*) -- **[REQUIRED]** The contents of your metadata table configuration. * **S3TablesDestination** *(dict) --* **[REQUIRED]** The destination information for the metadata table configuration. The destination table bucket must be in the same Region and Amazon Web Services account as the general purpose bucket. The specified metadata table name must be unique within the "aws_s3_metadata" namespace in the destination table bucket. * **TableBucketArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) for the table bucket that's specified as the destination in the metadata table configuration. The destination table bucket must be in the same Region and Amazon Web Services account as the general purpose bucket. * **TableName** *(string) --* **[REQUIRED]** The name for the metadata table in your metadata table configuration. The specified metadata table name must be unique within the "aws_s3_metadata" namespace in the destination table bucket. * **ExpectedBucketOwner** (*string*) -- The expected owner of the general purpose bucket that corresponds to your metadata table configuration. Returns: None S3 / Client / get_bucket_policy get_bucket_policy ***************** S3.Client.get_bucket_policy(**kwargs) Returns the policy of a specified bucket. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must both have the "GetBucketPolicy" permissions on the specified bucket and belong to the bucket owner's account in order to use this operation. If you don't have "GetBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: To ensure that bucket owners don't inadvertently lock themselves out of their own buckets, the root principal in a bucket owner's Amazon Web Services account can perform the "GetBucketPolicy", "PutBucketPolicy", and "DeleteBucketPolicy" API actions, even if their bucket policy explicitly denies the root principal's access. Bucket owner root principals can only be blocked from performing these API actions by VPC endpoint policies and Amazon Web Services Organizations policies. * **General purpose bucket permissions** - The "s3:GetBucketPolicy" permission is required in a policy. For more information about general purpose buckets bucket policies, see Using Bucket Policies and User Policies in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:GetBucketPolicy" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. Example bucket policies **General purpose buckets example bucket policies** - See Bucket policy examples in the *Amazon S3 User Guide*. **Directory bucket example bucket policies** - See Example bucket policies for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following action is related to "GetBucketPolicy": * GetObject See also: AWS API Documentation **Request Syntax** response = client.get_bucket_policy( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name to get the bucket policy for. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* **Access points** - When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. **Object Lambda access points** - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. Note: Object Lambda access points are not supported by directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Return type: dict Returns: **Response Syntax** { 'Policy': 'string' } **Response Structure** * *(dict) --* * **Policy** *(string) --* The bucket policy as a JSON document. **Examples** The following example returns bucket policy associated with a bucket. response = client.get_bucket_policy( Bucket='examplebucket', ) print(response) Expected Output: { 'Policy': '{"Version":"2008-10-17","Id":"LogPolicy","Statement":[{"Sid":"Enables the log delivery group to publish logs to your bucket ","Effect":"Allow","Principal":{"AWS":"111122223333"},"Action":["s3:GetBucketAcl","s3:GetObjectAcl","s3:PutObject"],"Resource":["arn:aws:s3:::policytest1/*","arn:aws:s3:::policytest1"]}]}', 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_object_lock_configuration get_object_lock_configuration ***************************** S3.Client.get_object_lock_configuration(**kwargs) Note: This operation is not supported for directory buckets. Gets the Object Lock configuration for a bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects. The following action is related to "GetObjectLockConfiguration": * GetObjectAttributes See also: AWS API Documentation **Request Syntax** response = client.get_object_lock_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket whose Object Lock configuration you want to retrieve. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'ObjectLockConfiguration': { 'ObjectLockEnabled': 'Enabled', 'Rule': { 'DefaultRetention': { 'Mode': 'GOVERNANCE'|'COMPLIANCE', 'Days': 123, 'Years': 123 } } } } **Response Structure** * *(dict) --* * **ObjectLockConfiguration** *(dict) --* The specified bucket's Object Lock configuration. * **ObjectLockEnabled** *(string) --* Indicates whether this bucket has an Object Lock configuration enabled. Enable "ObjectLockEnabled" when you apply "ObjectLockConfiguration" to a bucket. * **Rule** *(dict) --* Specifies the Object Lock rule for the specified object. Enable the this rule when you apply "ObjectLockConfiguration" to a bucket. Bucket settings require both a mode and a period. The period can be either "Days" or "Years" but you must select one. You cannot specify "Days" and "Years" at the same time. * **DefaultRetention** *(dict) --* The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket. Bucket settings require both a mode and a period. The period can be either "Days" or "Years" but you must select one. You cannot specify "Days" and "Years" at the same time. * **Mode** *(string) --* The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Must be used with either "Days" or "Years". * **Days** *(integer) --* The number of days that you want to specify for the default retention period. Must be used with "Mode". * **Years** *(integer) --* The number of years that you want to specify for the default retention period. Must be used with "Mode". S3 / Client / get_object_torrent get_object_torrent ****************** S3.Client.get_object_torrent(**kwargs) Note: This operation is not supported for directory buckets. Returns torrent files from a bucket. BitTorrent can save you bandwidth when you're distributing large files. Note: You can get torrent only for objects that are less than 5 GB in size, and that are not encrypted using server-side encryption with a customer-provided encryption key. To use GET, you must have READ access to the object. This functionality is not supported for Amazon S3 on Outposts. The following action is related to "GetObjectTorrent": * GetObject See also: AWS API Documentation **Request Syntax** response = client.get_object_torrent( Bucket='string', Key='string', RequestPayer='requester', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the object for which to get the torrent files. * **Key** (*string*) -- **[REQUIRED]** The object key for which to get the information. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Body': StreamingBody(), 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Body** ("StreamingBody") -- A Bencoded dictionary as defined by the BitTorrent specification * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example retrieves torrent files of an object. response = client.get_object_torrent( Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / list_parts list_parts ********** S3.Client.list_parts(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Lists the parts that have been uploaded for a specific multipart upload. To use this operation, you must provide the "upload ID" in the request. You obtain this uploadID by sending the initiate multipart upload request through CreateMultipartUpload. The "ListParts" request returns a maximum of 1,000 uploaded parts. The limit of 1,000 parts is also the default value. You can restrict the number of parts in a response by specifying the "max- parts" request parameter. If your multipart upload consists of more than 1,000 parts, the response returns an "IsTruncated" field with the value of "true", and a "NextPartNumberMarker" element. To list remaining uploaded parts, in subsequent "ListParts" requests, include the "part-number-marker" query string parameter and set its value to the "NextPartNumberMarker" field value from the previous response. For more information on multipart uploads, see Uploading Objects Using Multipart Upload in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions in the *Amazon S3 User Guide*. If the upload was created using server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), you must have permission to the "kms:Decrypt" action for the "ListParts" request to succeed. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "ListParts": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * AbortMultipartUpload * GetObjectAttributes * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = client.list_parts( Bucket='string', Key='string', MaxParts=123, PartNumberMarker=123, UploadId='string', RequestPayer='requester', ExpectedBucketOwner='string', SSECustomerAlgorithm='string', SSECustomerKey='string', ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to which the parts are being uploaded. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Object key for which the multipart upload was initiated. * **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*) -- **[REQUIRED]** Upload ID identifying the multipart upload whose parts are being listed. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **SSECustomerAlgorithm** (*string*) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required Return type: dict Returns: **Response Syntax** { 'AbortDate': datetime(2015, 1, 1), 'AbortRuleId': 'string', 'Bucket': 'string', 'Key': 'string', 'UploadId': 'string', 'PartNumberMarker': 123, 'NextPartNumberMarker': 123, 'MaxParts': 123, 'IsTruncated': True|False, 'Parts': [ { 'PartNumber': 123, 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'Size': 123, 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, ], 'Initiator': { 'ID': 'string', 'DisplayName': 'string' }, 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT' } **Response Structure** * *(dict) --* * **AbortDate** *(datetime) --* If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and the prefix in the lifecycle rule matches the object name in the request, then the response includes this header indicating when the initiated multipart upload will become eligible for abort operation. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration. The response will also include the "x-amz-abort-rule-id" header that will provide the ID of the lifecycle configuration rule that defines this action. Note: This functionality is not supported for directory buckets. * **AbortRuleId** *(string) --* This header is returned along with the "x-amz-abort-date" header. It identifies applicable lifecycle configuration rule that defines the action to abort incomplete multipart uploads. Note: This functionality is not supported for directory buckets. * **Bucket** *(string) --* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or access point alias if used. * **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) --* Specifies the part after which listing should begin. Only parts with higher part numbers will be listed. * **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. A true value indicates that the list was truncated. A list can be truncated if the number of parts exceeds the limit returned in the MaxParts element. * **Parts** *(list) --* Container for elements related to a particular part. A response can contain zero or more "Part" elements. * *(dict) --* Container for elements related to a part. * **PartNumber** *(integer) --* Part number identifying the part. This is a positive integer between 1 and 10,000. * **LastModified** *(datetime) --* Date and time at which the part was uploaded. * **ETag** *(string) --* Entity tag returned when the part was uploaded. * **Size** *(integer) --* Size in bytes of the uploaded part data. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the part. This checksum is present if the object was uploaded with the "CRC32" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the part. This checksum is present if the object was uploaded with the "CRC32C" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm, or if the object was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" checksum of the part. This checksum is present if the object was uploaded with the "SHA1" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" checksum of the part. This checksum is present if the object was uploaded with the "SHA256" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Initiator** *(dict) --* Container element that identifies who initiated the multipart upload. If the initiator is an Amazon Web Services account, this element provides the same information as the "Owner" element. If the initiator is an IAM User, this element provides the user ARN and display name. * **ID** *(string) --* If the principal is an Amazon Web Services account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value. Note: **Directory buckets** - If the principal is an Amazon Web Services account, it provides the Amazon Web Services account ID. If the principal is an IAM User, it provides a user ARN value. * **DisplayName** *(string) --* Name of the Principal. Note: This functionality is not supported for directory buckets. * **Owner** *(dict) --* Container element that identifies the object owner, after the object is created. If multipart upload is initiated by an IAM user, this element provides the parent account ID and display name. Note: **Directory buckets** - The bucket owner is returned as the object owner for all the parts. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **StorageClass** *(string) --* The class of storage used to store the uploaded object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** *(string) --* The algorithm that was used to create a checksum of the object. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in "CreateMultipartUpload" request. For more information, see Checking object integrity in the Amazon S3 User Guide. **Examples** The following example lists parts uploaded for a specific multipart upload. response = client.list_parts( Bucket='examplebucket', Key='bigobject', UploadId='example7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--', ) print(response) Expected Output: { 'Initiator': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Owner': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Parts': [ { 'ETag': '"d8c2eafd90c266e19ab9dcacc479f8af"', 'LastModified': datetime(2016, 12, 16, 0, 11, 42, 4, 351, 0), 'PartNumber': '1', 'Size': 26246026, }, { 'ETag': '"d8c2eafd90c266e19ab9dcacc479f8af"', 'LastModified': datetime(2016, 12, 16, 0, 15, 1, 4, 351, 0), 'PartNumber': '2', 'Size': 26246026, }, ], 'StorageClass': 'STANDARD', 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_notification get_bucket_notification *********************** S3.Client.get_bucket_notification(**kwargs) Note: This operation is not supported for directory buckets. No longer used, see GetBucketNotificationConfiguration. Danger: This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity. See also: AWS API Documentation **Request Syntax** response = client.get_bucket_notification( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the notification configuration. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'TopicConfiguration': { 'Id': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', 'Topic': 'string' }, 'QueueConfiguration': { 'Id': 'string', 'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Queue': 'string' }, 'CloudFunctionConfiguration': { 'Id': 'string', 'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'CloudFunction': 'string', 'InvocationRole': 'string' } } **Response Structure** * *(dict) --* * **TopicConfiguration** *(dict) --* This data type is deprecated. A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **Events** *(list) --* A collection of events related to objects * *(string) --* The bucket event for which to send notifications. * **Event** *(string) --* Bucket event for which to send notifications. * **Topic** *(string) --* Amazon SNS topic to which Amazon S3 will publish a message to report the specified events for the bucket. * **QueueConfiguration** *(dict) --* This data type is deprecated. This data type specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **Event** *(string) --* The bucket event for which to send notifications. * **Events** *(list) --* A collection of bucket events for which to send notifications. * *(string) --* The bucket event for which to send notifications. * **Queue** *(string) --* The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. * **CloudFunctionConfiguration** *(dict) --* Container for specifying the Lambda notification configuration. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **Event** *(string) --* The bucket event for which to send notifications. * **Events** *(list) --* Bucket events for which to send notifications. * *(string) --* The bucket event for which to send notifications. * **CloudFunction** *(string) --* Lambda cloud function ARN that Amazon S3 can invoke when it detects events of the specified type. * **InvocationRole** *(string) --* The role supporting the invocation of the Lambda function **Examples** The following example returns notification configuration set on a bucket. response = client.get_bucket_notification( Bucket='examplebucket', ) print(response) Expected Output: { 'QueueConfiguration': { 'Event': 's3:ObjectCreated:Put', 'Events': [ 's3:ObjectCreated:Put', ], 'Id': 'MDQ2OGQ4NDEtOTBmNi00YTM4LTk0NzYtZDIwN2I3NWQ1NjIx', 'Queue': 'arn:aws:sqs:us-east-1:acct-id:S3ObjectCreatedEventQueue', }, 'TopicConfiguration': { 'Event': 's3:ObjectCreated:Copy', 'Events': [ 's3:ObjectCreated:Copy', ], 'Id': 'YTVkMWEzZGUtNTY1NS00ZmE2LWJjYjktMmRlY2QwODFkNTJi', 'Topic': 'arn:aws:sns:us-east-1:acct-id:S3ObjectCreatedEventTopic', }, 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_object_acl get_object_acl ************** S3.Client.get_object_acl(**kwargs) Note: This operation is not supported for directory buckets. Returns the access control list (ACL) of an object. To use this operation, you must have "s3:GetObjectAcl" permissions or "READ_ACP" access to the object. For more information, see Mapping of ACL permissions and access policy permissions in the *Amazon S3 User Guide* This functionality is not supported for Amazon S3 on Outposts. By default, GET returns ACL information about the current version of an object. To return ACL information about a different version, use the versionId subresource. Note: If your bucket uses the bucket owner enforced setting for S3 Object Ownership, requests to read ACLs are still supported and return the "bucket-owner-full-control" ACL with the owner being the account that created the bucket. For more information, see Controlling object ownership and disabling ACLs in the *Amazon S3 User Guide*. The following operations are related to "GetObjectAcl": * GetObject * GetObjectAttributes * DeleteObject * PutObject See also: AWS API Documentation **Request Syntax** response = client.get_object_acl( Bucket='string', Key='string', VersionId='string', RequestPayer='requester', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name that contains the object for which to get the ACL information. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The key of the object for which to get the ACL information. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Grants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Owner** *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Grants** *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchKey" **Examples** The following example retrieves access control list (ACL) of an object. response = client.get_object_acl( Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'Grants': [ { 'Grantee': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', 'Type': 'CanonicalUser', }, 'Permission': 'WRITE', }, { 'Grantee': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', 'Type': 'CanonicalUser', }, 'Permission': 'WRITE_ACP', }, { 'Grantee': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', 'Type': 'CanonicalUser', }, 'Permission': 'READ', }, { 'Grantee': { 'DisplayName': 'owner-display-name', 'ID': '852b113eexamplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', 'Type': 'CanonicalUser', }, 'Permission': 'READ_ACP', }, ], 'Owner': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket_ownership_controls delete_bucket_ownership_controls ******************************** S3.Client.delete_bucket_ownership_controls(**kwargs) Note: This operation is not supported for directory buckets. Removes "OwnershipControls" for an Amazon S3 bucket. To use this operation, you must have the "s3:PutBucketOwnershipControls" permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. For information about Amazon S3 Object Ownership, see Using Object Ownership. The following operations are related to "DeleteBucketOwnershipControls": * GetBucketOwnershipControls * PutBucketOwnershipControls See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_ownership_controls( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The Amazon S3 bucket whose "OwnershipControls" you want to delete. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / delete_bucket_lifecycle delete_bucket_lifecycle *********************** S3.Client.delete_bucket_lifecycle(**kwargs) Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration. Permissions * **General purpose bucket permissions** - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the "s3:PutLifecycleConfiguration" permission. For more information about permissions, see Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - You must have the "s3express:PutLifecycleConfiguration" permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource. For more information about directory bucket policies and permissions, see Authorizing Regional endpoint APIs with IAM in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". For more information about the object expiration, see Elements to Describe Lifecycle Actions. Related actions include: * PutBucketLifecycleConfiguration * GetBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_lifecycle( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name of the lifecycle to delete. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. Returns: None **Examples** The following example deletes lifecycle configuration on a bucket. response = client.delete_bucket_lifecycle( Bucket='examplebucket', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_bucket_lifecycle put_bucket_lifecycle ******************** S3.Client.put_bucket_lifecycle(**kwargs) Note: This operation is not supported for directory buckets. Warning: For an updated version of this API, see PutBucketLifecycleConfiguration. This version has been deprecated. Existing lifecycle configurations will work. For new lifecycle configurations, use the updated API. Note: This operation is not supported for directory buckets. Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. For information about lifecycle configuration, see Object Lifecycle Management in the *Amazon S3 User Guide*. By default, all Amazon S3 resources, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration) are private. Only the resource owner, the Amazon Web Services account that created the resource, can access it. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, users must get the "s3:PutLifecycleConfiguration" permission. You can also explicitly deny permissions. Explicit denial also supersedes any other permissions. If you want to prevent users or accounts from removing or deleting objects from your bucket, you must deny them permissions for the following actions: * "s3:DeleteObject" * "s3:DeleteObjectVersion" * "s3:PutLifecycleConfiguration" For more information about permissions, see Managing Access Permissions to your Amazon S3 Resources in the *Amazon S3 User Guide*. For more examples of transitioning objects to storage classes such as STANDARD_IA or ONEZONE_IA, see Examples of Lifecycle Configuration. The following operations are related to "PutBucketLifecycle": * >>`<`__(Deprecated) * GetBucketLifecycleConfiguration * RestoreObject * By default, a resource owner—in this case, a bucket owner, which is the Amazon Web Services account that created the bucket—can perform any of the operations. A resource owner can also grant others permission to perform the operation. For more information, see the following topics in the Amazon S3 User Guide: * Specifying Permissions in a Policy * Managing Access Permissions to your Amazon S3 Resources Danger: This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity. See also: AWS API Documentation **Request Syntax** response = client.put_bucket_lifecycle( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', LifecycleConfiguration={ 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Prefix': 'string', 'Status': 'Enabled'|'Disabled', 'Transition': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR' }, 'NoncurrentVersionTransition': { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'NewerNoncurrentVersions': 123 }, 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **LifecycleConfiguration** (*dict*) -- * **Rules** *(list) --* **[REQUIRED]** Specifies lifecycle configuration rules for an Amazon S3 bucket. * *(dict) --* Specifies lifecycle rules for an Amazon S3 bucket. For more information, see Put Bucket Lifecycle Configuration in the *Amazon S3 API Reference*. For examples, see Put Bucket Lifecycle Configuration Examples. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value can't be longer than 255 characters. * **Prefix** *(string) --* **[REQUIRED]** Object key prefix that identifies one or more objects to which this rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Status** *(string) --* **[REQUIRED]** If "Enabled", the rule is currently being applied. If "Disabled", the rule is not currently being applied. * **Transition** *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransition** *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / create_bucket create_bucket ************* S3.Client.create_bucket(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts bucket, see CreateBucket. Creates a new S3 bucket. To create a bucket, you must set up 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. There are two types of buckets: general purpose buckets and directory buckets. For more information about these bucket types, see Creating, configuring, and working with Amazon S3 buckets in the *Amazon S3 User Guide*. Note: * **General purpose buckets** - If you send your "CreateBucket" request to the "s3.amazonaws.com" global endpoint, the request goes to the "us-east-1" Region. So 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 Virtual hosting of buckets in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - In addition to the "s3:CreateBucket" permission, the following permissions are required in a policy when your "CreateBucket" request includes specific headers: * **Access control lists (ACLs)** - In your "CreateBucket" request, if you specify an access control list (ACL) and set it to "public-read", "public-read-write", "authenticated-read", or if you explicitly specify any other custom ACLs, both "s3:CreateBucket" and "s3:PutBucketAcl" permissions are required. In your "CreateBucket" request, if you set the ACL to "private", or if you don't specify any ACLs, only the "s3:CreateBucket" permission is required. * **Object Lock** - In your "CreateBucket" request, if you set "x -amz-bucket-object-lock-enabled" to true, the "s3:PutBucketObjectLockConfiguration" and "s3:PutBucketVersioning" permissions are required. * **S3 Object Ownership** - If your "CreateBucket" request includes the "x-amz-object-ownership" header, then the "s3:PutBucketOwnershipControls" permission is required. Warning: To set an ACL on a bucket as part of a "CreateBucket" request, you must explicitly set S3 Object Ownership for the bucket to a different value than the default, "BucketOwnerEnforced". Additionally, if your desired bucket ACL grants public access, you must first create the bucket (without the bucket ACL) and then explicitly disable Block Public Access on the bucket before using "PutBucketAcl" to set the ACL. If you try to create a bucket with a public ACL, the request will fail. For the majority of modern use cases in S3, we recommend that you keep all Block Public Access settings enabled and keep ACLs disabled. If you would like to share data with users outside of your account, you can use bucket policies as needed. For more information, see Controlling ownership of objects and disabling ACLs for your bucket and Blocking public access to your Amazon S3 storage in the *Amazon S3 User Guide*. * **S3 Block Public Access** - If your specific use case requires granting public access to your S3 resources, you can disable Block Public Access. Specifically, you can create a new bucket with Block Public Access enabled, then separately call the DeletePublicAccessBlock API. To use this operation, you must have the "s3:PutBucketPublicAccessBlock" permission. For more information about S3 Block Public Access, see Blocking public access to your Amazon S3 storage in the *Amazon S3 User Guide*. * **Directory bucket permissions** - You must have the "s3express:CreateBucket" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. Warning: The permissions for ACLs, Object Lock, S3 Object Ownership, and S3 Block Public Access are not supported for directory buckets. For directory buckets, all Block Public Access settings are enabled at the bucket level and S3 Object Ownership is set to Bucket owner enforced (ACLs disabled). These settings can't be modified. For more information about permissions for creating and working with directory buckets, see Directory buckets in the *Amazon S3 User Guide*. For more information about supported S3 features for directory buckets, see Features of S3 Express One Zone in the *Amazon S3 User Guide*.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "CreateBucket": * PutObject * DeleteBucket See also: AWS API Documentation **Request Syntax** response = client.create_bucket( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', Bucket='string', CreateBucketConfiguration={ 'LocationConstraint': 'af-south-1'|'ap-east-1'|'ap-northeast-1'|'ap-northeast-2'|'ap-northeast-3'|'ap-south-1'|'ap-south-2'|'ap-southeast-1'|'ap-southeast-2'|'ap-southeast-3'|'ap-southeast-4'|'ap-southeast-5'|'ca-central-1'|'cn-north-1'|'cn-northwest-1'|'EU'|'eu-central-1'|'eu-central-2'|'eu-north-1'|'eu-south-1'|'eu-south-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'il-central-1'|'me-central-1'|'me-south-1'|'sa-east-1'|'us-east-2'|'us-gov-east-1'|'us-gov-west-1'|'us-west-1'|'us-west-2', 'Location': { 'Type': 'AvailabilityZone'|'LocalZone', 'Name': 'string' }, 'Bucket': { 'DataRedundancy': 'SingleAvailabilityZone'|'SingleLocalZone', 'Type': 'Directory' }, 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', ObjectLockEnabledForBucket=True|False, ObjectOwnership='BucketOwnerPreferred'|'ObjectWriter'|'BucketOwnerEnforced' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the bucket. Note: This functionality is not supported for directory buckets. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to create. **General purpose buckets** - For information about bucket naming restrictions, see Bucket naming rules in the *Amazon S3 User Guide*. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **CreateBucketConfiguration** (*dict*) -- The configuration information for the bucket. * **LocationConstraint** *(string) --* Specifies the Region where the bucket will be created. 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. If you don't specify a Region, the bucket is created in the US East (N. Virginia) Region (us-east-1) by default. Configurations using the value "EU" will create a bucket in "eu-west-1". For a list of the valid values for all of the Amazon Web Services Regions, see Regions and Endpoints. Note: This functionality is not supported for directory buckets. * **Location** *(dict) --* Specifies the location where the bucket will be created. **Directory buckets** - The location type is Availability Zone or Local Zone. To use the Local Zone location type, your account must be enabled for Local Zones. Otherwise, you get an HTTP "403 Forbidden" error with the error code "AccessDenied". To learn more, see Enable accounts for Local Zones in the *Amazon S3 User Guide*. Note: This functionality is only supported by directory buckets. * **Type** *(string) --* The type of location where the bucket will be created. * **Name** *(string) --* The name of the location where the bucket will be created. For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is "usw2-az1". * **Bucket** *(dict) --* Specifies the information about the bucket that will be created. Note: This functionality is only supported by directory buckets. * **DataRedundancy** *(string) --* The number of Zone (Availability Zone or Local Zone) that's used for redundancy for the bucket. * **Type** *(string) --* The type of bucket. * **Tags** *(list) --* An array of tags that you can apply to the bucket that you're creating. Tags are key-value pairs of metadata used to categorize and organize your buckets, track costs, and control access. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **GrantFullControl** (*string*) -- Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. Note: This functionality is not supported for directory buckets. * **GrantRead** (*string*) -- Allows grantee to list the objects in the bucket. Note: This functionality is not supported for directory buckets. * **GrantReadACP** (*string*) -- Allows grantee to read the bucket ACL. Note: This functionality is not supported for directory buckets. * **GrantWrite** (*string*) -- Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. Note: This functionality is not supported for directory buckets. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. Note: This functionality is not supported for directory buckets. * **ObjectLockEnabledForBucket** (*boolean*) -- Specifies whether you want S3 Object Lock to be enabled for the new bucket. Note: This functionality is not supported for directory buckets. * **ObjectOwnership** (*string*) -- The container element for object ownership for a bucket's ownership controls. "BucketOwnerPreferred" - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the "bucket-owner-full-control" canned ACL. "ObjectWriter" - The uploading account will own the object if the object is uploaded with the "bucket-owner-full-control" canned ACL. "BucketOwnerEnforced" - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or specify bucket owner full control ACLs (such as the predefined "bucket-owner-full-control" canned ACL or a custom ACL in XML format that grants the same permissions). By default, "ObjectOwnership" is set to "BucketOwnerEnforced" and ACLs are disabled. We recommend keeping ACLs disabled, except in uncommon use cases where you must control access for each object individually. For more information about S3 Object Ownership, see Controlling ownership of objects and disabling ACLs for your bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets use the bucket owner enforced setting for S3 Object Ownership. Return type: dict Returns: **Response Syntax** { 'Location': 'string', 'BucketArn': 'string' } **Response Structure** * *(dict) --* * **Location** *(string) --* A forward slash followed by the name of the bucket. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. **Exceptions** * "S3.Client.exceptions.BucketAlreadyExists" * "S3.Client.exceptions.BucketAlreadyOwnedByYou" **Examples** The following example creates a bucket. The request specifies an AWS region where to create the bucket. response = client.create_bucket( Bucket='examplebucket', CreateBucketConfiguration={ 'LocationConstraint': 'eu-west-1', }, ) print(response) Expected Output: { 'Location': 'http://examplebucket.s3.amazonaws.com/', 'ResponseMetadata': { '...': '...', }, } The following example creates a bucket. response = client.create_bucket( Bucket='examplebucket', ) print(response) Expected Output: { 'Location': '/examplebucket', 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket delete_bucket ************* S3.Client.delete_bucket(**kwargs) Deletes the S3 bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted. Note: * **Directory buckets** - If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - You must have the "s3:DeleteBucket" permission on the specified bucket in a policy. * **Directory bucket permissions** - You must have the "s3express:DeleteBucket" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "DeleteBucket": * CreateBucket * DeleteObject See also: AWS API Documentation **Request Syntax** response = client.delete_bucket( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket being deleted. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None **Examples** The following example deletes the specified bucket. response = client.delete_bucket( Bucket='forrandall2', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / head_bucket head_bucket *********** S3.Client.head_bucket(**kwargs) You can use this operation to determine if a bucket exists and if you have permission to access it. The action returns a "200 OK" if the bucket exists and you have permission to access it. Note: If the bucket does not exist or you do not have permission to access it, the "HEAD" request returns a generic "400 Bad Request", "403 Forbidden" or "404 Not Found" code. A message body is not included, so you cannot determine the exception beyond these HTTP response codes.Authentication and authorization **General purpose buckets** - Request to public buckets that grant the s3:ListBucket permission publicly do not need to be signed. All other "HeadBucket" requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the "x-amz-" prefix, including "x -amz-copy-source", must be signed. For more information, see REST Authentication. **Directory buckets** - You must use IAM credentials to authenticate and authorize your access to the "HeadBucket" API operation, instead of using the temporary security credentials through the "CreateSession" API operation. Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. Permissions * **General purpose bucket permissions** - To use this operation, you must have permissions to perform the "s3:ListBucket" action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Managing access permissions to your Amazon S3 resources in the *Amazon S3 User Guide*. * **Directory bucket permissions** - You must have the "s3express:CreateSession" permission in the "Action" element of a policy. By default, the session is in the "ReadWrite" mode. If you want to restrict the access, you can explicitly set the "s3express:SessionMode" condition key to "ReadOnly" on the bucket. For more information about example bucket policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". Note: You must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format "https://bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.head_bucket( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **Object Lambda access points** - When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'BucketArn': 'string', 'BucketLocationType': 'AvailabilityZone'|'LocalZone', 'BucketLocationName': 'string', 'BucketRegion': 'string', 'AccessPointAlias': True|False } **Response Structure** * *(dict) --* * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * **BucketLocationType** *(string) --* The type of location where the bucket is created. Note: This functionality is only supported by directory buckets. * **BucketLocationName** *(string) --* The name of the location where the bucket will be created. For directory buckets, the Zone ID of the Availability Zone or the Local Zone where the bucket is created. An example Zone ID value for an Availability Zone is "usw2-az1". Note: This functionality is only supported by directory buckets. * **BucketRegion** *(string) --* The Region that the bucket is located. * **AccessPointAlias** *(boolean) --* Indicates whether the bucket name used in the request is an access point alias. Note: For directory buckets, the value of this field is "false". **Exceptions** * "S3.Client.exceptions.NoSuchBucket" **Examples** This operation checks to see if a bucket exists. response = client.head_bucket( Bucket='acl1', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / generate_presigned_url generate_presigned_url ********************** S3.Client.generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None) Generate a presigned url given a client, its method, and arguments Parameters: * **ClientMethod** (*string*) -- The client method to presign for * **Params** (*dict*) -- The parameters normally passed to "ClientMethod". * **ExpiresIn** (*int*) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds) * **HttpMethod** (*string*) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model. Returns: The presigned url S3 / Client / put_object_retention put_object_retention ******************** S3.Client.put_object_retention(**kwargs) Note: This operation is not supported for directory buckets. Places an Object Retention configuration on an object. For more information, see Locking Objects. Users or accounts require the "s3:PutObjectRetention" permission in order to place an Object Retention configuration on objects. Bypassing a Governance Retention configuration requires the "s3:BypassGovernanceRetention" permission. This functionality is not supported for Amazon S3 on Outposts. See also: AWS API Documentation **Request Syntax** response = client.put_object_retention( Bucket='string', Key='string', Retention={ 'Mode': 'GOVERNANCE'|'COMPLIANCE', 'RetainUntilDate': datetime(2015, 1, 1) }, RequestPayer='requester', VersionId='string', BypassGovernanceRetention=True|False, ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name that contains the object you want to apply this Object Retention configuration to. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The key name for the object that you want to apply this Object Retention configuration to. * **Retention** (*dict*) -- The container element for the Object Retention configuration. * **Mode** *(string) --* Indicates the Retention mode for the specified object. * **RetainUntilDate** *(datetime) --* The date on which this Object Lock Retention will expire. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- The version ID for the object that you want to apply this Object Retention configuration to. * **BypassGovernanceRetention** (*boolean*) -- Indicates whether this action should bypass Governance-mode restrictions. * **ContentMD5** (*string*) -- The MD5 hash for the request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. S3 / Client / put_bucket_inventory_configuration put_bucket_inventory_configuration ********************************** S3.Client.put_bucket_inventory_configuration(**kwargs) Note: This operation is not supported for directory buckets. This implementation of the "PUT" action adds an S3 Inventory configuration (identified by the inventory ID) to the bucket. You can have up to 1,000 inventory configurations per bucket. Amazon S3 inventory generates inventories of the objects in the bucket on a daily or weekly basis, and the results are published to a flat file. The bucket that is inventoried is called the *source* bucket, and the bucket where the inventory flat file is stored is called the *destination* bucket. The *destination* bucket must be in the same Amazon Web Services Region as the *source* bucket. When you configure an inventory for a *source* bucket, you specify the *destination* bucket where you want the inventory to be stored, and whether to generate the inventory daily or weekly. You can also configure what object metadata to include and whether to inventory all object versions or only current versions. For more information, see Amazon S3 Inventory in the Amazon S3 User Guide. Warning: You must create a bucket policy on the *destination* bucket to grant permissions to Amazon S3 to write objects to the bucket in the defined location. For an example policy, see Granting Permissions for Amazon S3 Inventory and Storage Class Analysis.Permissions To use this operation, you must have permission to perform the "s3:PutInventoryConfiguration" action. The bucket owner has this permission by default and can grant this permission to others. The "s3:PutInventoryConfiguration" permission allows a user to create an S3 Inventory report that includes all object metadata fields available and to specify the destination bucket to store the inventory. A user with read access to objects in the destination bucket can also access all object metadata fields that are available in the inventory report. To restrict access to an inventory report, see Restricting access to an Amazon S3 Inventory report in the *Amazon S3 User Guide*. For more information about the metadata fields available in S3 Inventory, see Amazon S3 Inventory lists in the *Amazon S3 User Guide*. For more information about permissions, see Permissions related to bucket subresource operations and Identity and access management in Amazon S3 in the *Amazon S3 User Guide*. "PutBucketInventoryConfiguration" has the following special errors: HTTP 400 Bad Request Error *Code:* InvalidArgument *Cause:* Invalid Argument HTTP 400 Bad Request Error *Code:* TooManyConfigurations *Cause:* You are attempting to create a new configuration but have already reached the 1,000-configuration limit. HTTP 403 Forbidden Error *Cause:* You are not the owner of the specified bucket, or you do not have the "s3:PutInventoryConfiguration" bucket permission to set the configuration on the bucket. The following operations are related to "PutBucketInventoryConfiguration": * GetBucketInventoryConfiguration * DeleteBucketInventoryConfiguration * ListBucketInventoryConfigurations See also: AWS API Documentation **Request Syntax** response = client.put_bucket_inventory_configuration( Bucket='string', Id='string', InventoryConfiguration={ 'Destination': { 'S3BucketDestination': { 'AccountId': 'string', 'Bucket': 'string', 'Format': 'CSV'|'ORC'|'Parquet', 'Prefix': 'string', 'Encryption': { 'SSES3': {} , 'SSEKMS': { 'KeyId': 'string' } } } }, 'IsEnabled': True|False, 'Filter': { 'Prefix': 'string' }, 'Id': 'string', 'IncludedObjectVersions': 'All'|'Current', 'OptionalFields': [ 'Size'|'LastModifiedDate'|'StorageClass'|'ETag'|'IsMultipartUploaded'|'ReplicationStatus'|'EncryptionStatus'|'ObjectLockRetainUntilDate'|'ObjectLockMode'|'ObjectLockLegalHoldStatus'|'IntelligentTieringAccessTier'|'BucketKeyStatus'|'ChecksumAlgorithm'|'ObjectAccessControlList'|'ObjectOwner', ], 'Schedule': { 'Frequency': 'Daily'|'Weekly' } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket where the inventory configuration will be stored. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the inventory configuration. * **InventoryConfiguration** (*dict*) -- **[REQUIRED]** Specifies the inventory configuration. * **Destination** *(dict) --* **[REQUIRED]** Contains information about where to publish the inventory results. * **S3BucketDestination** *(dict) --* **[REQUIRED]** Contains the bucket name, file format, bucket owner (optional), and prefix (optional) where inventory results are published. * **AccountId** *(string) --* The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Note: Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. * **Bucket** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the bucket where inventory results will be published. * **Format** *(string) --* **[REQUIRED]** Specifies the output format of the inventory results. * **Prefix** *(string) --* The prefix that is prepended to all inventory results. * **Encryption** *(dict) --* Contains the type of server-side encryption used to encrypt the inventory results. * **SSES3** *(dict) --* Specifies the use of SSE-S3 to encrypt delivered inventory reports. * **SSEKMS** *(dict) --* Specifies the use of SSE-KMS to encrypt delivered inventory reports. * **KeyId** *(string) --* **[REQUIRED]** Specifies the ID of the Key Management Service (KMS) symmetric encryption customer managed key to use for encrypting inventory reports. * **IsEnabled** *(boolean) --* **[REQUIRED]** Specifies whether the inventory is enabled or disabled. If set to "True", an inventory list is generated. If set to "False", no inventory list is generated. * **Filter** *(dict) --* Specifies an inventory filter. The inventory only includes objects that meet the filter's criteria. * **Prefix** *(string) --* **[REQUIRED]** The prefix that an object must have to be included in the inventory results. * **Id** *(string) --* **[REQUIRED]** The ID used to identify the inventory configuration. * **IncludedObjectVersions** *(string) --* **[REQUIRED]** Object versions to include in the inventory list. If set to "All", the list includes all the object versions, which adds the version-related fields "VersionId", "IsLatest", and "DeleteMarker" to the list. If set to "Current", the list does not contain these version-related fields. * **OptionalFields** *(list) --* Contains the optional fields that are included in the inventory results. * *(string) --* * **Schedule** *(dict) --* **[REQUIRED]** Specifies the schedule for generating inventory results. * **Frequency** *(string) --* **[REQUIRED]** Specifies how frequently inventory results are produced. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / get_bucket_lifecycle_configuration get_bucket_lifecycle_configuration ********************************** S3.Client.get_bucket_lifecycle_configuration(**kwargs) Returns the lifecycle configuration information set on the bucket. For information about lifecycle configuration, see Object Lifecycle Management. Bucket lifecycle configuration now supports specifying a lifecycle rule using an object key name prefix, one or more object tags, object size, or any combination of these. Accordingly, this section describes the latest API, which is compatible with the new functionality. The previous version of the API supported filtering based only on an object key name prefix, which is supported for general purpose buckets for backward compatibility. For the related API description, see GetBucketLifecycle. Note: Lifecyle configurations for directory buckets only support expiring objects and cancelling multipart uploads. Expiring of versioned objects, transitions and tag filters are not supported.Permissions * **General purpose bucket permissions** - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the "s3:GetLifecycleConfiguration" permission. For more information about permissions, see Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - You must have the "s3express:GetLifecycleConfiguration" permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource. For more information about directory bucket policies and permissions, see Authorizing Regional endpoint APIs with IAM in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". "GetBucketLifecycleConfiguration" has the following special error: * Error code: "NoSuchLifecycleConfiguration" * Description: The lifecycle configuration does not exist. * HTTP Status Code: 404 Not Found * SOAP Fault Code Prefix: Client The following operations are related to "GetBucketLifecycleConfiguration": * GetBucketLifecycle * PutBucketLifecycle * DeleteBucketLifecycle See also: AWS API Documentation **Request Syntax** response = client.get_bucket_lifecycle_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the lifecycle information. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. Return type: dict Returns: **Response Syntax** { 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Prefix': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 } }, 'Status': 'Enabled'|'Disabled', 'Transitions': [ { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR' }, ], 'NoncurrentVersionTransitions': [ { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'NewerNoncurrentVersions': 123 }, ], 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ], 'TransitionDefaultMinimumObjectSize': 'varies_by_storage_class'|'all_storage_classes_128K' } **Response Structure** * *(dict) --* * **Rules** *(list) --* Container for a lifecycle rule. * *(dict) --* A lifecycle rule for individual objects in an Amazon S3 bucket. For more information see, Managing your storage lifecycle in the *Amazon S3 User Guide*. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. This is no longer used; use "Filter" instead. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Filter** *(dict) --* The "Filter" is used to identify objects that a Lifecycle Rule applies to. A "Filter" must have exactly one of "Prefix", "Tag", "ObjectSizeGreaterThan", "ObjectSizeLessThan", or "And" specified. "Filter" is required if the "LifecycleRule" does not contain a "Prefix" element. For more information about "Tag" filters, see Adding filters to Lifecycle rules in the *Amazon S3 User Guide*. Note: "Tag" filters are not supported for directory buckets. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* This tag must exist in the object's tag set in order for the rule to apply. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **And** *(dict) --* This is used in a Lifecycle Rule Filter to apply a logical AND to two or more predicates. The Lifecycle Rule will apply to any object matching all of the predicates configured inside the And operator. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the rule to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **Status** *(string) --* If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. * **Transitions** *(list) --* Specifies when an Amazon S3 object transitions to a specified storage class. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransitions** *(list) --* Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific 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 a specific storage class at a set period in the object's lifetime. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. * **TransitionDefaultMinimumObjectSize** *(string) --* Indicates which default minimum object size behavior is applied to the lifecycle configuration. Note: This parameter applies to general purpose buckets only. It isn't supported for directory bucket lifecycle configurations. * "all_storage_classes_128K" - Objects smaller than 128 KB will not transition to any storage class by default. * "varies_by_storage_class" - Objects smaller than 128 KB will transition to Glacier Flexible Retrieval or Glacier Deep Archive storage classes. By default, all other storage classes will prevent transitions smaller than 128 KB. To customize the minimum object size for any transition you can add a filter that specifies a custom "ObjectSizeGreaterThan" or "ObjectSizeLessThan" in the body of your transition rule. Custom filters always take precedence over the default transition behavior. **Examples** The following example retrieves lifecycle configuration on set on a bucket. response = client.get_bucket_lifecycle_configuration( Bucket='examplebucket', ) print(response) Expected Output: { 'Rules': [ { 'ID': 'Rule for TaxDocs/', 'Prefix': 'TaxDocs', 'Status': 'Enabled', 'Transitions': [ { 'Days': 365, 'StorageClass': 'STANDARD_IA', }, ], }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_acl get_bucket_acl ************** S3.Client.get_bucket_acl(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. This implementation of the "GET" action uses the "acl" subresource to return the access control list (ACL) of a bucket. To use "GET" to return the ACL of the bucket, you must have the "READ_ACP" access to the bucket. If "READ_ACP" permission is granted to the anonymous user, you can return the ACL of the bucket without using an authorization header. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. Note: If your bucket uses the bucket owner enforced setting for S3 Object Ownership, requests to read ACLs are still supported and return the "bucket-owner-full-control" ACL with the owner being the account that created the bucket. For more information, see Controlling object ownership and disabling ACLs in the *Amazon S3 User Guide*. The following operations are related to "GetBucketAcl": * ListObjects See also: AWS API Documentation **Request Syntax** response = client.get_bucket_acl( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** Specifies the S3 bucket whose ACL is being requested. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Grants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ] } **Response Structure** * *(dict) --* * **Owner** *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Grants** *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. S3 / Client / list_objects list_objects ************ S3.Client.list_objects(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Returns some or all (up to 1,000) 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. A 200 OK response can contain valid or invalid XML. Be sure to design your application to parse the contents of the response and handle it appropriately. Warning: This action has been revised. We recommend that you use the newer version, ListObjectsV2, when developing applications. For backward compatibility, Amazon S3 continues to support "ListObjects". The following operations are related to "ListObjects": * ListObjectsV2 * GetObject * PutObject * CreateBucket * ListBuckets See also: AWS API Documentation **Request Syntax** response = client.list_objects( Bucket='string', Delimiter='string', EncodingType='url', Marker='string', MaxKeys=123, Prefix='string', RequestPayer='requester', ExpectedBucketOwner='string', OptionalObjectAttributes=[ 'RestoreStatus', ] ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the objects. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delimiter** (*string*) -- A delimiter is a character that you use to group keys. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent-encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **Marker** (*string*) -- Marker is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. Marker can be any key in the bucket. * **MaxKeys** (*integer*) -- Sets the maximum number of keys returned in the response. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. * **Prefix** (*string*) -- Limits the response to keys that begin with the specified prefix. * **RequestPayer** (*string*) -- Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'Marker': 'string', 'NextMarker': 'string', 'Contents': [ { 'Key': 'string', 'LastModified': datetime(2015, 1, 1), 'ETag': 'string', 'ChecksumAlgorithm': [ 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ], 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'Size': 123, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'RestoreStatus': { 'IsRestoreInProgress': True|False, 'RestoreExpiryDate': datetime(2015, 1, 1) } }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria. * **Marker** *(string) --* Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request. * **NextMarker** *(string) --* When the response is truncated (the "IsTruncated" element value in the response is "true"), you can use the key name in this field as the "marker" parameter in the subsequent request to get the next set of objects. Amazon S3 lists objects in alphabetical order. Note: This element is returned only if you have the "delimiter" request parameter specified. If the response does not include the "NextMarker" element and it is truncated, you can use the value of the last "Key" element in the response as the "marker" parameter in the subsequent request to get the next set of object keys. * **Contents** *(list) --* Metadata about each object returned. * *(dict) --* An object consists of data and its descriptive metadata. * **Key** *(string) --* The name that you assign to an object. You use the object key to retrieve the object. * **LastModified** *(datetime) --* Creation date of the object. * **ETag** *(string) --* The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below: * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data. * Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE- KMS, have ETags that are not an MD5 digest of their object data. * If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest. Note: **Directory buckets** - MD5 is not supported by directory buckets. * **ChecksumAlgorithm** *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Size** *(integer) --* Size in bytes of the object * **StorageClass** *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **Owner** *(dict) --* The owner of the object Note: **Directory buckets** - The bucket owner is returned as the object owner. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **RestoreStatus** *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" * **Name** *(string) --* The bucket name. * **Prefix** *(string) --* Keys that begin with the indicated prefix. * **Delimiter** *(string) --* Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the "CommonPrefixes" collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the "MaxKeys" value. * **MaxKeys** *(integer) --* The maximum number of keys returned in the response body. * **CommonPrefixes** *(list) --* All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number of returns. A response can contain "CommonPrefixes" only if you specify a delimiter. "CommonPrefixes" contains all (if there are any) keys between "Prefix" and the next occurrence of the string specified by the delimiter. "CommonPrefixes" lists keys that act like subdirectories in the directory specified by "Prefix". For example, if the prefix is "notes/" and the delimiter is a slash ( "/"), as in "notes/summer/july", the common prefix is "notes/summer/". All of the keys that roll up into a common prefix count as a single return when calculating the number of returns. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent- encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchBucket" **Examples** The following example list two objects in a bucket. response = client.list_objects( Bucket='examplebucket', MaxKeys='2', ) print(response) Expected Output: { 'Contents': [ { 'ETag': '"70ee1738b6b21e2c8a43f3a5ab0eee71"', 'Key': 'example1.jpg', 'LastModified': datetime(2014, 11, 21, 19, 40, 5, 4, 325, 0), 'Owner': { 'DisplayName': 'myname', 'ID': '12345example25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Size': 11, 'StorageClass': 'STANDARD', }, { 'ETag': '"9c8af9a76df052144598c115ef33e511"', 'Key': 'example2.jpg', 'LastModified': datetime(2013, 11, 15, 1, 10, 49, 4, 319, 0), 'Owner': { 'DisplayName': 'myname', 'ID': '12345example25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Size': 713193, 'StorageClass': 'STANDARD', }, ], 'NextMarker': 'eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyfQ==', 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_objects delete_objects ************** S3.Client.delete_objects(**kwargs) This operation enables you to delete multiple objects from a bucket using a single HTTP request. If you know the object keys that you want to delete, then this operation provides a suitable alternative to sending individual delete requests, reducing per-request overhead. The request can contain a list of up to 1,000 keys that you want to delete. In the XML, you provide the object key names, and optionally, version IDs if you want to delete a specific version of the object from a versioning-enabled bucket. For each key, Amazon S3 performs a delete operation and returns the result of that delete, success or failure, in the response. If the object specified in the request isn't found, Amazon S3 confirms the deletion by returning the result as deleted. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. The operation supports two modes for the response: verbose and quiet. By default, the operation uses verbose mode in which the response includes the result of deletion of each key in your request. In quiet mode the response includes only keys where the delete operation encountered an error. For a successful deletion in a quiet mode, the operation does not return any information about the delete in the response body. When performing this action on an MFA Delete enabled bucket, that attempts to delete any versioned objects, you must include an MFA token. If you do not provide one, the entire request will fail, even if there are non-versioned objects you are trying to delete. If you provide an invalid token, whether there are versioned keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: **Directory buckets** - MFA delete is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always specify the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must specify the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Content-MD5 request header * **General purpose bucket** - The Content-MD5 request header is required for all Multi-Object Delete requests. Amazon S3 uses the header value to ensure that your request body has not been altered in transit. * **Directory bucket** - The Content-MD5 request header or a additional checksum request header (including "x-amz-checksum- crc32", "x-amz-checksum-crc32c", "x-amz-checksum-sha1", or "x -amz-checksum-sha256") is required for all Multi-Object Delete requests. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "DeleteObjects": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * AbortMultipartUpload See also: AWS API Documentation **Request Syntax** response = client.delete_objects( Bucket='string', Delete={ 'Objects': [ { 'Key': 'string', 'VersionId': 'string', 'ETag': 'string', 'LastModifiedTime': datetime(2015, 1, 1), 'Size': 123 }, ], 'Quiet': True|False }, MFA='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the objects to delete. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delete** (*dict*) -- **[REQUIRED]** Container for the request. * **Objects** *(list) --* **[REQUIRED]** The object to delete. Note: **Directory buckets** - For directory buckets, an object that's composed entirely of whitespace characters is not supported by the "DeleteObjects" API operation. The request will receive a "400 Bad Request" error and none of the objects in the request will be deleted. * *(dict) --* Object Identifier is unique value to identify objects. * **Key** *(string) --* **[REQUIRED]** Key name of the object. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **VersionId** *(string) --* Version ID for the specific version of the object to delete. Note: This functionality is not supported for directory buckets. * **ETag** *(string) --* An entity tag (ETag) is an identifier assigned by a web server to a specific version of a resource found at a URL. This header field makes the request method conditional on "ETags". Note: Entity tags (ETags) for S3 Express One Zone are random alphanumeric strings unique to the object. * **LastModifiedTime** *(datetime) --* If present, the objects are deleted only if its modification times matches the provided "Timestamp". Note: This functionality is only supported for directory buckets. * **Size** *(integer) --* If present, the objects are deleted only if its size matches the provided size in bytes. Note: This functionality is only supported for directory buckets. * **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. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. When performing the "DeleteObjects" operation on an MFA delete enabled bucket, which attempts to delete the specified versioned objects, you must include an MFA token. If you don't provide an MFA token, the entire request will fail, even if there are non-versioned objects that you are trying to delete. If you provide an invalid token, whether there are versioned object keys in the request or not, the entire Multi-Object Delete request will fail. For information about MFA Delete, see MFA Delete in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Specifies whether you want to delete this object even if it has a Governance-type Object Lock in place. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Return type: dict Returns: **Response Syntax** { 'Deleted': [ { 'Key': 'string', 'VersionId': 'string', 'DeleteMarker': True|False, 'DeleteMarkerVersionId': 'string' }, ], 'RequestCharged': 'requester', 'Errors': [ { 'Key': 'string', 'VersionId': 'string', 'Code': 'string', 'Message': 'string' }, ] } **Response Structure** * *(dict) --* * **Deleted** *(list) --* Container element for a successful delete. It identifies the object that was successfully deleted. * *(dict) --* Information about the deleted object. * **Key** *(string) --* The name of the deleted object. * **VersionId** *(string) --* The version ID of the deleted object. Note: This functionality is not supported for directory buckets. * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **DeleteMarkerVersionId** *(string) --* The version ID of the delete marker created as a result of the DELETE operation. If you delete a specific object version, the value returned by this header is the version ID of the object version deleted. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **Errors** *(list) --* Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered. * *(dict) --* Container for all error elements. * **Key** *(string) --* The error key. * **VersionId** *(string) --* The version ID of the error. Note: This functionality is not supported for directory buckets. * **Code** *(string) --* The error code is a string that uniquely identifies an error condition. It is meant to be read and understood by programs that detect and handle errors by type. The following is a list of Amazon S3 error codes. For more information, see Error responses. * * *Code:* AccessDenied * *Description:* Access Denied * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AccountProblem * *Description:* There is a problem with your Amazon Web Services account that prevents the action from completing successfully. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AllAccessDisabled * *Description:* All access to this Amazon S3 resource has been disabled. Contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* AmbiguousGrantByEmailAddress * *Description:* The email address you provided is associated with more than one account. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* AuthorizationHeaderMalformed * *Description:* The authorization header you provided is invalid. * *HTTP Status Code:* 400 Bad Request * *HTTP Status Code:* N/A * * *Code:* BadDigest * *Description:* The Content-MD5 you specified did not match what we received. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyExists * *Description:* The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* BucketAlreadyOwnedByYou * *Description:* The bucket you tried to create already exists, and you own it. Amazon S3 returns this error in all Amazon Web Services Regions except in the North Virginia Region. For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region, Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs). * *Code:* 409 Conflict (in all Regions except the North Virginia Region) * *SOAP Fault Code Prefix:* Client * * *Code:* BucketNotEmpty * *Description:* The bucket you tried to delete is not empty. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* CredentialsNotSupported * *Description:* This request does not support credentials. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* CrossLocationLoggingProhibited * *Description:* Cross-location logging not allowed. Buckets in one geographic location cannot log information to a bucket in another location. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooSmall * *Description:* Your proposed upload is smaller than the minimum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* EntityTooLarge * *Description:* Your proposed upload exceeds the maximum allowed object size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* ExpiredToken * *Description:* The provided token has expired. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IllegalVersioningConfigurationException * *Description:* Indicates that the versioning configuration specified in the request is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncompleteBody * *Description:* You did not provide the number of bytes specified by the Content-Length HTTP header * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* IncorrectNumberOfFilesInPostRequest * *Description:* POST requires exactly one file upload per request. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InlineDataTooLarge * *Description:* Inline data exceeds the maximum allowed size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InternalError * *Description:* We encountered an internal error. Please try again. * *HTTP Status Code:* 500 Internal Server Error * *SOAP Fault Code Prefix:* Server * * *Code:* InvalidAccessKeyId * *Description:* The Amazon Web Services access key ID you provided does not exist in our records. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidAddressingHeader * *Description:* You must specify the Anonymous role. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidArgument * *Description:* Invalid Argument * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketName * *Description:* The specified bucket is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidBucketState * *Description:* The request is not valid with the current state of the bucket. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidDigest * *Description:* The Content-MD5 you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidEncryptionAlgorithmError * *Description:* The encryption request you specified is not valid. The valid value is AES256. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidLocationConstraint * *Description:* The specified location constraint is not valid. For more information about Regions, see How to Select a Region for Your Buckets. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidObjectState * *Description:* The action is not valid for the current state of the object. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPart * *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. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPartOrder * *Description:* The list of parts was not in ascending order. Parts list must be specified in order by part number. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPayer * *Description:* All access to this object has been disabled. Please contact Amazon Web Services Support for further assistance. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidPolicyDocument * *Description:* The content of the form does not meet the conditions specified in the policy document. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRange * *Description:* The requested range cannot be satisfied. * *HTTP Status Code:* 416 Requested Range Not Satisfiable * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Please use "AWS4-HMAC-SHA256". * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* SOAP requests must be made over an HTTPS connection. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with non-DNS compliant names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported for buckets with periods (.) in their names. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate endpoint only supports virtual style requests. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is not configured on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Accelerate is disabled on this bucket. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration is not supported on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidRequest * *Description:* Amazon S3 Transfer Acceleration cannot be enabled on this bucket. Contact Amazon Web Services Support for more information. * *HTTP Status Code:* 400 Bad Request * *Code:* N/A * * *Code:* InvalidSecurity * *Description:* The provided security credentials are not valid. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidSOAPRequest * *Description:* The SOAP request body is invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidStorageClass * *Description:* The storage class you specified is not valid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidTargetBucketForLogging * *Description:* The target bucket for logging does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidToken * *Description:* The provided token is malformed or otherwise invalid. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* InvalidURI * *Description:* Couldn't parse the specified URI. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* KeyTooLongError * *Description:* Your key is too long. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedACLError * *Description:* The XML you provided was not well- formed or did not validate against our published schema. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedPOSTRequest * *Description:* The body of your POST request is not well-formed multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MalformedXML * *Description:* This happens when the user sends malformed XML (XML that doesn't conform to the published XSD) for the configuration. The error message is, "The XML you provided was not well- formed or did not validate against our published schema." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxMessageLengthExceeded * *Description:* Your request was too big. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MaxPostPreDataLengthExceededError * *Description:* Your POST request fields preceding the upload file were too large. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MetadataTooLarge * *Description:* Your metadata headers exceed the maximum allowed metadata size. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MethodNotAllowed * *Description:* The specified method is not allowed against this resource. * *HTTP Status Code:* 405 Method Not Allowed * *SOAP Fault Code Prefix:* Client * * *Code:* MissingAttachment * *Description:* A SOAP attachment was expected, but none were found. * *HTTP Status Code:* N/A * *SOAP Fault Code Prefix:* Client * * *Code:* MissingContentLength * *Description:* You must provide the Content-Length HTTP header. * *HTTP Status Code:* 411 Length Required * *SOAP Fault Code Prefix:* Client * * *Code:* MissingRequestBodyError * *Description:* This happens when the user sends an empty XML document as a request. The error message is, "Request body is empty." * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityElement * *Description:* The SOAP 1.1 request is missing a security element. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* MissingSecurityHeader * *Description:* Your request is missing a required header. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoLoggingStatusForKey * *Description:* There is no such thing as a logging status subresource for a key. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucket * *Description:* The specified bucket does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchBucketPolicy * *Description:* The specified bucket does not have a bucket policy. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchKey * *Description:* The specified key does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchLifecycleConfiguration * *Description:* The lifecycle configuration does not exist. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchUpload * *Description:* The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NoSuchVersion * *Description:* Indicates that the version ID specified in the request does not match an existing version. * *HTTP Status Code:* 404 Not Found * *SOAP Fault Code Prefix:* Client * * *Code:* NotImplemented * *Description:* A header you provided implies functionality that is not implemented. * *HTTP Status Code:* 501 Not Implemented * *SOAP Fault Code Prefix:* Server * * *Code:* NotSignedUp * *Description:* Your account is not signed up for the Amazon S3 service. You must sign up before you can use Amazon S3. You can sign up at the following URL: Amazon S3 * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* OperationAborted * *Description:* A conflicting conditional action is currently in progress against this resource. Try again. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* PermanentRedirect * *Description:* The bucket you are attempting to access must be addressed using the specified endpoint. Send all future requests to this endpoint. * *HTTP Status Code:* 301 Moved Permanently * *SOAP Fault Code Prefix:* Client * * *Code:* PreconditionFailed * *Description:* At least one of the preconditions you specified did not hold. * *HTTP Status Code:* 412 Precondition Failed * *SOAP Fault Code Prefix:* Client * * *Code:* Redirect * *Description:* Temporary redirect. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* RestoreAlreadyInProgress * *Description:* Object restore is already in progress. * *HTTP Status Code:* 409 Conflict * *SOAP Fault Code Prefix:* Client * * *Code:* RequestIsNotMultiPartContent * *Description:* Bucket POST must be of the enclosure- type multipart/form-data. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeout * *Description:* Your socket connection to the server was not read from or written to within the timeout period. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTimeTooSkewed * *Description:* The difference between the request time and the server's time is too large. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* RequestTorrentOfBucketError * *Description:* Requesting the torrent file of a bucket is not permitted. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* SignatureDoesNotMatch * *Description:* The request signature we calculated does not match the signature you provided. Check your Amazon Web Services secret access key and signing method. For more information, see REST Authentication and SOAP Authentication for details. * *HTTP Status Code:* 403 Forbidden * *SOAP Fault Code Prefix:* Client * * *Code:* ServiceUnavailable * *Description:* Service is unable to handle request. * *HTTP Status Code:* 503 Service Unavailable * *SOAP Fault Code Prefix:* Server * * *Code:* SlowDown * *Description:* Reduce your request rate. * *HTTP Status Code:* 503 Slow Down * *SOAP Fault Code Prefix:* Server * * *Code:* TemporaryRedirect * *Description:* You are being redirected to the bucket while DNS updates. * *HTTP Status Code:* 307 Moved Temporarily * *SOAP Fault Code Prefix:* Client * * *Code:* TokenRefreshRequired * *Description:* The provided token must be refreshed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* TooManyBuckets * *Description:* You have attempted to create more buckets than allowed. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnexpectedContent * *Description:* This request does not support content. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UnresolvableGrantByEmailAddress * *Description:* The email address you provided does not match any account on record. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * * *Code:* UserKeyMustBeSpecified * *Description:* The bucket POST must contain the specified field name. If it is specified, check the order of the fields. * *HTTP Status Code:* 400 Bad Request * *SOAP Fault Code Prefix:* Client * **Message** *(string) --* The error message contains a generic description of the error condition in English. It is intended for a human audience. Simple programs display the message directly to the end user if they encounter an error condition they don't know how or don't care to handle. Sophisticated programs with more exhaustive error handling and proper internationalization are more likely to ignore the error message. **Examples** The following example deletes objects from a bucket. The request specifies object versions. S3 deletes specific object versions and returns the key and versions of deleted objects in the response. response = client.delete_objects( Bucket='examplebucket', Delete={ 'Objects': [ { 'Key': 'HappyFace.jpg', 'VersionId': '2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b', }, { 'Key': 'HappyFace.jpg', 'VersionId': 'yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd', }, ], 'Quiet': False, }, ) print(response) Expected Output: { 'Deleted': [ { 'Key': 'HappyFace.jpg', 'VersionId': 'yoz3HB.ZhCS_tKVEmIOr7qYyyAaZSKVd', }, { 'Key': 'HappyFace.jpg', 'VersionId': '2LWg7lQLnY41.maGB5Z6SWW.dcq0vx7b', }, ], 'ResponseMetadata': { '...': '...', }, } The following example deletes objects from a bucket. The bucket is versioned, and the request does not specify the object version to delete. In this case, all versions remain in the bucket and S3 adds a delete marker. response = client.delete_objects( Bucket='examplebucket', Delete={ 'Objects': [ { 'Key': 'objectkey1', }, { 'Key': 'objectkey2', }, ], 'Quiet': False, }, ) print(response) Expected Output: { 'Deleted': [ { 'DeleteMarker': 'true', 'DeleteMarkerVersionId': 'A._w1z6EFiCF5uhtQMDal9JDkID9tQ7F', 'Key': 'objectkey1', }, { 'DeleteMarker': 'true', 'DeleteMarkerVersionId': 'iOd_ORxhkKe_e8G8_oSGxt2PjsCZKlkt', 'Key': 'objectkey2', }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_public_access_block delete_public_access_block ************************** S3.Client.delete_public_access_block(**kwargs) Note: This operation is not supported for directory buckets. Removes the "PublicAccessBlock" configuration for an Amazon S3 bucket. To use this operation, you must have the "s3:PutBucketPublicAccessBlock" permission. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. The following operations are related to "DeletePublicAccessBlock": * Using Amazon S3 Block Public Access * GetPublicAccessBlock * PutPublicAccessBlock * GetBucketPolicyStatus See also: AWS API Documentation **Request Syntax** response = client.delete_public_access_block( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The Amazon S3 bucket whose "PublicAccessBlock" configuration you want to delete. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / put_object_lock_configuration put_object_lock_configuration ***************************** S3.Client.put_object_lock_configuration(**kwargs) Note: This operation is not supported for directory buckets. Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects. Note: * The "DefaultRetention" settings require both a mode and a period. * The "DefaultRetention" period can be either "Days" or "Years" but you must select one. You cannot specify "Days" and "Years" at the same time. * You can enable Object Lock for new or existing buckets. For more information, see Configuring Object Lock. See also: AWS API Documentation **Request Syntax** response = client.put_object_lock_configuration( Bucket='string', ObjectLockConfiguration={ 'ObjectLockEnabled': 'Enabled', 'Rule': { 'DefaultRetention': { 'Mode': 'GOVERNANCE'|'COMPLIANCE', 'Days': 123, 'Years': 123 } } }, RequestPayer='requester', Token='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket whose Object Lock configuration you want to create or replace. * **ObjectLockConfiguration** (*dict*) -- The Object Lock configuration that you want to apply to the specified bucket. * **ObjectLockEnabled** *(string) --* Indicates whether this bucket has an Object Lock configuration enabled. Enable "ObjectLockEnabled" when you apply "ObjectLockConfiguration" to a bucket. * **Rule** *(dict) --* Specifies the Object Lock rule for the specified object. Enable the this rule when you apply "ObjectLockConfiguration" to a bucket. Bucket settings require both a mode and a period. The period can be either "Days" or "Years" but you must select one. You cannot specify "Days" and "Years" at the same time. * **DefaultRetention** *(dict) --* The default Object Lock retention mode and period that you want to apply to new objects placed in the specified bucket. Bucket settings require both a mode and a period. The period can be either "Days" or "Years" but you must select one. You cannot specify "Days" and "Years" at the same time. * **Mode** *(string) --* The default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Must be used with either "Days" or "Years". * **Days** *(integer) --* The number of days that you want to specify for the default retention period. Must be used with "Mode". * **Years** *(integer) --* The number of years that you want to specify for the default retention period. Must be used with "Mode". * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Token** (*string*) -- A token to allow Object Lock to be enabled for an existing bucket. * **ContentMD5** (*string*) -- The MD5 hash for the request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. S3 / Client / get_object_retention get_object_retention ******************** S3.Client.get_object_retention(**kwargs) Note: This operation is not supported for directory buckets. Retrieves an object's retention settings. For more information, see Locking Objects. This functionality is not supported for Amazon S3 on Outposts. The following action is related to "GetObjectRetention": * GetObjectAttributes See also: AWS API Documentation **Request Syntax** response = client.get_object_retention( Bucket='string', Key='string', VersionId='string', RequestPayer='requester', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object whose retention settings you want to retrieve. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The key name for the object whose retention settings you want to retrieve. * **VersionId** (*string*) -- The version ID for the object whose retention settings you want to retrieve. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Retention': { 'Mode': 'GOVERNANCE'|'COMPLIANCE', 'RetainUntilDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **Retention** *(dict) --* The container element for an object's retention settings. * **Mode** *(string) --* Indicates the Retention mode for the specified object. * **RetainUntilDate** *(datetime) --* The date on which this Object Lock Retention will expire. S3 / Client / get_bucket_encryption get_bucket_encryption ********************* S3.Client.get_bucket_encryption(**kwargs) Returns the default encryption configuration for an Amazon S3 bucket. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). Note: * **General purpose buckets** - For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. For information about the default encryption configuration in directory buckets, see Setting default server- side encryption behavior for directory buckets. Permissions * **General purpose bucket permissions** - The "s3:GetEncryptionConfiguration" permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Operations and Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:GetEncryptionConfiguration" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "GetBucketEncryption": * PutBucketEncryption * DeleteBucketEncryption See also: AWS API Documentation **Request Syntax** response = client.get_bucket_encryption( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket from which the server-side encryption configuration is retrieved. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Return type: dict Returns: **Response Syntax** { 'ServerSideEncryptionConfiguration': { 'Rules': [ { 'ApplyServerSideEncryptionByDefault': { 'SSEAlgorithm': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'KMSMasterKeyID': 'string' }, 'BucketKeyEnabled': True|False }, ] } } **Response Structure** * *(dict) --* * **ServerSideEncryptionConfiguration** *(dict) --* Specifies the default server-side-encryption configuration. * **Rules** *(list) --* Container for information about a particular server-side encryption configuration rule. * *(dict) --* Specifies the default server-side encryption configuration. Note: * **General purpose buckets** - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. * **Directory buckets** - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported. * **ApplyServerSideEncryptionByDefault** *(dict) --* Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. * **SSEAlgorithm** *(string) --* Server-side encryption algorithm to use for the default encryption. Note: For directory buckets, there are only two supported values for server-side encryption: "AES256" and "aws:kms". * **KMSMasterKeyID** *(string) --* Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption. Note: * **General purpose buckets** - This parameter is allowed if and only if "SSEAlgorithm" is set to "aws:kms" or "aws:kms:dsse". * **Directory buckets** - This parameter is allowed if and only if "SSEAlgorithm" is set to "aws:kms". You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. * Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" * Key ARN: "arn:aws:kms:us-east-2:111122223333:key /1234abcd-12ab-34cd-56ef-1234567890ab" * Key Alias: "alias/alias-name" If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations. Note: * **General purpose buckets** - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. * **Directory buckets** - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Warning: Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the *Amazon Web Services Key Management Service Developer Guide*. * **BucketKeyEnabled** *(boolean) --* Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the "BucketKeyEnabled" element to "true" causes Amazon S3 to use an S3 Bucket Key. Note: * **General purpose buckets** - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the *Amazon S3 User Guide*. * **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS- encrypted object. S3 / Client / put_object_legal_hold put_object_legal_hold ********************* S3.Client.put_object_legal_hold(**kwargs) Note: This operation is not supported for directory buckets. Applies a legal hold configuration to the specified object. For more information, see Locking Objects. This functionality is not supported for Amazon S3 on Outposts. See also: AWS API Documentation **Request Syntax** response = client.put_object_legal_hold( Bucket='string', Key='string', LegalHold={ 'Status': 'ON'|'OFF' }, RequestPayer='requester', VersionId='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object that you want to place a legal hold on. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The key name for the object that you want to place a legal hold on. * **LegalHold** (*dict*) -- Container element for the legal hold configuration you want to apply to the specified object. * **Status** *(string) --* Indicates whether the specified object has a legal hold in place. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- The version ID of the object that you want to place a legal hold on. * **ContentMD5** (*string*) -- The MD5 hash for the request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. S3 / Client / upload_fileobj upload_fileobj ************** S3.Client.upload_fileobj(Fileobj, Bucket, Key, ExtraArgs=None, Callback=None, Config=None) Upload a file-like object to S3. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart upload in multiple threads if necessary. Usage: import boto3 s3 = boto3.client('s3') with open('filename', 'rb') as data: s3.upload_fileobj(data, 'amzn-s3-demo-bucket', 'mykey') Parameters: * **Fileobj** (*a file-like object*) -- A file-like object to upload. At a minimum, it must implement the *read* method, and must return bytes. * **Bucket** (*str*) -- The name of the bucket to upload to. * **Key** (*str*) -- The name of the key to upload to. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed upload arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_UPLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the upload. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the upload. S3 / Client / put_bucket_intelligent_tiering_configuration put_bucket_intelligent_tiering_configuration ******************************************** S3.Client.put_bucket_intelligent_tiering_configuration(**kwargs) Note: This operation is not supported for directory buckets. Puts a S3 Intelligent-Tiering configuration to the specified bucket. You can have up to 1,000 S3 Intelligent-Tiering configurations per bucket. The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost- effective storage access tier, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings in three low latency and high throughput access tiers. To get the lowest storage cost on data that can be accessed in minutes to hours, you can choose to activate additional archiving capabilities. The S3 Intelligent-Tiering storage class is the ideal storage class for data with unknown, changing, or unpredictable access patterns, independent of object size or retention period. If the size of an object is less than 128 KB, it is not monitored and not eligible for auto-tiering. Smaller objects can be stored, but they are always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering storage class. For more information, see Storage class for automatically optimizing frequently and infrequently accessed objects. Operations related to "PutBucketIntelligentTieringConfiguration" include: * DeleteBucketIntelligentTieringConfiguration * GetBucketIntelligentTieringConfiguration * ListBucketIntelligentTieringConfigurations Note: You only need S3 Intelligent-Tiering enabled on a bucket if you want to automatically move objects stored in the S3 Intelligent- Tiering storage class to the Archive Access or Deep Archive Access tier. "PutBucketIntelligentTieringConfiguration" has the following special errors: HTTP 400 Bad Request Error *Code:* InvalidArgument *Cause:* Invalid Argument HTTP 400 Bad Request Error *Code:* TooManyConfigurations *Cause:* You are attempting to create a new configuration but have already reached the 1,000-configuration limit. HTTP 403 Forbidden Error *Cause:* You are not the owner of the specified bucket, or you do not have the "s3:PutIntelligentTieringConfiguration" bucket permission to set the configuration on the bucket. See also: AWS API Documentation **Request Syntax** response = client.put_bucket_intelligent_tiering_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string', IntelligentTieringConfiguration={ 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'Status': 'Enabled'|'Disabled', 'Tierings': [ { 'Days': 123, 'AccessTier': 'ARCHIVE_ACCESS'|'DEEP_ARCHIVE_ACCESS' }, ] } ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose configuration you want to modify or retrieve. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the S3 Intelligent-Tiering configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IntelligentTieringConfiguration** (*dict*) -- **[REQUIRED]** Container for S3 Intelligent-Tiering configuration. * **Id** *(string) --* **[REQUIRED]** The ID used to identify the S3 Intelligent-Tiering configuration. * **Filter** *(dict) --* Specifies a bucket filter. The configuration only includes objects that meet the filter's criteria. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Tag** *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating a metrics filter. The operator must have at least two predicates, and an object must match all of the predicates in order for the filter to apply. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects to which the configuration applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the configuration to apply. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **Status** *(string) --* **[REQUIRED]** Specifies the status of the configuration. * **Tierings** *(list) --* **[REQUIRED]** Specifies the S3 Intelligent-Tiering storage class tier of the configuration. * *(dict) --* The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead. * **Days** *(integer) --* **[REQUIRED]** The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding tier. The minimum number of days specified for Archive Access tier must be at least 90 days and Deep Archive Access tier must be at least 180 days. The maximum can be up to 2 years (730 days). * **AccessTier** *(string) --* **[REQUIRED]** S3 Intelligent-Tiering access tier. See Storage class for automatically optimizing frequently and infrequently accessed objects for a list of access tiers in the S3 Intelligent-Tiering storage class. Returns: None S3 / Client / put_bucket_ownership_controls put_bucket_ownership_controls ***************************** S3.Client.put_bucket_ownership_controls(**kwargs) Note: This operation is not supported for directory buckets. Creates or modifies "OwnershipControls" for an Amazon S3 bucket. To use this operation, you must have the "s3:PutBucketOwnershipControls" permission. For more information about Amazon S3 permissions, see Specifying permissions in a policy. For information about Amazon S3 Object Ownership, see Using object ownership. The following operations are related to "PutBucketOwnershipControls": * GetBucketOwnershipControls * DeleteBucketOwnershipControls See also: AWS API Documentation **Request Syntax** response = client.put_bucket_ownership_controls( Bucket='string', ContentMD5='string', ExpectedBucketOwner='string', OwnershipControls={ 'Rules': [ { 'ObjectOwnership': 'BucketOwnerPreferred'|'ObjectWriter'|'BucketOwnerEnforced' }, ] }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose "OwnershipControls" you want to set. * **ContentMD5** (*string*) -- The MD5 hash of the "OwnershipControls" request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **OwnershipControls** (*dict*) -- **[REQUIRED]** The "OwnershipControls" (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) that you want to apply to this Amazon S3 bucket. * **Rules** *(list) --* **[REQUIRED]** The container element for an ownership control rule. * *(dict) --* The container element for an ownership control rule. * **ObjectOwnership** *(string) --* **[REQUIRED]** The container element for object ownership for a bucket's ownership controls. "BucketOwnerPreferred" - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the "bucket-owner-full-control" canned ACL. "ObjectWriter" - The uploading account will own the object if the object is uploaded with the "bucket-owner- full-control" canned ACL. "BucketOwnerEnforced" - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or specify bucket owner full control ACLs (such as the predefined "bucket- owner-full-control" canned ACL or a custom ACL in XML format that grants the same permissions). By default, "ObjectOwnership" is set to "BucketOwnerEnforced" and ACLs are disabled. We recommend keeping ACLs disabled, except in uncommon use cases where you must control access for each object individually. For more information about S3 Object Ownership, see Controlling ownership of objects and disabling ACLs for your bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Directory buckets use the bucket owner enforced setting for S3 Object Ownership. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Returns: None S3 / Client / copy copy **** S3.Client.copy(CopySource, Bucket, Key, ExtraArgs=None, Callback=None, SourceClient=None, Config=None) Copy an object from one S3 location to another. This is a managed transfer which will perform a multipart copy in multiple threads if necessary. Usage: import boto3 s3 = boto3.resource('s3') copy_source = { 'Bucket': 'amzn-s3-demo-bucket1', 'Key': 'mykey' } s3.meta.client.copy(copy_source, 'amzn-s3-demo-bucket2', 'otherkey') Parameters: * **CopySource** (*dict*) -- The name of the source bucket, key name of the source object, and optional version ID of the source object. The dictionary format is: "{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}". Note that the "VersionId" key is optional and may be omitted. * **Bucket** (*str*) -- The name of the bucket to copy to * **Key** (*str*) -- The name of the key to copy to * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the copy. * **SourceClient** (*botocore** or **boto3 Client*) -- The client to be used for operation that may happen at the source object. For example, this client is used for the head_object that determines the size of the copy. If no client is provided, the current client is used as the client for the source object. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the copy. S3 / Client / generate_presigned_post generate_presigned_post *********************** S3.Client.generate_presigned_post(Bucket, Key, Fields=None, Conditions=None, ExpiresIn=3600) Builds the url and the form fields used for a presigned s3 post Parameters: * **Bucket** (*string*) -- The name of the bucket to presign the post to. Note that bucket related conditions should not be included in the "conditions" parameter. * **Key** (*string*) -- Key name, optionally add ${filename} to the end to attach the submitted filename. Note that key related conditions and fields are filled out for you and should not be included in the "Fields" or "Conditions" parameter. * **Fields** (*dict*) -- A dictionary of prefilled form fields to build on top of. Elements that may be included are acl, Cache-Control, Content- Type, Content-Disposition, Content-Encoding, Expires, success_action_redirect, redirect, success_action_status, and x-amz-meta-. Note that if a particular element is included in the fields dictionary it will not be automatically added to the conditions list. You must specify a condition for the element as well. * **Conditions** (*list*) -- A list of conditions to include in the policy. Each element can be either a list or a structure. For example: [ {"acl": "public-read"}, ["content-length-range", 2, 5], ["starts-with", "$success_action_redirect", ""] ] Conditions that are included may pertain to acl, content- length-range, Cache-Control, Content-Type, Content- Disposition, Content-Encoding, Expires, success_action_redirect, redirect, success_action_status, and/or x-amz-meta-. Note that if you include a condition, you must specify a valid value in the fields dictionary as well. A value will not be added automatically to the fields dictionary based on the conditions. * **ExpiresIn** (*int*) -- The number of seconds the presigned post is valid for. Return type: dict Returns: A dictionary with two elements: "url" and "fields". Url is the url to post to. Fields is a dictionary filled with the form fields and respective values to use when submitting the post. For example: { 'url': 'https://amzn-s3-demo-bucket.s3.amazonaws.com', 'fields': { 'acl': 'public-read', 'key': 'mykey', 'signature': 'mysignature', 'policy': 'mybase64 encoded policy' } } S3 / Client / get_public_access_block get_public_access_block *********************** S3.Client.get_public_access_block(**kwargs) Note: This operation is not supported for directory buckets. Retrieves the "PublicAccessBlock" configuration for an Amazon S3 bucket. To use this operation, you must have the "s3:GetBucketPublicAccessBlock" permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. Warning: When Amazon S3 evaluates the "PublicAccessBlock" configuration for a bucket or an object, it checks the "PublicAccessBlock" configuration for both the bucket (or the bucket that contains the object) and the bucket owner's account. If the "PublicAccessBlock" settings are different between the bucket and the account, Amazon S3 uses the most restrictive combination of the bucket-level and account-level settings. For more information about when Amazon S3 considers a bucket or an object public, see The Meaning of "Public". The following operations are related to "GetPublicAccessBlock": * Using Amazon S3 Block Public Access * PutPublicAccessBlock * GetPublicAccessBlock * DeletePublicAccessBlock See also: AWS API Documentation **Request Syntax** response = client.get_public_access_block( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose "PublicAccessBlock" configuration you want to retrieve. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'PublicAccessBlockConfiguration': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False } } **Response Structure** * *(dict) --* * **PublicAccessBlockConfiguration** *(dict) --* The "PublicAccessBlock" configuration currently in effect for this Amazon S3 bucket. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket. Setting this element to "TRUE" causes the following behavior: * PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on this bucket and objects in this bucket. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for this bucket. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for this bucket. Setting this element to "TRUE" restricts access to this bucket to only Amazon Web Services service principals and authorized users within this account if the bucket has a public policy. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. S3 / Client / delete_bucket_encryption delete_bucket_encryption ************************ S3.Client.delete_bucket_encryption(**kwargs) This implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). Note: * **General purpose buckets** - For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. For information about the default encryption configuration in directory buckets, see Setting default server- side encryption behavior for directory buckets. Permissions * **General purpose bucket permissions** - The "s3:PutEncryptionConfiguration" permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Operations and Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:PutEncryptionConfiguration" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "DeleteBucketEncryption": * PutBucketEncryption * GetBucketEncryption See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_encryption( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the server-side encryption configuration to delete. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None S3 / Client / delete_bucket_replication delete_bucket_replication ************************* S3.Client.delete_bucket_replication(**kwargs) Note: This operation is not supported for directory buckets. Deletes the replication configuration from the bucket. To use this operation, you must have permissions to perform the "s3:PutReplicationConfiguration" action. The bucket owner has these permissions by default and can grant it to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. Note: It can take a while for the deletion of a replication configuration to fully propagate. For information about replication configuration, see Replication in the *Amazon S3 User Guide*. The following operations are related to "DeleteBucketReplication": * PutBucketReplication * GetBucketReplication See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_replication( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example deletes replication configuration set on bucket. response = client.delete_bucket_replication( Bucket='example', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / close close ***** S3.Client.close() Closes underlying endpoint connections. S3 / Client / put_object put_object ********** S3.Client.put_object(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Adds an object to a bucket. Note: * Amazon S3 never adds partial objects; if you receive a success response, Amazon S3 added the entire object to the bucket. You cannot use "PutObject" to only update a single piece of metadata for an existing object. You must put the entire object with updated metadata if you want to update some values. * If your bucket uses the bucket owner enforced setting for Object Ownership, ACLs are disabled and no longer affect permissions. All objects written to the bucket by any account will be owned by the bucket owner. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Amazon S3 is a distributed system. If it receives multiple write requests for the same object simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior: * **S3 Object Lock** - To prevent objects from being deleted or overwritten, you can use Amazon S3 Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **If-None-Match** - Uploads the object only if the object key name does not already exist in the specified bucket. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload, S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure, retry the upload. Expects the * character (asterisk). For more information, see Add preconditions to S3 operations with conditional requests in the *Amazon S3 User Guide* or RFC 7232. Note: This functionality is not supported for S3 on Outposts. * **S3 Versioning** - When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all versions of the objects. For each write request that is made to the same object, Amazon S3 automatically generates a unique version ID of that object being stored in Amazon S3. You can retrieve, replace, or delete any version of the object. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "PutObject" request includes specific headers. * "s3:PutObject" - To successfully complete the "PutObject" request, you must always have the "s3:PutObject" permission on a bucket to add an object to it. * "s3:PutObjectAcl" - To successfully change the objects ACL of your "PutObject" request, you must have the "s3:PutObjectAcl". * "s3:PutObjectTagging" - To successfully set the tag-set with your "PutObject" request, you must have the "s3:PutObjectTagging". * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Data integrity with Content-MD5 * **General purpose bucket** - To ensure that data is not corrupted traversing the network, use the "Content-MD5" header. When you use this header, Amazon S3 checks the object against the provided MD5 value and, if they do not match, Amazon S3 returns an error. Alternatively, when the object's ETag is its MD5 digest, you can calculate the MD5 while putting the object to Amazon S3 and compare the returned ETag to the calculated MD5 value. * **Directory bucket** - This functionality is not supported for directory buckets. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". For more information about related Amazon S3 APIs, see the following: * CopyObject * DeleteObject See also: AWS API Documentation **Request Syntax** response = client.put_object( ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'aws-exec-read'|'bucket-owner-read'|'bucket-owner-full-control', Body=b'bytes'|file, Bucket='string', CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentLength=123, ContentMD5='string', ContentType='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', Expires=datetime(2015, 1, 1), IfMatch='string', IfNoneMatch='string', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWriteACP='string', Key='string', WriteOffsetBytes=123, Metadata={ 'string': 'string' }, ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', WebsiteRedirectLocation='string', SSECustomerAlgorithm='string', SSECustomerKey='string', SSEKMSKeyId='string', SSEKMSEncryptionContext='string', BucketKeyEnabled=True|False, RequestPayer='requester', Tagging='string', ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockRetainUntilDate=datetime(2015, 1, 1), ObjectLockLegalHoldStatus='ON'|'OFF', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the object. For more information, see Canned ACL in the *Amazon S3 User Guide*. When adding a new object, you can use headers to grant ACL- based 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. By default, all objects are private. Only the owner has full access control. For more information, see Access Control List (ACL) Overview and Managing ACLs Using the REST API in the *Amazon S3 User Guide*. If the bucket that you're uploading 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 "bucket-owner-full-control" canned ACL or an equivalent form of this ACL expressed in the XML format. PUT requests that contain other ACLs (for example, custom grants to certain Amazon Web Services accounts) fail and return a "400" error with the error code "AccessControlListNotSupported". For more information, see Controlling ownership of objects and disabling ACLs in the *Amazon S3 User Guide*. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Body** (*bytes** or **seekable file-like object*) -- Object data. * **Bucket** (*string*) -- **[REQUIRED]** The bucket name to which the PUT action was initiated. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **CacheControl** (*string*) -- Can be used to specify caching behavior along the request/reply chain. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#se c14.9. * **ContentDisposition** (*string*) -- Specifies presentational information for the object. For more information, see https://www.rfc-editor.org/rfc/rfc6266#section-4. * **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. For more information, see https://www.rfc- editor.org/rfc/rfc9110.html#field.content-encoding. * **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. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content- length. * **ContentMD5** (*string*) -- The Base64 encoded 128-bit "MD5" digest of the message (without the headers) according to RFC 1864. This header can be used as a message integrity check to verify that the data is the same data that was originally sent. Although it is optional, we recommend using the Content-MD5 mechanism as an end-to-end integrity check. For more information about REST request authentication, see REST Authentication. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ContentType** (*string*) -- A standard MIME type describing the format of the contents. For more information, see https://www.rfc-editor.org/rfc/rfc9110.html#name-content-type. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. Note: The "Content-MD5" or "x-amz-sdk-checksum-algorithm" header is required for any request to upload an object with a retention period configured using Amazon S3 Object Lock. For more information, see Uploading objects to an Object Lock enabled bucket in the *Amazon S3 User Guide*. For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. For more information, see https://www.rfc-editor.org/rfc/rfc7234#section-5.3. * **IfMatch** (*string*) -- Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should fetch the object's ETag and retry the upload. Expects the ETag value as a string. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **IfNoneMatch** (*string*) -- Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should retry the upload. Expects the '*' (asterisk) character. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **GrantFullControl** (*string*) -- Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantRead** (*string*) -- Allows grantee to read the object data and its metadata. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantReadACP** (*string*) -- Allows grantee to read the object ACL. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable object. Note: * This functionality is not supported for directory buckets. * This functionality is not supported for Amazon S3 on Outposts. * **Key** (*string*) -- **[REQUIRED]** Object key for which the PUT action was initiated. * **WriteOffsetBytes** (*integer*) -- Specifies the offset for appending data to existing objects in bytes. The offset must be equal to the size of the existing object being appended to. If no object exists, setting this header to 0 will create a new object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm that was used when you store this object in Amazon S3 or Amazon FSx. * **General purpose buckets** - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer- provided keys (SSE-C). Amazon S3 encrypts data with server- side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE- KMS) ( "aws:kms"). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the "CreateSession" request. You can't override the values of the encryption settings ( "x-amz-server-side-encryption", "x -amz-server-side-encryption-aws-kms-key-id", "x-amz-server- side-encryption-context", and "x-amz-server-side-encryption- bucket-key-enabled") that are specified in the "CreateSession" request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the "CreateSession" request to protect new objects in the directory bucket. Note: When you use the CLI or the Amazon Web Services SDKs, for "CreateSession", the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the "CreateSession" request. It's not supported to override the encryption settings values in the "CreateSession" request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket. * **S3 access points for Amazon FSx** - When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". All Amazon FSx file systems have encryption configured by default and are encrypted at rest. Data is automatically encrypted before being written to the file system, and automatically decrypted as it is read. These processes are handled transparently by Amazon FSx. * **StorageClass** (*string*) -- By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the *Amazon S3 User Guide*. Note: * Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. * **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. For information about object metadata, see Object Key and Metadata in the *Amazon S3 User Guide*. In the following example, the request header sets the redirect to an object (anotherPage.html) in the same bucket: "x-amz-website-redirect-location: /anotherPage.html" In the following example, the request header sets the object redirect to another website: "x-amz-website-redirect-location: http://www.example.com/" For more information about website hosting in Amazon S3, see Hosting Websites on Amazon S3 and How to Configure Website Page Redirects in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, "AES256"). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **SSEKMSKeyId** (*string*) -- Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. **General purpose buckets** - If you specify "x-amz-server- side-encryption" with "aws:kms" or "aws:kms:dsse", this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify "x-amz-server-side- encryption:aws:kms" or "x-amz-server-side- encryption:aws:kms:dsse", but do not provide "x-amz-server- side-encryption-aws-kms-key-id", Amazon S3 uses the Amazon Web Services managed key ( "aws/s3") to protect the data. **Directory buckets** - To encrypt data using SSE-KMS, it's recommended to specify the "x-amz-server-side-encryption" header to "aws:kms". Then, the "x-amz-server-side-encryption- aws-kms-key-id" header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the "x-amz-server-side-encryption-aws-kms-key-id" header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. Incorrect key specification results in an HTTP "400 Bad Request" error. * **SSEKMSEncryptionContext** (*string*) -- Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key- value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. **General purpose buckets** - This value must be explicitly added during "CopyObject" operations if you want an additional encryption context for your object. For more information, see Encryption context in the *Amazon S3 User Guide*. **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported. * **BucketKeyEnabled** (*boolean*) -- Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). **General purpose buckets** - Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key. **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE- KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **Tagging** (*string*) -- The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1") Note: This functionality is not supported for directory buckets. * **ObjectLockMode** (*string*) -- The Object Lock mode that you want to apply to this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when you want this object's Object Lock to expire. Must be formatted as a timestamp parameter. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** (*string*) -- Specifies whether a legal hold will be applied to this object. For more information about S3 Object Lock, see Object Lock in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Expiration': 'string', 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'VersionId': 'string', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'SSEKMSEncryptionContext': 'string', 'BucketKeyEnabled': True|False, 'Size': 123, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Expiration** *(string) --* If the expiration is configured for the object (see PutBucketLifecycleConfiguration) in the *Amazon S3 User Guide*, the response includes this header. It includes the "expiry-date" and "rule-id" key-value pairs that provide information about object expiration. The value of the "rule- id" is URL-encoded. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **ETag** *(string) --* Entity tag for the uploaded object. **General purpose buckets** - To ensure that data is not corrupted traversing the network, for objects where the ETag is the MD5 digest of the object, you can calculate the MD5 while putting an object to Amazon S3 and compare the returned ETag to the calculated MD5 value. **Directory buckets** - The ETag for the object in a directory bucket isn't the MD5 digest of the object. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. This header is present if the object was uploaded with the "CRC64NVME" checksum algorithm, or if it was uploaded without a checksum (and Amazon S3 added the default checksum, "CRC64NVME", to the uploaded object). For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* This header specifies the checksum type of the object, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. For "PutObject" uploads, the checksum type is always "FULL_OBJECT". You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum that was specified. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **VersionId** *(string) --* Version ID of the object. If you enable versioning for a bucket, Amazon S3 automatically generates a unique version ID for the object being stored. Amazon S3 returns this ID in the response. When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of the objects. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the *Amazon S3 User Guide*. For information about returning the versioning state of a bucket, see GetBucketVersioning. Note: This functionality is not supported for directory buckets. * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **SSEKMSEncryptionContext** *(string) --* If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64 encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future "GetObject" operations on this object. * **BucketKeyEnabled** *(boolean) --* Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **Size** *(integer) --* The size of the object in bytes. This value is only be present if you append to an object. Note: This functionality is only supported for objects in the Amazon S3 Express One Zone storage class in directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.InvalidRequest" * "S3.Client.exceptions.InvalidWriteOffset" * "S3.Client.exceptions.TooManyParts" * "S3.Client.exceptions.EncryptionTypeMismatch" **Examples** The following example creates an object. If the bucket is versioning enabled, S3 returns version ID in response. response = client.put_object( Body='filetoupload', Bucket='examplebucket', Key='objectkey', ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'VersionId': 'Bvq0EDKxOcXLJXNo_Lkz37eM3R4pfzyQ', 'ResponseMetadata': { '...': '...', }, } The following example uploads an object. The request specifies optional request headers to directs S3 to use specific storage class and use server-side encryption. response = client.put_object( Body='HappyFace.jpg', Bucket='examplebucket', Key='HappyFace.jpg', ServerSideEncryption='AES256', StorageClass='STANDARD_IA', ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'ServerSideEncryption': 'AES256', 'VersionId': 'CG612hodqujkf8FaaNfp8U..FIhLROcp', 'ResponseMetadata': { '...': '...', }, } The following example uploads and object. The request specifies optional canned ACL (access control list) to all READ access to authenticated users. If the bucket is versioning enabled, S3 returns version ID in response. response = client.put_object( ACL='authenticated-read', Body='filetoupload', Bucket='examplebucket', Key='exampleobject', ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'VersionId': 'Kirh.unyZwjQ69YxcQLA8z4F5j3kJJKr', 'ResponseMetadata': { '...': '...', }, } The following example uploads an object to a versioning-enabled bucket. The source file is specified using Windows file syntax. S3 returns VersionId of the newly created object. response = client.put_object( Body='HappyFace.jpg', Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'VersionId': 'tpf3zF08nBplQK1XLOefGskR7mGDwcDk', 'ResponseMetadata': { '...': '...', }, } The following example creates an object. The request also specifies optional metadata. If the bucket is versioning enabled, S3 returns version ID in response. response = client.put_object( Body='filetoupload', Bucket='examplebucket', Key='exampleobject', Metadata={ 'metadata1': 'value1', 'metadata2': 'value2', }, ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'VersionId': 'pSKidl4pHBiNwukdbcPXAIs.sshFFOc0', 'ResponseMetadata': { '...': '...', }, } The following example uploads an object. The request specifies optional object tags. The bucket is versioned, therefore S3 returns version ID of the newly created object. response = client.put_object( Body='c:\HappyFace.jpg', Bucket='examplebucket', Key='HappyFace.jpg', Tagging='key1=value1&key2=value2', ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'VersionId': 'psM2sYY4.o1501dSx8wMvnkOzSBB.V4a', 'ResponseMetadata': { '...': '...', }, } The following example uploads and object. The request specifies the optional server-side encryption option. The request also specifies optional object tags. If the bucket is versioning enabled, S3 returns version ID in response. response = client.put_object( Body='filetoupload', Bucket='examplebucket', Key='exampleobject', ServerSideEncryption='AES256', Tagging='key1=value1&key2=value2', ) print(response) Expected Output: { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'ServerSideEncryption': 'AES256', 'VersionId': 'Ri.vC6qVlA4dEnjgRV4ZHsHoFIjqEMNt', 'ResponseMetadata': { '...': '...', }, } S3 / Client / upload_part_copy upload_part_copy **************** S3.Client.upload_part_copy(**kwargs) Uploads a part by copying data from an existing object as data source. To specify the data source, you add the request header "x -amz-copy-source" in your request. To specify a byte range, you add the request header "x-amz-copy-source-range" in your request. For information about maximum and minimum part sizes and other multipart upload specifications, see Multipart upload limits in the *Amazon S3 User Guide*. Note: Instead of copying data from an existing object as part data, you might use the UploadPart action to upload new data as a part of an object in your request. You must initiate a multipart upload before you can upload any part. In response to your initiate request, Amazon S3 returns the upload ID, a unique identifier that you must include in your upload part request. For conceptual information about multipart uploads, see Uploading Objects Using Multipart Upload in the *Amazon S3 User Guide*. For information about copying objects using a single atomic action vs. a multipart upload, see Operations on Objects in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Authentication and authorization All "UploadPartCopy" requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the "x-amz-" prefix, including "x -amz-copy-source", must be signed. For more information, see REST Authentication. **Directory buckets** - You must use IAM credentials to authenticate and authorize your access to the "UploadPartCopy" API operation, instead of using the temporary security credentials through the "CreateSession" API operation. Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf. Permissions You must have "READ" access to the source object and "WRITE" access to the destination bucket. * **General purpose bucket permissions** - You must have the permissions in a policy based on the bucket types of your source bucket and destination bucket in an "UploadPartCopy" operation. * If the source object is in a general purpose bucket, you must have the "s3:GetObject" permission to read the source object that is being copied. * If the destination bucket is a general purpose bucket, you must have the "s3:PutObject" permission to write the object copy to the destination bucket. * To perform a multipart upload with encryption using an Key Management Service key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 about KMS permissions, see Protecting data using server-side encryption with KMS in the *Amazon S3 User Guide*. For information about the permissions required to use the multipart upload API, see Multipart upload and permissions and Multipart upload API and permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - You must have permissions in a bucket policy or an IAM identity-based policy based on the source and destination bucket types in an "UploadPartCopy" operation. * If the source object that you want to copy is in a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to read the object. By default, the session is in the "ReadWrite" mode. If you want to restrict the access, you can explicitly set the "s3express:SessionMode" condition key to "ReadOnly" on the copy source bucket. * If the copy destination is a directory bucket, you must have the "s3express:CreateSession" permission in the "Action" element of a policy to write the object to the destination. The "s3express:SessionMode" condition key cannot be set to "ReadOnly" on the copy destination. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the *Amazon S3 User Guide*. Encryption * **General purpose buckets** - For information about using server- side encryption with customer-provided encryption keys with the "UploadPartCopy" operation, see CopyObject and UploadPart. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. Note: For directory buckets, when you perform a "CreateMultipartUpload" operation and an "UploadPartCopy" operation, the request headers you provide in the "CreateMultipartUpload" request must match the default encryption configuration of the destination bucket. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through UploadPartCopy. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. Special errors * Error Code: "NoSuchUpload" * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * HTTP Status Code: 404 Not Found * Error Code: "InvalidRequest" * Description: The specified copy source is not supported as a byte-range copy source. * HTTP Status Code: 400 Bad Request HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "UploadPartCopy": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = client.upload_part_copy( Bucket='string', CopySource='string' or {'Bucket': 'string', 'Key': 'string', 'VersionId': 'string'}, CopySourceIfMatch='string', CopySourceIfModifiedSince=datetime(2015, 1, 1), CopySourceIfNoneMatch='string', CopySourceIfUnmodifiedSince=datetime(2015, 1, 1), CopySourceRange='string', Key='string', PartNumber=123, UploadId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', CopySourceSSECustomerAlgorithm='string', CopySourceSSECustomerKey='string', RequestPayer='requester', ExpectedBucketOwner='string', ExpectedSourceBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. Note: Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP "400 Bad Request" error with the error code "InvalidRequest". **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **CopySource** (*str** or **dict*) -- **[REQUIRED]** The name of the source bucket, key name of the source object, and optional version ID of the source object. You can either provide this value as a string or a dictionary. The string form is {bucket}/{key} or {bucket}/{key}?versionId={versionId} if you want to copy a specific version. You can also provide this value as a dictionary. The dictionary format is recommended over the string format because it is more explicit. The dictionary format is: {'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}. Note that the VersionId key is optional and may be omitted. To specify an S3 access point, provide the access point ARN for the "Bucket" key in the copy source dictionary. If you want to provide the copy source for an S3 access point as a string instead of a dictionary, the ARN provided must be the full S3 access point object ARN (i.e. {accesspoint_arn}/object/{key}) * **CopySourceIfMatch** (*string*) -- Copies the object if its entity tag (ETag) matches the specified tag. If both of the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request as follows: "x-amz-copy-source-if-match" condition evaluates to "true", and; "x-amz-copy-source-if-unmodified-since" condition evaluates to "false"; Amazon S3 returns "200 OK" and copies the data. * **CopySourceIfModifiedSince** (*datetime*) -- Copies the object if it has been modified since the specified time. If both of the "x-amz-copy-source-if-none-match" and "x-amz- copy-source-if-modified-since" headers are present in the request as follows: "x-amz-copy-source-if-none-match" condition evaluates to "false", and; "x-amz-copy-source-if-modified-since" condition evaluates to "true"; Amazon S3 returns "412 Precondition Failed" response code. * **CopySourceIfNoneMatch** (*string*) -- Copies the object if its entity tag (ETag) is different than the specified ETag. If both of the "x-amz-copy-source-if-none-match" and "x-amz- copy-source-if-modified-since" headers are present in the request as follows: "x-amz-copy-source-if-none-match" condition evaluates to "false", and; "x-amz-copy-source-if-modified-since" condition evaluates to "true"; Amazon S3 returns "412 Precondition Failed" response code. * **CopySourceIfUnmodifiedSince** (*datetime*) -- Copies the object if it hasn't been modified since the specified time. If both of the "x-amz-copy-source-if-match" and "x-amz-copy- source-if-unmodified-since" headers are present in the request as follows: "x-amz-copy-source-if-match" condition evaluates to "true", and; "x-amz-copy-source-if-unmodified-since" condition evaluates to "false"; Amazon S3 returns "200 OK" and copies the data. * **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 10 bytes of the source. You can copy a range only if the source object is greater than 5 MB. * **Key** (*string*) -- **[REQUIRED]** Object key for which the multipart upload was initiated. * **PartNumber** (*integer*) -- **[REQUIRED]** Part number of part being copied. This is a positive integer between 1 and 10,000. * **UploadId** (*string*) -- **[REQUIRED]** Upload ID identifying the multipart upload whose part is being copied. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 S3 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. Note: This functionality is not supported when the destination bucket is a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the destination bucket is a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **CopySourceSSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the source object (for example, "AES256"). Note: This functionality is not supported when the source object is in a directory bucket. * **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. Note: This functionality is not supported when the source object is in a directory bucket. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported when the source object is in a directory bucket. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ExpectedSourceBucketOwner** (*string*) -- The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'CopySourceVersionId': 'string', 'CopyPartResult': { 'ETag': 'string', 'LastModified': datetime(2015, 1, 1), 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string' }, 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **CopySourceVersionId** *(string) --* The version of the source object that was copied, if you have enabled versioning on the source bucket. Note: This functionality is not supported when the source object is in a directory bucket. * **CopyPartResult** *(dict) --* Container for all response elements. * **ETag** *(string) --* Entity tag of the object. * **LastModified** *(datetime) --* Date and time at which the object was uploaded. * **ChecksumCRC32** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example uploads a part of a multipart upload by copying data from an existing object as data source. response = client.upload_part_copy( Bucket='examplebucket', CopySource='/bucketname/sourceobjectkey', Key='examplelargeobject', PartNumber='1', UploadId='exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--', ) print(response) Expected Output: { 'CopyPartResult': { 'ETag': '"b0c6f0e7e054ab8fa2536a2677f8734d"', 'LastModified': datetime(2016, 12, 29, 21, 24, 43, 3, 364, 0), }, 'ResponseMetadata': { '...': '...', }, } The following example uploads a part of a multipart upload by copying a specified byte range from an existing object as data source. response = client.upload_part_copy( Bucket='examplebucket', CopySource='/bucketname/sourceobjectkey', CopySourceRange='bytes=1-100000', Key='examplelargeobject', PartNumber='2', UploadId='exampleuoh_10OhKhT7YukE9bjzTPRiuaCotmZM_pFngJFir9OZNrSr5cWa3cq3LZSUsfjI4FI7PkP91We7Nrw--', ) print(response) Expected Output: { 'CopyPartResult': { 'ETag': '"65d16d19e65a7508a51f043180edcc36"', 'LastModified': datetime(2016, 12, 29, 21, 44, 28, 3, 364, 0), }, 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_metadata_configuration get_bucket_metadata_configuration ********************************* S3.Client.get_bucket_metadata_configuration(**kwargs) Retrieves the S3 Metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Note: You can use the V2 "GetBucketMetadataConfiguration" API operation with V1 or V2 metadata configurations. However, if you try to use the V1 "GetBucketMetadataTableConfiguration" API operation with V2 configurations, you will receive an HTTP "405 Method Not Allowed" error.Permissions To use this operation, you must have the "s3:GetBucketMetadataTableConfiguration" permission. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. Note: The IAM policy action name is the same for the V1 and V2 API operations. The following operations are related to "GetBucketMetadataConfiguration": * CreateBucketMetadataConfiguration * DeleteBucketMetadataConfiguration * UpdateBucketMetadataInventoryTableConfiguration * UpdateBucketMetadataJournalTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_metadata_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that corresponds to the metadata configuration that you want to retrieve. * **ExpectedBucketOwner** (*string*) -- The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for. Return type: dict Returns: **Response Syntax** { 'GetBucketMetadataConfigurationResult': { 'MetadataConfigurationResult': { 'DestinationResult': { 'TableBucketType': 'aws'|'customer', 'TableBucketArn': 'string', 'TableNamespace': 'string' }, 'JournalTableConfigurationResult': { 'TableStatus': 'string', 'Error': { 'ErrorCode': 'string', 'ErrorMessage': 'string' }, 'TableName': 'string', 'TableArn': 'string', 'RecordExpiration': { 'Expiration': 'ENABLED'|'DISABLED', 'Days': 123 } }, 'InventoryTableConfigurationResult': { 'ConfigurationState': 'ENABLED'|'DISABLED', 'TableStatus': 'string', 'Error': { 'ErrorCode': 'string', 'ErrorMessage': 'string' }, 'TableName': 'string', 'TableArn': 'string' } } } } **Response Structure** * *(dict) --* * **GetBucketMetadataConfigurationResult** *(dict) --* The metadata configuration for the general purpose bucket. * **MetadataConfigurationResult** *(dict) --* The metadata configuration for a general purpose bucket. * **DestinationResult** *(dict) --* The destination settings for a metadata configuration. * **TableBucketType** *(string) --* The type of the table bucket where the metadata configuration is stored. The "aws" value indicates an Amazon Web Services managed table bucket, and the "customer" value indicates a customer-managed table bucket. V2 metadata configurations are stored in Amazon Web Services managed table buckets, and V1 metadata configurations are stored in customer-managed table buckets. * **TableBucketArn** *(string) --* The Amazon Resource Name (ARN) of the table bucket where the metadata configuration is stored. * **TableNamespace** *(string) --* The namespace in the table bucket where the metadata tables for a metadata configuration are stored. * **JournalTableConfigurationResult** *(dict) --* The journal table configuration for a metadata configuration. * **TableStatus** *(string) --* The status of the journal table. The status values are: * "CREATING" - The journal table is in the process of being created in the specified table bucket. * "ACTIVE" - The journal table has been created successfully, and records are being delivered to the table. * "FAILED" - Amazon S3 is unable to create the journal table, or Amazon S3 is unable to deliver records. * **Error** *(dict) --* If an S3 Metadata V1 "CreateBucketMetadataTableConfiguration" or V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code and error message. Note: If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re- create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table. * **ErrorCode** *(string) --* If the V1 "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable" and "s3tables:PutTablePolicy" permissions, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableAlreadyExists" - The table that you specified already exists in the table bucket's namespace. Specify a different table name. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableBucketNotFound" - The table bucket that you specified doesn't exist in this Amazon Web Services Region and account. Create or choose a different table bucket. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. If the V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateTableBucket", "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable", "s3tables:PutTablePolicy", "kms:DescribeKey", and "s3tables:PutTableEncryption" permissions. Additionally, ensure that the KMS key used to encrypt the table still exists, is active and has a resource policy granting access to the S3 service principals ' "maintenance.s3tables.amazonaws.com"' and ' "metadata.s3.amazonaws.com"'. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableAlreadyExists" - A journal table already exists in the Amazon Web Services managed table bucket's namespace. Delete the journal table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "InventoryTableAlreadyExists" - An inventory table already exists in the Amazon Web Services managed table bucket's namespace. Delete the inventory table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableNotAvailable" - The journal table that the inventory table relies on has a "FAILED" status. An inventory table requires a journal table with an "ACTIVE" status. To create a new journal or inventory table, you must delete the metadata configuration for this bucket, along with any journal or inventory tables, and then create a new metadata configuration. * "NoSuchBucket" - The specified general purpose bucket does not exist. * **ErrorMessage** *(string) --* If the V1 "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error message. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable" and "s3tables:PutTablePolicy" permissions, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableAlreadyExists" - The table that you specified already exists in the table bucket's namespace. Specify a different table name. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableBucketNotFound" - The table bucket that you specified doesn't exist in this Amazon Web Services Region and account. Create or choose a different table bucket. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. If the V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateTableBucket", "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable", "s3tables:PutTablePolicy", "kms:DescribeKey", and "s3tables:PutTableEncryption" permissions. Additionally, ensure that the KMS key used to encrypt the table still exists, is active and has a resource policy granting access to the S3 service principals ' "maintenance.s3tables.amazonaws.com"' and ' "metadata.s3.amazonaws.com"'. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableAlreadyExists" - A journal table already exists in the Amazon Web Services managed table bucket's namespace. Delete the journal table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "InventoryTableAlreadyExists" - An inventory table already exists in the Amazon Web Services managed table bucket's namespace. Delete the inventory table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableNotAvailable" - The journal table that the inventory table relies on has a "FAILED" status. An inventory table requires a journal table with an "ACTIVE" status. To create a new journal or inventory table, you must delete the metadata configuration for this bucket, along with any journal or inventory tables, and then create a new metadata configuration. * "NoSuchBucket" - The specified general purpose bucket does not exist. * **TableName** *(string) --* The name of the journal table. * **TableArn** *(string) --* The Amazon Resource Name (ARN) for the journal table. * **RecordExpiration** *(dict) --* The journal table record expiration settings for the journal table. * **Expiration** *(string) --* Specifies whether journal table record expiration is enabled or disabled. * **Days** *(integer) --* If you enable journal table record expiration, you can set the number of days to retain your journal table records. Journal table records must be retained for a minimum of 7 days. To set this value, specify any whole number from "7" to "2147483647". For example, to retain your journal table records for one year, set this value to "365". * **InventoryTableConfigurationResult** *(dict) --* The inventory table configuration for a metadata configuration. * **ConfigurationState** *(string) --* The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled. * **TableStatus** *(string) --* The status of the inventory table. The status values are: * "CREATING" - The inventory table is in the process of being created in the specified Amazon Web Services managed table bucket. * "BACKFILLING" - The inventory table is in the process of being backfilled. When you enable the inventory table for your metadata configuration, the table goes through a process known as backfilling, during which Amazon S3 scans your general purpose bucket to retrieve the initial metadata for all objects in the bucket. Depending on the number of objects in your bucket, this process can take several hours. When the backfilling process is finished, the status of your inventory table changes from "BACKFILLING" to "ACTIVE". After backfilling is completed, updates to your objects are reflected in the inventory table within one hour. * "ACTIVE" - The inventory table has been created successfully, and records are being delivered to the table. * "FAILED" - Amazon S3 is unable to create the inventory table, or Amazon S3 is unable to deliver records. * **Error** *(dict) --* If an S3 Metadata V1 "CreateBucketMetadataTableConfiguration" or V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code and error message. Note: If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re- create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table. * **ErrorCode** *(string) --* If the V1 "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable" and "s3tables:PutTablePolicy" permissions, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableAlreadyExists" - The table that you specified already exists in the table bucket's namespace. Specify a different table name. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableBucketNotFound" - The table bucket that you specified doesn't exist in this Amazon Web Services Region and account. Create or choose a different table bucket. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. If the V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateTableBucket", "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable", "s3tables:PutTablePolicy", "kms:DescribeKey", and "s3tables:PutTableEncryption" permissions. Additionally, ensure that the KMS key used to encrypt the table still exists, is active and has a resource policy granting access to the S3 service principals ' "maintenance.s3tables.amazonaws.com"' and ' "metadata.s3.amazonaws.com"'. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableAlreadyExists" - A journal table already exists in the Amazon Web Services managed table bucket's namespace. Delete the journal table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "InventoryTableAlreadyExists" - An inventory table already exists in the Amazon Web Services managed table bucket's namespace. Delete the inventory table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableNotAvailable" - The journal table that the inventory table relies on has a "FAILED" status. An inventory table requires a journal table with an "ACTIVE" status. To create a new journal or inventory table, you must delete the metadata configuration for this bucket, along with any journal or inventory tables, and then create a new metadata configuration. * "NoSuchBucket" - The specified general purpose bucket does not exist. * **ErrorMessage** *(string) --* If the V1 "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error message. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable" and "s3tables:PutTablePolicy" permissions, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableAlreadyExists" - The table that you specified already exists in the table bucket's namespace. Specify a different table name. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableBucketNotFound" - The table bucket that you specified doesn't exist in this Amazon Web Services Region and account. Create or choose a different table bucket. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. If the V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateTableBucket", "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable", "s3tables:PutTablePolicy", "kms:DescribeKey", and "s3tables:PutTableEncryption" permissions. Additionally, ensure that the KMS key used to encrypt the table still exists, is active and has a resource policy granting access to the S3 service principals ' "maintenance.s3tables.amazonaws.com"' and ' "metadata.s3.amazonaws.com"'. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableAlreadyExists" - A journal table already exists in the Amazon Web Services managed table bucket's namespace. Delete the journal table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "InventoryTableAlreadyExists" - An inventory table already exists in the Amazon Web Services managed table bucket's namespace. Delete the inventory table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableNotAvailable" - The journal table that the inventory table relies on has a "FAILED" status. An inventory table requires a journal table with an "ACTIVE" status. To create a new journal or inventory table, you must delete the metadata configuration for this bucket, along with any journal or inventory tables, and then create a new metadata configuration. * "NoSuchBucket" - The specified general purpose bucket does not exist. * **TableName** *(string) --* The name of the inventory table. * **TableArn** *(string) --* The Amazon Resource Name (ARN) for the inventory table. S3 / Client / put_bucket_acl put_bucket_acl ************** S3.Client.put_bucket_acl(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Sets the permissions on an existing bucket using access control lists (ACL). For more information, see Using ACLs. To set the ACL of a bucket, you must have the "WRITE_ACP" permission. You can use one of the following two ways to set a bucket's permissions: * Specify the ACL in the request body * Specify permissions using request headers Note: You cannot specify access permission using both the body and the request headers. Depending on your application needs, you may choose to set the ACL on a bucket using either the request body or the headers. For example, if you have an existing application that updates a bucket ACL using the request body, then you can continue to use that approach. Warning: If your bucket uses the bucket owner enforced setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. You must use policies to grant access to your bucket and the objects in it. Requests to set ACLs or update ACLs fail and return the "AccessControlListNotSupported" error code. Requests to read ACLs are still supported. For more information, see Controlling object ownership in the *Amazon S3 User Guide*.Permissions You can set access permissions by using one of the following methods: * Specify a canned ACL with the "x-amz-acl" request header. Amazon S3 supports a set of predefined ACLs, known as *canned ACLs*. Each canned ACL has a predefined set of grantees and permissions. Specify the canned ACL name as the value of "x-amz-acl". If you use this header, you cannot use other access control-specific headers in your request. For more information, see Canned ACL. * Specify access permissions explicitly with the "x-amz-grant- read", "x-amz-grant-read-acp", "x-amz-grant-write-acp", and "x -amz-grant-full-control" headers. When using these headers, you specify explicit access permissions and grantees (Amazon Web Services accounts or Amazon S3 groups) who will receive the permission. If you use these ACL-specific headers, you cannot use the "x-amz-acl" header to set a canned ACL. These parameters map to the set of permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview. You specify each grantee as a type=value pair, where the type is one of the following: * "id" – if the value specified is the canonical user ID of an Amazon Web Services account * "uri" – if you are granting permissions to a predefined group * "emailAddress" – if the value specified is the email address of an Amazon Web Services account Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. For example, the following "x-amz-grant-write" header grants create, overwrite, and delete objects permission to LogDelivery group predefined by Amazon S3 and two Amazon Web Services accounts identified by their email addresses. "x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", id="111122223333", id="555566667777"" You can use either a canned ACL or specify access permissions explicitly. You cannot do both. Grantee Values You can specify the person (grantee) to whom you're assigning access rights (using request elements) in the following ways. For examples of how to specify these grantee values in JSON format, see the Amazon Web Services CLI example in Enabling Amazon S3 server access logging in the *Amazon S3 User Guide*. * By the person's ID: "<>ID<><>GranteesEmail<> " DisplayName is optional and ignored in the request * By URI: "<>http://acs.amazonaws.com/group s/global/AuthenticatedUsers<>" * By Email address: "<>Grantees@email.com<>&" The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the CanonicalUser. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. The following operations are related to "PutBucketAcl": * CreateBucket * DeleteBucket * GetObjectAcl See also: AWS API Documentation **Request Syntax** response = client.put_bucket_acl( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', AccessControlPolicy={ 'Grants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'WRITE'|'WRITE_ACP'|'READ'|'READ_ACP' }, ], 'Owner': { 'DisplayName': 'string', 'ID': 'string' } }, Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', ExpectedBucketOwner='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the bucket. * **AccessControlPolicy** (*dict*) -- Contains the elements that set the ACL permissions for an object per grantee. * **Grants** *(list) --* A list of grants. * *(dict) --* Container for grant information. * **Grantee** *(dict) --* The person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Specifies the permission given to the grantee. * **Owner** *(dict) --* Container for the bucket owner's display name and ID. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Bucket** (*string*) -- **[REQUIRED]** The bucket to which to apply the ACL. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **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 new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example replaces existing ACL on a bucket. The ACL grants the bucket owner (specified using the owner ID) and write permission to the LogDelivery group. Because this is a replace operation, you must specify all the grants in your request. To incrementally add or remove ACL grants, you might use the console. response = client.put_bucket_acl( Bucket='examplebucket', GrantFullControl='id=examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484', GrantWrite='uri=http://acs.amazonaws.com/groups/s3/LogDelivery', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_metadata_table_configuration get_bucket_metadata_table_configuration *************************************** S3.Client.get_bucket_metadata_table_configuration(**kwargs) Warning: We recommend that you retrieve your S3 Metadata configurations by using the V2 GetBucketMetadataTableConfiguration API operation. We no longer recommend using the V1 "GetBucketMetadataTableConfiguration" API operation.If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table. Retrieves the V1 S3 Metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Note: You can use the V2 "GetBucketMetadataConfiguration" API operation with V1 or V2 metadata table configurations. However, if you try to use the V1 "GetBucketMetadataTableConfiguration" API operation with V2 configurations, you will receive an HTTP "405 Method Not Allowed" error.Make sure that you update your processes to use the new V2 API operations ( "CreateBucketMetadataConfiguration", "GetBucketMetadataConfiguration", and "DeleteBucketMetadataConfiguration") instead of the V1 API operations.Permissions To use this operation, you must have the "s3:GetBucketMetadataTableConfiguration" permission. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. The following operations are related to "GetBucketMetadataTableConfiguration": * CreateBucketMetadataTableConfiguration * DeleteBucketMetadataTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_metadata_table_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that corresponds to the metadata table configuration that you want to retrieve. * **ExpectedBucketOwner** (*string*) -- The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for. Return type: dict Returns: **Response Syntax** { 'GetBucketMetadataTableConfigurationResult': { 'MetadataTableConfigurationResult': { 'S3TablesDestinationResult': { 'TableBucketArn': 'string', 'TableName': 'string', 'TableArn': 'string', 'TableNamespace': 'string' } }, 'Status': 'string', 'Error': { 'ErrorCode': 'string', 'ErrorMessage': 'string' } } } **Response Structure** * *(dict) --* * **GetBucketMetadataTableConfigurationResult** *(dict) --* The metadata table configuration for the general purpose bucket. * **MetadataTableConfigurationResult** *(dict) --* The V1 S3 Metadata configuration for a general purpose bucket. * **S3TablesDestinationResult** *(dict) --* The destination information for the metadata table configuration. The destination table bucket must be in the same Region and Amazon Web Services account as the general purpose bucket. The specified metadata table name must be unique within the "aws_s3_metadata" namespace in the destination table bucket. * **TableBucketArn** *(string) --* The Amazon Resource Name (ARN) for the table bucket that's specified as the destination in the metadata table configuration. The destination table bucket must be in the same Region and Amazon Web Services account as the general purpose bucket. * **TableName** *(string) --* The name for the metadata table in your metadata table configuration. The specified metadata table name must be unique within the "aws_s3_metadata" namespace in the destination table bucket. * **TableArn** *(string) --* The Amazon Resource Name (ARN) for the metadata table in the metadata table configuration. The specified metadata table name must be unique within the "aws_s3_metadata" namespace in the destination table bucket. * **TableNamespace** *(string) --* The table bucket namespace for the metadata table in your metadata table configuration. This value is always "aws_s3_metadata". * **Status** *(string) --* The status of the metadata table. The status values are: * "CREATING" - The metadata table is in the process of being created in the specified table bucket. * "ACTIVE" - The metadata table has been created successfully, and records are being delivered to the table. * "FAILED" - Amazon S3 is unable to create the metadata table, or Amazon S3 is unable to deliver records. See "ErrorDetails" for details. * **Error** *(dict) --* If the "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code and error message. * **ErrorCode** *(string) --* If the V1 "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable" and "s3tables:PutTablePolicy" permissions, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableAlreadyExists" - The table that you specified already exists in the table bucket's namespace. Specify a different table name. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableBucketNotFound" - The table bucket that you specified doesn't exist in this Amazon Web Services Region and account. Create or choose a different table bucket. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. If the V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateTableBucket", "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable", "s3tables:PutTablePolicy", "kms:DescribeKey", and "s3tables:PutTableEncryption" permissions. Additionally, ensure that the KMS key used to encrypt the table still exists, is active and has a resource policy granting access to the S3 service principals ' "maintenance.s3tables.amazonaws.com"' and ' "metadata.s3.amazonaws.com"'. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableAlreadyExists" - A journal table already exists in the Amazon Web Services managed table bucket's namespace. Delete the journal table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "InventoryTableAlreadyExists" - An inventory table already exists in the Amazon Web Services managed table bucket's namespace. Delete the inventory table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableNotAvailable" - The journal table that the inventory table relies on has a "FAILED" status. An inventory table requires a journal table with an "ACTIVE" status. To create a new journal or inventory table, you must delete the metadata configuration for this bucket, along with any journal or inventory tables, and then create a new metadata configuration. * "NoSuchBucket" - The specified general purpose bucket does not exist. * **ErrorMessage** *(string) --* If the V1 "CreateBucketMetadataTableConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error message. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable" and "s3tables:PutTablePolicy" permissions, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableAlreadyExists" - The table that you specified already exists in the table bucket's namespace. Specify a different table name. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "TableBucketNotFound" - The table bucket that you specified doesn't exist in this Amazon Web Services Region and account. Create or choose a different table bucket. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. If the V2 "CreateBucketMetadataConfiguration" request succeeds, but S3 Metadata was unable to create the table, this structure contains the error code. The possible error codes and error messages are as follows: * "AccessDeniedCreatingResources" - You don't have sufficient permissions to create the required resources. Make sure that you have "s3tables:CreateTableBucket", "s3tables:CreateNamespace", "s3tables:CreateTable", "s3tables:GetTable", "s3tables:PutTablePolicy", "kms:DescribeKey", and "s3tables:PutTableEncryption" permissions. Additionally, ensure that the KMS key used to encrypt the table still exists, is active and has a resource policy granting access to the S3 service principals ' "maintenance.s3tables.amazonaws.com"' and ' "metadata.s3.amazonaws.com"'. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "AccessDeniedWritingToTable" - Unable to write to the metadata table because of missing resource permissions. To fix the resource policy, Amazon S3 needs to create a new metadata table. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "DestinationTableNotFound" - The destination table doesn't exist. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "ServerInternalError" - An internal error has occurred. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableAlreadyExists" - A journal table already exists in the Amazon Web Services managed table bucket's namespace. Delete the journal table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "InventoryTableAlreadyExists" - An inventory table already exists in the Amazon Web Services managed table bucket's namespace. Delete the inventory table, and then try again. To create a new metadata table, you must delete the metadata configuration for this bucket, and then create a new metadata configuration. * "JournalTableNotAvailable" - The journal table that the inventory table relies on has a "FAILED" status. An inventory table requires a journal table with an "ACTIVE" status. To create a new journal or inventory table, you must delete the metadata configuration for this bucket, along with any journal or inventory tables, and then create a new metadata configuration. * "NoSuchBucket" - The specified general purpose bucket does not exist. S3 / Client / put_bucket_policy put_bucket_policy ***************** S3.Client.put_bucket_policy(**kwargs) Applies an Amazon S3 bucket policy to an Amazon S3 bucket. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must both have the "PutBucketPolicy" permissions on the specified bucket and belong to the bucket owner's account in order to use this operation. If you don't have "PutBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: To ensure that bucket owners don't inadvertently lock themselves out of their own buckets, the root principal in a bucket owner's Amazon Web Services account can perform the "GetBucketPolicy", "PutBucketPolicy", and "DeleteBucketPolicy" API actions, even if their bucket policy explicitly denies the root principal's access. Bucket owner root principals can only be blocked from performing these API actions by VPC endpoint policies and Amazon Web Services Organizations policies. * **General purpose bucket permissions** - The "s3:PutBucketPolicy" permission is required in a policy. For more information about general purpose buckets bucket policies, see Using Bucket Policies and User Policies in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:PutBucketPolicy" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. Example bucket policies **General purpose buckets example bucket policies** - See Bucket policy examples in the *Amazon S3 User Guide*. **Directory bucket example bucket policies** - See Example bucket policies for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "PutBucketPolicy": * CreateBucket * DeleteBucket See also: AWS API Documentation **Request Syntax** response = client.put_bucket_policy( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ConfirmRemoveSelfBucketAccess=True|False, Policy='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum-algorithm" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For the "x-amz-checksum-algorithm" header, replace "algorithm" with the supported algorithm from the following list: * "CRC32" * "CRC32C" * "CRC64NVME" * "SHA1" * "SHA256" For more information, see Checking object integrity in the *Amazon S3 User Guide*. If the individual checksum value you provide through "x-amz- checksum-algorithm" doesn't match the checksum algorithm you set through "x-amz-sdk-checksum-algorithm", Amazon S3 fails the request with a "BadDigest" error. Note: For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ConfirmRemoveSelfBucketAccess** (*boolean*) -- Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future. Note: This functionality is not supported for directory buckets. * **Policy** (*string*) -- **[REQUIRED]** The bucket policy as a JSON document. For directory buckets, the only IAM action supported in the bucket policy is "s3express:CreateSession". * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None **Examples** The following example sets a permission policy on a bucket. response = client.put_bucket_policy( Bucket='examplebucket', Policy='{"Version": "2012-10-17", "Statement": [{ "Sid": "id-1","Effect": "Allow","Principal": {"AWS": "arn:aws:iam::123456789012:root"}, "Action": [ "s3:PutObject","s3:PutObjectAcl"], "Resource": ["arn:aws:s3:::acl3/*" ] } ]}', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket_metadata_configuration delete_bucket_metadata_configuration ************************************ S3.Client.delete_bucket_metadata_configuration(**kwargs) Deletes an S3 Metadata configuration from a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Note: You can use the V2 "DeleteBucketMetadataConfiguration" API operation with V1 or V2 metadata configurations. However, if you try to use the V1 "DeleteBucketMetadataTableConfiguration" API operation with V2 configurations, you will receive an HTTP "405 Method Not Allowed" error.Permissions To use this operation, you must have the "s3:DeleteBucketMetadataTableConfiguration" permission. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. Note: The IAM policy action name is the same for the V1 and V2 API operations. The following operations are related to "DeleteBucketMetadataConfiguration": * CreateBucketMetadataConfiguration * GetBucketMetadataConfiguration * UpdateBucketMetadataInventoryTableConfiguration * UpdateBucketMetadataJournalTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_metadata_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that you want to remove the metadata configuration from. * **ExpectedBucketOwner** (*string*) -- The expected bucket owner of the general purpose bucket that you want to remove the metadata table configuration from. Returns: None S3 / Client / get_bucket_request_payment get_bucket_request_payment ************************** S3.Client.get_bucket_request_payment(**kwargs) Note: This operation is not supported for directory buckets. Returns the request payment configuration of a bucket. To use this version of the operation, you must be the bucket owner. For more information, see Requester Pays Buckets. The following operations are related to "GetBucketRequestPayment": * ListObjects See also: AWS API Documentation **Request Syntax** response = client.get_bucket_request_payment( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the payment request configuration * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'Payer': 'Requester'|'BucketOwner' } **Response Structure** * *(dict) --* * **Payer** *(string) --* Specifies who pays for the download and request fees. **Examples** The following example retrieves bucket versioning configuration. response = client.get_bucket_request_payment( Bucket='examplebucket', ) print(response) Expected Output: { 'Payer': 'BucketOwner', 'ResponseMetadata': { '...': '...', }, } S3 / Client / create_bucket_metadata_configuration create_bucket_metadata_configuration ************************************ S3.Client.create_bucket_metadata_configuration(**kwargs) Creates an S3 Metadata V2 metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Permissions To use this operation, you must have the following permissions. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. If you want to encrypt your metadata tables with server-side encryption with Key Management Service (KMS) keys (SSE-KMS), you need additional permissions in your KMS key policy. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. If you also want to integrate your table bucket with Amazon Web Services analytics services so that you can query your metadata table, you need additional permissions. For more information, see Integrating Amazon S3 Tables with Amazon Web Services analytics services in the *Amazon S3 User Guide*. To query your metadata tables, you need additional permissions. For more information, see Permissions for querying metadata tables in the *Amazon S3 User Guide*. * "s3:CreateBucketMetadataTableConfiguration" Note: The IAM policy action name is the same for the V1 and V2 API operations. * "s3tables:CreateTableBucket" * "s3tables:CreateNamespace" * "s3tables:GetTable" * "s3tables:CreateTable" * "s3tables:PutTablePolicy" * "s3tables:PutTableEncryption" * "kms:DescribeKey" The following operations are related to "CreateBucketMetadataConfiguration": * DeleteBucketMetadataConfiguration * GetBucketMetadataConfiguration * UpdateBucketMetadataInventoryTableConfiguration * UpdateBucketMetadataJournalTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.create_bucket_metadata_configuration( Bucket='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', MetadataConfiguration={ 'JournalTableConfiguration': { 'RecordExpiration': { 'Expiration': 'ENABLED'|'DISABLED', 'Days': 123 }, 'EncryptionConfiguration': { 'SseAlgorithm': 'aws:kms'|'AES256', 'KmsKeyArn': 'string' } }, 'InventoryTableConfiguration': { 'ConfigurationState': 'ENABLED'|'DISABLED', 'EncryptionConfiguration': { 'SseAlgorithm': 'aws:kms'|'AES256', 'KmsKeyArn': 'string' } } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that you want to create the metadata configuration for. * **ContentMD5** (*string*) -- The "Content-MD5" header for the metadata configuration. * **ChecksumAlgorithm** (*string*) -- The checksum algorithm to use with your metadata configuration. * **MetadataConfiguration** (*dict*) -- **[REQUIRED]** The contents of your metadata configuration. * **JournalTableConfiguration** *(dict) --* **[REQUIRED]** The journal table configuration for a metadata configuration. * **RecordExpiration** *(dict) --* **[REQUIRED]** The journal table record expiration settings for the journal table. * **Expiration** *(string) --* **[REQUIRED]** Specifies whether journal table record expiration is enabled or disabled. * **Days** *(integer) --* If you enable journal table record expiration, you can set the number of days to retain your journal table records. Journal table records must be retained for a minimum of 7 days. To set this value, specify any whole number from "7" to "2147483647". For example, to retain your journal table records for one year, set this value to "365". * **EncryptionConfiguration** *(dict) --* The encryption configuration for the journal table. * **SseAlgorithm** *(string) --* **[REQUIRED]** The encryption type specified for a metadata table. To specify server-side encryption with Key Management Service (KMS) keys (SSE-KMS), use the "aws:kms" value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the "AES256" value. * **KmsKeyArn** *(string) --* If server-side encryption with Key Management Service (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that's located in the same Region as the general purpose bucket that corresponds to the metadata table configuration. * **InventoryTableConfiguration** *(dict) --* The inventory table configuration for a metadata configuration. * **ConfigurationState** *(string) --* **[REQUIRED]** The configuration state of the inventory table, indicating whether the inventory table is enabled or disabled. * **EncryptionConfiguration** *(dict) --* The encryption configuration for the inventory table. * **SseAlgorithm** *(string) --* **[REQUIRED]** The encryption type specified for a metadata table. To specify server-side encryption with Key Management Service (KMS) keys (SSE-KMS), use the "aws:kms" value. To specify server-side encryption with Amazon S3 managed keys (SSE-S3), use the "AES256" value. * **KmsKeyArn** *(string) --* If server-side encryption with Key Management Service (KMS) keys (SSE-KMS) is specified, you must also specify the KMS key Amazon Resource Name (ARN). You must specify a customer-managed KMS key that's located in the same Region as the general purpose bucket that corresponds to the metadata table configuration. * **ExpectedBucketOwner** (*string*) -- The expected owner of the general purpose bucket that corresponds to your metadata configuration. Returns: None S3 / Client / delete_bucket_cors delete_bucket_cors ****************** S3.Client.delete_bucket_cors(**kwargs) Note: This operation is not supported for directory buckets. Deletes the "cors" configuration information set for the bucket. To use this operation, you must have permission to perform the "s3:PutBucketCORS" action. The bucket owner has this permission by default and can grant this permission to others. For information about "cors", see Enabling Cross-Origin Resource Sharing in the *Amazon S3 User Guide*. **Related Resources** * PutBucketCors * RESTOPTIONSobject See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_cors( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket whose "cors" configuration is being deleted. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example deletes CORS configuration on a bucket. response = client.delete_bucket_cors( Bucket='examplebucket', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket_metadata_table_configuration delete_bucket_metadata_table_configuration ****************************************** S3.Client.delete_bucket_metadata_table_configuration(**kwargs) Warning: We recommend that you delete your S3 Metadata configurations by using the V2 DeleteBucketMetadataTableConfiguration API operation. We no longer recommend using the V1 "DeleteBucketMetadataTableConfiguration" API operation.If you created your S3 Metadata configuration before July 15, 2025, we recommend that you delete and re-create your configuration by using CreateBucketMetadataConfiguration so that you can expire journal table records and create a live inventory table. Deletes a V1 S3 Metadata configuration from a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Note: You can use the V2 "DeleteBucketMetadataConfiguration" API operation with V1 or V2 metadata table configurations. However, if you try to use the V1 "DeleteBucketMetadataTableConfiguration" API operation with V2 configurations, you will receive an HTTP "405 Method Not Allowed" error.Make sure that you update your processes to use the new V2 API operations ( "CreateBucketMetadataConfiguration", "GetBucketMetadataConfiguration", and "DeleteBucketMetadataConfiguration") instead of the V1 API operations.Permissions To use this operation, you must have the "s3:DeleteBucketMetadataTableConfiguration" permission. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. The following operations are related to "DeleteBucketMetadataTableConfiguration": * CreateBucketMetadataTableConfiguration * GetBucketMetadataTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_metadata_table_configuration( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that you want to remove the metadata table configuration from. * **ExpectedBucketOwner** (*string*) -- The expected bucket owner of the general purpose bucket that you want to remove the metadata table configuration from. Returns: None S3 / Client / abort_multipart_upload abort_multipart_upload ********************** S3.Client.abort_multipart_upload(**kwargs) This operation 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. To verify that all parts have been removed and prevent getting charged for the part storage, you should call the ListParts API operation and ensure that the parts list is empty. Note: * **Directory buckets** - If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed. To delete these in-progress multipart uploads, use the "ListMultipartUploads" operation to list the in-progress multipart uploads in the bucket and use the "AbortMultipartUpload" operation to abort all the in-progress multipart uploads. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - For information about permissions required to use the multipart upload, see Multipart Upload and Permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "AbortMultipartUpload": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = client.abort_multipart_upload( Bucket='string', Key='string', UploadId='string', RequestPayer='requester', ExpectedBucketOwner='string', IfMatchInitiatedTime=datetime(2015, 1, 1) ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name to which the upload was taking place. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Key of the object for which the multipart upload was initiated. * **UploadId** (*string*) -- **[REQUIRED]** Upload ID that identifies the multipart upload. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatchInitiatedTime** (*datetime*) -- If present, this header aborts an in progress multipart upload only if it was initiated on the provided timestamp. If the initiated timestamp of the multipart upload does not match the provided value, the operation returns a "412 Precondition Failed" error. If the initiated timestamp matches or if the multipart upload doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. Return type: dict Returns: **Response Syntax** { 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchUpload" **Examples** The following example aborts a multipart upload. response = client.abort_multipart_upload( Bucket='examplebucket', Key='bigobject', UploadId='xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / list_directory_buckets list_directory_buckets ********************** S3.Client.list_directory_buckets(**kwargs) Returns a list of all Amazon S3 directory buckets owned by the authenticated sender of the request. For more information about directory buckets, see Directory buckets in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions You must have the "s3express:ListAllMyDirectoryBuckets" permission in an IAM identity-based policy instead of a bucket policy. Cross- account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". Note: The "BucketRegion" response element is not part of the "ListDirectoryBuckets" Response Syntax. See also: AWS API Documentation **Request Syntax** response = client.list_directory_buckets( ContinuationToken='string', MaxDirectoryBuckets=123 ) Parameters: * **ContinuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on buckets in this account with a token. "ContinuationToken" is obfuscated and is not a real bucket name. You can use this "ContinuationToken" for the pagination of the list results. * **MaxDirectoryBuckets** (*integer*) -- Maximum number of buckets to be returned in response. When the number is more than the count of buckets that are owned by an Amazon Web Services account, return all the buckets in response. Return type: dict Returns: **Response Syntax** { 'Buckets': [ { 'Name': 'string', 'CreationDate': datetime(2015, 1, 1), 'BucketRegion': 'string', 'BucketArn': 'string' }, ], 'ContinuationToken': 'string' } **Response Structure** * *(dict) --* * **Buckets** *(list) --* The list of buckets owned by the requester. * *(dict) --* In terms of implementation, a Bucket is a resource. * **Name** *(string) --* The name of the bucket. * **CreationDate** *(datetime) --* Date the bucket was created. This date can change when making changes to your bucket, such as editing its bucket policy. * **BucketRegion** *(string) --* "BucketRegion" indicates the Amazon Web Services region where the bucket is located. If the request contains at least one valid parameter, it is included in the response. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the S3 bucket. ARNs uniquely identify Amazon Web Services resources across all of Amazon Web Services. Note: This parameter is only supported for S3 directory buckets. For more information, see Using tags with directory buckets. * **ContinuationToken** *(string) --* If "ContinuationToken" was sent with the request, it is included in the response. You can use the returned "ContinuationToken" for pagination of the list response. S3 / Client / put_bucket_notification put_bucket_notification *********************** S3.Client.put_bucket_notification(**kwargs) Note: This operation is not supported for directory buckets. No longer used, see the PutBucketNotificationConfiguration operation. Danger: This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity. See also: AWS API Documentation **Request Syntax** response = client.put_bucket_notification( Bucket='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', NotificationConfiguration={ 'TopicConfiguration': { 'Id': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', 'Topic': 'string' }, 'QueueConfiguration': { 'Id': 'string', 'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Queue': 'string' }, 'CloudFunctionConfiguration': { 'Id': 'string', 'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'CloudFunction': 'string', 'InvocationRole': 'string' } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **NotificationConfiguration** (*dict*) -- **[REQUIRED]** The container for the configuration. * **TopicConfiguration** *(dict) --* This data type is deprecated. A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **Events** *(list) --* A collection of events related to objects * *(string) --* The bucket event for which to send notifications. * **Event** *(string) --* Bucket event for which to send notifications. * **Topic** *(string) --* Amazon SNS topic to which Amazon S3 will publish a message to report the specified events for the bucket. * **QueueConfiguration** *(dict) --* This data type is deprecated. This data type specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **Event** *(string) --* The bucket event for which to send notifications. * **Events** *(list) --* A collection of bucket events for which to send notifications. * *(string) --* The bucket event for which to send notifications. * **Queue** *(string) --* The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. * **CloudFunctionConfiguration** *(dict) --* Container for specifying the Lambda notification configuration. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **Event** *(string) --* The bucket event for which to send notifications. * **Events** *(list) --* Bucket events for which to send notifications. * *(string) --* The bucket event for which to send notifications. * **CloudFunction** *(string) --* Lambda cloud function ARN that Amazon S3 can invoke when it detects events of the specified type. * **InvocationRole** *(string) --* The role supporting the invocation of the Lambda function * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / put_bucket_encryption put_bucket_encryption ********************* S3.Client.put_bucket_encryption(**kwargs) This operation configures default encryption and Amazon S3 Bucket Keys for an existing bucket. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). Note: * **General purpose buckets** * You can optionally configure default encryption for a bucket by using server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you specify default encryption by using SSE-KMS, you can also configure Amazon S3 Bucket Keys. For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the *Amazon S3 User Guide*. * If you use PutBucketEncryption to set your default bucket encryption to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 doesn't validate the KMS key ID provided in PutBucketEncryption requests. * **Directory buckets** - You can optionally configure default encryption for a bucket by using server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your "CreateSession" requests or "PUT" object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads. * Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key ( "aws/s3") isn't supported. * S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported. * For directory buckets, if you use PutBucketEncryption to set your default bucket encryption to SSE-KMS, Amazon S3 validates the KMS key ID provided in PutBucketEncryption requests. Warning: If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.Also, this action requires Amazon Web Services Signature Version 4. For more information, see Authenticating Requests (Amazon Web Services Signature Version 4).Permissions * **General purpose bucket permissions** - The "s3:PutEncryptionConfiguration" permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Operations and Managing Access Permissions to Your Amazon S3 Resources in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation, you must have the "s3express:PutEncryptionConfiguration" permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. To set a directory bucket default encryption with SSE-KMS, you must also have the "kms:GenerateDataKey" and the "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the target KMS key. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region-code.amazonaws.com". The following operations are related to "PutBucketEncryption": * GetBucketEncryption * DeleteBucketEncryption See also: AWS API Documentation **Request Syntax** response = client.put_bucket_encryption( Bucket='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ServerSideEncryptionConfiguration={ 'Rules': [ { 'ApplyServerSideEncryptionByDefault': { 'SSEAlgorithm': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'KMSMasterKeyID': 'string' }, 'BucketKeyEnabled': True|False }, ] }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** Specifies default encryption for a bucket using server-side encryption with different key options. **Directory buckets** - When you use this operation with a directory bucket, you must use path-style requests in the format "https://s3express-control.region-code.amazonaws.com /bucket-name ``. Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must also follow the format ``bucket-base-name--zone-id--x-s3" (for example, "DOC-EXAMPLE-BUCKET--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide* * **ContentMD5** (*string*) -- The Base64 encoded 128-bit "MD5" digest of the server-side encryption configuration. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. Note: For directory buckets, when you use Amazon Web Services SDKs, "CRC32" is the default checksum algorithm that's used for performance. * **ServerSideEncryptionConfiguration** (*dict*) -- **[REQUIRED]** Specifies the default server-side-encryption configuration. * **Rules** *(list) --* **[REQUIRED]** Container for information about a particular server-side encryption configuration rule. * *(dict) --* Specifies the default server-side encryption configuration. Note: * **General purpose buckets** - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. * **Directory buckets** - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported. * **ApplyServerSideEncryptionByDefault** *(dict) --* Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. * **SSEAlgorithm** *(string) --* **[REQUIRED]** Server-side encryption algorithm to use for the default encryption. Note: For directory buckets, there are only two supported values for server-side encryption: "AES256" and "aws:kms". * **KMSMasterKeyID** *(string) --* Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption. Note: * **General purpose buckets** - This parameter is allowed if and only if "SSEAlgorithm" is set to "aws:kms" or "aws:kms:dsse". * **Directory buckets** - This parameter is allowed if and only if "SSEAlgorithm" is set to "aws:kms". You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key. * Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" * Key ARN: "arn:aws:kms:us-east-2:111122223333:key /1234abcd-12ab-34cd-56ef-1234567890ab" * Key Alias: "alias/alias-name" If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations. Note: * **General purpose buckets** - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log. * **Directory buckets** - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Warning: Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the *Amazon Web Services Key Management Service Developer Guide*. * **BucketKeyEnabled** *(boolean) --* Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the "BucketKeyEnabled" element to "true" causes Amazon S3 to use an S3 Bucket Key. Note: * **General purpose buckets** - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the *Amazon S3 User Guide*. * **Directory buckets** - S3 Bucket Keys are always enabled for "GET" and "PUT" operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code "501 Not Implemented". Returns: None S3 / Client / get_object_legal_hold get_object_legal_hold ********************* S3.Client.get_object_legal_hold(**kwargs) Note: This operation is not supported for directory buckets. Gets an object's current legal hold status. For more information, see Locking Objects. This functionality is not supported for Amazon S3 on Outposts. The following action is related to "GetObjectLegalHold": * GetObjectAttributes See also: AWS API Documentation **Request Syntax** response = client.get_object_legal_hold( Bucket='string', Key='string', VersionId='string', RequestPayer='requester', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object whose legal hold status you want to retrieve. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** The key name for the object whose legal hold status you want to retrieve. * **VersionId** (*string*) -- The version ID of the object whose legal hold status you want to retrieve. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'LegalHold': { 'Status': 'ON'|'OFF' } } **Response Structure** * *(dict) --* * **LegalHold** *(dict) --* The current legal hold status for the specified object. * **Status** *(string) --* Indicates whether the specified object has a legal hold in place. S3 / Client / delete_object delete_object ************* S3.Client.delete_object(**kwargs) Removes an object from a bucket. The behavior depends on the bucket's versioning state: * If bucket versioning is not enabled, the operation permanently deletes the object. * If bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the object. To permanently delete an object in a versioned bucket, you must include the object’s "versionId" in the request. For more information about versioning-enabled buckets, see Deleting object versions from a versioning-enabled bucket. * If bucket versioning is suspended, the operation removes the object that has a null "versionId", if there is one, and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null "versionId", and all versions of the object have a "versionId", Amazon S3 does not remove the object and only inserts a delete marker. To permanently delete an object that has a "versionId", you must include the object’s "versionId" in the request. For more information about versioning-suspended buckets, see Deleting objects from versioning-suspended buckets. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. To remove a specific version, you must use the "versionId" query parameter. Using this query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3 sets the response header "x-amz-delete-marker" to true. If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include the "x-amz-mfa" request header in the DELETE "versionId" request. Requests that include "x-amz-mfa" must use HTTPS. For more information about MFA Delete, see Using MFA Delete in the *Amazon S3 User Guide*. To see sample requests that use versioning, see Sample Request. Note: **Directory buckets** - MFA delete is not supported by directory buckets. You can delete objects by explicitly calling DELETE Object or calling ( PutBucketLifecycle) to enable Amazon S3 to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them the "s3:DeleteObject", "s3:DeleteObjectVersion", and "s3:PutLifeCycleConfiguration" actions. Note: **Directory buckets** - S3 Lifecycle is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always have the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must have the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following action is related to "DeleteObject": * PutObject See also: AWS API Documentation **Request Syntax** response = client.delete_object( Bucket='string', Key='string', MFA='string', VersionId='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', IfMatch='string', IfMatchLastModifiedTime=datetime(2015, 1, 1), IfMatchSize=123 ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name of the bucket containing the object. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Key name of the object to delete. * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. Note: This functionality is not supported for directory buckets. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatch** (*string*) -- The "If-Match" header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a "412 Precondition Failed" error. If the ETag matches or if the object doesn't exist, the operation will return a "204 Success (No Content) response". For more information about conditional requests, see RFC 7232. Note: This functionality is only supported for directory buckets. * **IfMatchLastModifiedTime** (*datetime*) -- If present, the object is deleted only if its modification times matches the provided "Timestamp". If the "Timestamp" values do not match, the operation returns a "412 Precondition Failed" error. If the "Timestamp" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. * **IfMatchSize** (*integer*) -- If present, the object is deleted only if its size matches the provided size in bytes. If the "Size" value does not match, the operation returns a "412 Precondition Failed" error. If the "Size" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. Warning: You can use the "If-Match", "x-amz-if-match-last-modified- time" and "x-amz-if-match-size" conditional headers in conjunction with each-other or individually. Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'VersionId': 'string', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Returns the version ID of the delete marker created as a result of the DELETE operation. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example deletes an object from an S3 bucket. response = client.delete_object( Bucket='examplebucket', Key='objectkey.jpg', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } The following example deletes an object from a non-versioned bucket. response = client.delete_object( Bucket='ExampleBucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / head_object head_object *********** S3.Client.head_object(**kwargs) The "HEAD" operation retrieves metadata from an object without returning the object itself. This operation is useful if you're interested only in an object's metadata. Note: A "HEAD" request has the same options as a "GET" operation on an object. The response is identical to the "GET" response except that there is no response body. Because of this, if the "HEAD" request generates an error, it returns a generic code, such as "400 Bad Request", "403 Forbidden", "404 Not Found", "405 Method Not Allowed", "412 Precondition Failed", or "304 Not Modified". It's not possible to retrieve the exact exception of these error codes. Request headers are limited to 8 KB in size. For more information, see Common Request Headers. Permissions * **General purpose bucket permissions** - To use "HEAD", you must have the "s3:GetObject" permission. You need the relevant read object (or version) permission for this operation. For more information, see Actions, resources, and condition keys for Amazon S3 in the *Amazon S3 User Guide*. For more information about the permissions to S3 API operations by S3 resource types, see Required permissions for Amazon S3 API operations in the *Amazon S3 User Guide*. If the object you request doesn't exist, the error that Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" error. * If you don’t have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Forbidden" error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If you enable "x-amz-checksum-mode" in the request and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Encryption Note: Encryption request headers, like "x-amz-server-side-encryption", should not be sent for "HEAD" requests if your object uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3 managed encryption keys (SSE-S3). The "x-amz-server- side-encryption" header is used when you "PUT" an object to S3 and want to specify the encryption method. If you include this header in a "HEAD" request for an object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. It's because the encryption method can't be changed when you retrieve the object. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: **Directory bucket** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*.Versioning * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes "x-amz- delete-marker: true" in the response. * If the specified version is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. Note: * **Directory buckets** - Delete marker is not supported for directory buckets. * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". Note: For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual- hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. The following actions are related to "HeadObject": * GetObject * GetObjectAttributes See also: AWS API Documentation **Request Syntax** response = client.head_object( Bucket='string', IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Key='string', Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), VersionId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket that contains the object. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Key** (*string*) -- **[REQUIRED]** The object key. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **VersionId** (*string*) -- Version ID used to reference a specific version of the object. Note: For directory buckets in this API operation, only the "null" value of the version ID is supported. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'AcceptRanges': 'string', 'Expiration': 'string', 'Restore': 'string', 'ArchiveStatus': 'ARCHIVE_ACCESS'|'DEEP_ARCHIVE_ACCESS', 'LastModified': datetime(2015, 1, 1), 'ContentLength': 123, 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ETag': 'string', 'MissingMeta': 123, 'VersionId': 'string', 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'ContentType': 'string', 'ContentRange': 'string', 'Expires': datetime(2015, 1, 1), 'ExpiresString': 'string', 'WebsiteRedirectLocation': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'Metadata': { 'string': 'string' }, 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', 'PartsCount': 123, 'TagCount': 123, 'ObjectLockMode': 'GOVERNANCE'|'COMPLIANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'ObjectLockLegalHoldStatus': 'ON'|'OFF' } **Response Structure** * *(dict) --* * **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. Note: This functionality is not supported for directory buckets. * **AcceptRanges** *(string) --* Indicates that a range of bytes was specified. * **Expiration** *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **Restore** *(string) --* If the object is an archived object (an object whose storage class is GLACIER), the response includes this header if either the archive restoration is in progress (see RestoreObject or an archive copy is already restored. If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to delete the object copy. For example: "x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 GMT"" If the object restoration is in progress, the header returns the value "ongoing-request="true"". For more information about archiving objects, see Transitioning Objects: General Considerations. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **ArchiveStatus** *(string) --* The archive state of the head object. Note: This functionality is not supported for directory buckets. * **LastModified** *(datetime) --* Date and time when the object was last modified. * **ContentLength** *(integer) --* Size of the body in bytes. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in "CreateMultipartUpload" request. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ETag** *(string) --* An entity tag (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. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. * **CacheControl** *(string) --* Specifies caching behavior along the request/reply chain. * **ContentDisposition** *(string) --* Specifies presentational information for the object. * **ContentEncoding** *(string) --* Indicates 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. * **ContentRange** *(string) --* The portion of the object returned in the response for a "GET" request. * **Expires** *(datetime) --* The date and time at which the object is no longer cacheable. Note: This member has been deprecated. Please use "ExpiresString" instead. * **ExpiresString** *(string) --* The raw, unparsed value of the "Expires" field. * **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. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **Metadata** *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **StorageClass** *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. For more information, see Storage Classes. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ReplicationStatus** *(string) --* Amazon S3 can return this header if your request involves a bucket that is either a source or a destination in a replication rule. In replication, you have a source bucket on which you configure replication and destination bucket or buckets where Amazon S3 stores object replicas. When you request an object ( "GetObject") or object metadata ( "HeadObject") from these buckets, Amazon S3 will return the "x-amz- replication-status" header in the response as follows: * **If requesting an object from the source bucket**, Amazon S3 will return the "x-amz-replication-status" header if the object in your request is eligible for replication. For example, suppose that in your replication configuration, you specify object prefix "TaxDocs" requesting Amazon S3 to replicate objects with key prefix "TaxDocs". Any objects you upload with this key name prefix, for example "TaxDocs/document1.pdf", are eligible for replication. For any object request with this key name prefix, Amazon S3 will return the "x-amz-replication- status" header with value PENDING, COMPLETED or FAILED indicating object replication status. * **If requesting an object from a destination bucket**, Amazon S3 will return the "x-amz-replication-status" header with value REPLICA if the object in your request is a replica that Amazon S3 created and there is no replica modification replication in progress. * **When replicating objects to multiple destination buckets**, the "x-amz-replication-status" header acts differently. The header of the source object will only return a value of COMPLETED when replication is successful to all destinations. The header will remain at value PENDING until replication has completed for all destinations. If one or more destinations fails replication the header will return FAILED. For more information, see Replication. Note: This functionality is not supported for directory buckets. * **PartsCount** *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. * **TagCount** *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** *(string) --* The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester has the "s3:GetObjectRetention" permission. For more information about S3 Object Lock, see Object Lock. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date and time when the Object Lock retention period expires. This header is only returned if the requester has the "s3:GetObjectRetention" permission. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** *(string) --* Specifies whether a legal hold is in effect for this object. This header is only returned if the requester has the "s3:GetObjectLegalHold" permission. This header is not returned if the specified version of this object has never had a legal hold applied. For more information about S3 Object Lock, see Object Lock. Note: This functionality is not supported for directory buckets. **Exceptions** * "S3.Client.exceptions.NoSuchKey" **Examples** The following example retrieves an object metadata. response = client.head_object( Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'AcceptRanges': 'bytes', 'ContentLength': '3191', 'ContentType': 'image/jpeg', 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'LastModified': datetime(2016, 12, 15, 1, 19, 41, 3, 350, 0), 'Metadata': { }, 'VersionId': 'null', 'ResponseMetadata': { '...': '...', }, } S3 / Client / download_fileobj download_fileobj **************** S3.Client.download_fileobj(Bucket, Key, Fileobj, ExtraArgs=None, Callback=None, Config=None) Download an object from S3 to a file-like object. The file-like object must be in binary mode. This is a managed transfer which will perform a multipart download in multiple threads if necessary. Usage: import boto3 s3 = boto3.client('s3') with open('filename', 'wb') as data: s3.download_fileobj('amzn-s3-demo-bucket', 'mykey', data) Parameters: * **Bucket** (*str*) -- The name of the bucket to download from. * **Key** (*str*) -- The name of the key to download from. * **Fileobj** (*a file-like object*) -- A file-like object to download into. At a minimum, it must implement the *write* method and must accept bytes. * **ExtraArgs** (*dict*) -- Extra arguments that may be passed to the client operation. For allowed download arguments see "boto3.s3.transfer.S3Transfer.ALLOWED_DOWNLOAD_ARGS". * **Callback** (*function*) -- A method which takes a number of bytes transferred to be periodically called during the download. * **Config** (*boto3.s3.transfer.TransferConfig*) -- The transfer configuration to be used when performing the download. S3 / Client / delete_bucket_intelligent_tiering_configuration delete_bucket_intelligent_tiering_configuration *********************************************** S3.Client.delete_bucket_intelligent_tiering_configuration(**kwargs) Note: This operation is not supported for directory buckets. Deletes the S3 Intelligent-Tiering configuration from the specified bucket. The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost- effective storage access tier, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings in three low latency and high throughput access tiers. To get the lowest storage cost on data that can be accessed in minutes to hours, you can choose to activate additional archiving capabilities. The S3 Intelligent-Tiering storage class is the ideal storage class for data with unknown, changing, or unpredictable access patterns, independent of object size or retention period. If the size of an object is less than 128 KB, it is not monitored and not eligible for auto-tiering. Smaller objects can be stored, but they are always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering storage class. For more information, see Storage class for automatically optimizing frequently and infrequently accessed objects. Operations related to "DeleteBucketIntelligentTieringConfiguration" include: * GetBucketIntelligentTieringConfiguration * PutBucketIntelligentTieringConfiguration * ListBucketIntelligentTieringConfigurations See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_intelligent_tiering_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the Amazon S3 bucket whose configuration you want to modify or retrieve. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the S3 Intelligent-Tiering configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / write_get_object_response write_get_object_response ************************* S3.Client.write_get_object_response(**kwargs) Note: This operation is not supported for directory buckets. Passes transformed objects to a "GetObject" operation when using Object Lambda access points. For information about Object Lambda access points, see Transforming objects with Object Lambda access points in the *Amazon S3 User Guide*. This operation supports metadata that can be returned by GetObject, in addition to "RequestRoute", "RequestToken", "StatusCode", "ErrorCode", and "ErrorMessage". The "GetObject" response metadata is supported so that the "WriteGetObjectResponse" caller, typically an Lambda function, can provide the same metadata when it internally invokes "GetObject". When "WriteGetObjectResponse" is called by a customer-owned Lambda function, the metadata returned to the end user "GetObject" call might differ from what Amazon S3 would normally return. You can include any number of metadata headers. When including a metadata header, it should be prefaced with "x-amz-meta". For example, "x-amz-meta-my-custom-header: MyCustomValue". The primary use case for this is to forward "GetObject" metadata. Amazon Web Services provides some prebuilt Lambda functions that you can use with S3 Object Lambda to detect and redact personally identifiable information (PII) and decompress S3 objects. These Lambda functions are available in the Amazon Web Services Serverless Application Repository, and can be selected through the Amazon Web Services Management Console when you create your Object Lambda access point. Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, a natural language processing (NLP) service using machine learning to find insights and relationships in text. It automatically detects personally identifiable information (PII) such as names, addresses, dates, credit card numbers, and social security numbers from documents in your Amazon S3 bucket. Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a natural language processing (NLP) service using machine learning to find insights and relationships in text. It automatically redacts personally identifiable information (PII) such as names, addresses, dates, credit card numbers, and social security numbers from documents in your Amazon S3 bucket. Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, is equipped to decompress objects stored in S3 in one of six compressed file formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. For information on how to view and use these functions, see Using Amazon Web Services built Lambda functions in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.write_get_object_response( RequestRoute='string', RequestToken='string', Body=b'bytes'|file, StatusCode=123, ErrorCode='string', ErrorMessage='string', AcceptRanges='string', CacheControl='string', ContentDisposition='string', ContentEncoding='string', ContentLanguage='string', ContentLength=123, ContentRange='string', ContentType='string', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', DeleteMarker=True|False, ETag='string', Expires=datetime(2015, 1, 1), Expiration='string', LastModified=datetime(2015, 1, 1), MissingMeta=123, Metadata={ 'string': 'string' }, ObjectLockMode='GOVERNANCE'|'COMPLIANCE', ObjectLockLegalHoldStatus='ON'|'OFF', ObjectLockRetainUntilDate=datetime(2015, 1, 1), PartsCount=123, ReplicationStatus='COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', RequestCharged='requester', Restore='string', ServerSideEncryption='AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', SSECustomerAlgorithm='string', SSEKMSKeyId='string', StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', TagCount=123, VersionId='string', BucketKeyEnabled=True|False ) Parameters: * **RequestRoute** (*string*) -- **[REQUIRED]** Route prefix to the HTTP URL generated. * **RequestToken** (*string*) -- **[REQUIRED]** A single use encrypted token that maps "WriteGetObjectResponse" to the end user "GetObject" request. * **Body** (*bytes** or **seekable file-like object*) -- The object data. * **StatusCode** (*integer*) -- The integer status code for an HTTP response of a corresponding "GetObject" request. The following is a list of status codes. * "200 - OK" * "206 - Partial Content" * "304 - Not Modified" * "400 - Bad Request" * "401 - Unauthorized" * "403 - Forbidden" * "404 - Not Found" * "405 - Method Not Allowed" * "409 - Conflict" * "411 - Length Required" * "412 - Precondition Failed" * "416 - Range Not Satisfiable" * "500 - Internal Server Error" * "503 - Service Unavailable" * **ErrorCode** (*string*) -- A string that uniquely identifies an error condition. Returned in the tag of the error XML response for a corresponding "GetObject" call. Cannot be used with a successful "StatusCode" header or when the transformed object is provided in the body. All error codes from S3 are sentence-cased. The regular expression (regex) value is ""^[A-Z][a-zA-Z]+$"". * **ErrorMessage** (*string*) -- Contains a generic description of the error condition. Returned in the tag of the error XML response for a corresponding "GetObject" call. Cannot be used with a successful "StatusCode" header or when the transformed object is provided in body. * **AcceptRanges** (*string*) -- Indicates that a range of bytes was specified. * **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*) -- The size of the content body in bytes. * **ContentRange** (*string*) -- The portion of the object returned in the response. * **ContentType** (*string*) -- A standard MIME type describing the format of the object data. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 32-bit "CRC32" checksum of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the original "GetObject" request required checksum validation. For more information about checksums, see Checking object integrity in the *Amazon S3 User Guide*. Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the original "GetObject" request required checksum validation. For more information about checksums, see Checking object integrity in the *Amazon S3 User Guide*. Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 160-bit "SHA1" digest of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the original "GetObject" request required checksum validation. For more information about checksums, see Checking object integrity in the *Amazon S3 User Guide*. Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This specifies the Base64 encoded, 256-bit "SHA256" digest of the object returned by the Object Lambda function. This may not match the checksum for the object stored in Amazon S3. Amazon S3 will perform validation of the checksum values only when the original "GetObject" request required checksum validation. For more information about checksums, see Checking object integrity in the *Amazon S3 User Guide*. Only one checksum header can be specified at a time. If you supply multiple checksum headers, this request will fail. * **DeleteMarker** (*boolean*) -- Specifies whether an object stored in Amazon S3 is ( "true") or is not ( "false") a delete marker. To learn more about delete markers, see Working with delete markers. * **ETag** (*string*) -- An opaque identifier assigned by a web server to a specific version of a resource found at a URL. * **Expires** (*datetime*) -- The date and time at which the object is no longer cacheable. * **Expiration** (*string*) -- 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 that provide the object expiration information. The value of the "rule-id" is URL-encoded. * **LastModified** (*datetime*) -- The date and time that the object was last modified. * **MissingMeta** (*integer*) -- 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. * **Metadata** (*dict*) -- A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **ObjectLockMode** (*string*) -- Indicates whether an object stored in Amazon S3 has Object Lock enabled. For more information about S3 Object Lock, see Object Lock. * **ObjectLockLegalHoldStatus** (*string*) -- Indicates whether an object stored in Amazon S3 has an active legal hold. * **ObjectLockRetainUntilDate** (*datetime*) -- The date and time when Object Lock is configured to expire. * **PartsCount** (*integer*) -- The count of parts this object has. * **ReplicationStatus** (*string*) -- Indicates if request involves bucket that is either a source or destination in a Replication rule. For more information about S3 Replication, see Replication. * **RequestCharged** (*string*) -- If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **Restore** (*string*) -- Provides information about object restoration operation and expiration time of the restored object copy. * **ServerSideEncryption** (*string*) -- The server-side encryption algorithm used when storing requested object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **SSECustomerAlgorithm** (*string*) -- Encryption algorithm used if server-side encryption with a customer-provided encryption key was specified for object stored in Amazon S3. * **SSEKMSKeyId** (*string*) -- If present, specifies the ID (Key ID, Key ARN, or Key Alias) of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric encryption customer managed key that was used for stored in Amazon S3 object. * **SSECustomerKeyMD5** (*string*) -- 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 to encrypt data stored in S3. For more information, see Protecting data using server-side encryption with customer-provided encryption keys (SSE-C). Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **StorageClass** (*string*) -- Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. For more information, see Storage Classes. * **TagCount** (*integer*) -- The number of tags, if any, on the object. * **VersionId** (*string*) -- An ID used to reference a specific version of the object. * **BucketKeyEnabled** (*boolean*) -- Indicates whether the object stored in Amazon S3 uses an S3 bucket key for server- side encryption with Amazon Web Services KMS (SSE-KMS). Returns: None S3 / Client / complete_multipart_upload complete_multipart_upload ************************* S3.Client.complete_multipart_upload(**kwargs) Completes a multipart upload by assembling previously uploaded parts. You first initiate the multipart upload and then upload all parts using the UploadPart operation or the UploadPartCopy operation. After successfully uploading all relevant parts of an upload, you call this "CompleteMultipartUpload" operation 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 CompleteMultipartUpload request, you must provide the parts list and ensure that the parts list is complete. The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list, you must provide the "PartNumber" value and the "ETag" value that are returned after that part was uploaded. The processing of a CompleteMultipartUpload request could take several minutes to finalize. 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. A request could fail after the initial "200 OK" response has been sent. This means that a "200 OK" response can contain either a success or an error. The error response might be embedded in the "200 OK" response. If you call this API operation directly, make sure to design your application to parse the contents of the response and handle it appropriately. If you use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply error handling per your configuration settings (including automatically retrying the request as appropriate). If the condition persists, the SDKs throw an exception (or, for the SDKs that don't use exceptions, they return an error). Note that if "CompleteMultipartUpload" fails, applications should be prepared to retry any failed requests (including 500 error responses). For more information, see Amazon S3 Error Best Practices. Warning: You can't use "Content-Type: application/x-www-form-urlencoded" for the CompleteMultipartUpload requests. Also, if you don't provide a "Content-Type" header, "CompleteMultipartUpload" can still return a "200 OK" response. For more information about multipart uploads, see Uploading Objects Using Multipart Upload in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions in the *Amazon S3 User Guide*. If you provide an additional checksum value in your "MultipartUpload" requests and the object is encrypted with Key Management Service, you must have permission to use the "kms:Decrypt" action for the "CompleteMultipartUpload" request to succeed. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Special errors * Error Code: "EntityTooSmall" * 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. * HTTP Status Code: 400 Bad Request * Error Code: "InvalidPart" * Description: One or more of the specified parts could not be found. The part might not have been uploaded, or the specified ETag might not have matched the uploaded part's ETag. * HTTP Status Code: 400 Bad Request * Error Code: "InvalidPartOrder" * Description: The list of parts was not in ascending order. The parts list must be specified in order by part number. * HTTP Status Code: 400 Bad Request * Error Code: "NoSuchUpload" * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * HTTP Status Code: 404 Not Found HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "CompleteMultipartUpload": * CreateMultipartUpload * UploadPart * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = client.complete_multipart_upload( Bucket='string', Key='string', MultipartUpload={ 'Parts': [ { 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'PartNumber': 123 }, ] }, UploadId='string', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', ChecksumType='COMPOSITE'|'FULL_OBJECT', MpuObjectSize=123, RequestPayer='requester', ExpectedBucketOwner='string', IfMatch='string', IfNoneMatch='string', SSECustomerAlgorithm='string', SSECustomerKey='string', ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** Name of the bucket to which the multipart upload was initiated. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Object key for which the multipart upload was initiated. * **MultipartUpload** (*dict*) -- The container for the multipart upload request information. * **Parts** *(list) --* Array of CompletedPart data types. If you do not supply a valid "Part" with your request, the service sends back an HTTP 400 response. * *(dict) --* Details of the parts that were uploaded. * **ETag** *(string) --* Entity tag returned when the part was uploaded. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC32" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC32C" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the part. This checksum is present if the multipart upload request was created with the "CRC64NVME" checksum algorithm to the uploaded object). For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" checksum of the part. This checksum is present if the multipart upload request was created with the "SHA1" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" checksum of the part. This checksum is present if the multipart upload request was created with the "SHA256" checksum algorithm. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **PartNumber** *(integer) --* Part number that identifies the part. This is a positive integer between 1 and 10,000. Note: * **General purpose buckets** - In "CompleteMultipartUpload", when a additional checksum (including "x-amz-checksum-crc32", "x-amz- checksum-crc32c", "x-amz-checksum-sha1", or "x-amz- checksum-sha256") is applied to each part, the "PartNumber" must start at 1 and the part numbers must be consecutive. Otherwise, Amazon S3 generates an HTTP "400 Bad Request" status code and an "InvalidPartOrder" error code. * **Directory buckets** - In "CompleteMultipartUpload", the "PartNumber" must start at 1 and the part numbers must be consecutive. * **UploadId** (*string*) -- **[REQUIRED]** ID for the initiated multipart upload. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** (*string*) -- This header specifies the checksum type of the object, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum that was specified. If the checksum type doesn’t match the checksum type that was specified for the object during the "CreateMultipartUpload" request, it’ll result in a "BadDigest" error. For more information, see Checking object integrity in the Amazon S3 User Guide. * **MpuObjectSize** (*integer*) -- The expected total object size of the multipart upload request. If there’s a mismatch between the specified object size value and the actual object size value, it results in an "HTTP 400 InvalidRequest" error. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatch** (*string*) -- Uploads the object only if the ETag (entity tag) value provided during the WRITE operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should fetch the object's ETag, re-initiate the multipart upload with "CreateMultipartUpload", and re-upload each part. Expects the ETag value as a string. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **IfNoneMatch** (*string*) -- Uploads the object only if the object key name does not already exist in the bucket specified. Otherwise, Amazon S3 returns a "412 Precondition Failed" error. If a conflicting operation occurs during the upload S3 returns a "409 ConditionalRequestConflict" response. On a 409 failure you should re-initiate the multipart upload with "CreateMultipartUpload" and re-upload each part. Expects the '*' (asterisk) character. For more information about conditional requests, see RFC 7232, or Conditional requests in the *Amazon S3 User Guide*. * **SSECustomerAlgorithm** (*string*) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is required only when the object was created using a checksum algorithm or if your bucket policy requires the use of SSE-C. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required Return type: dict Returns: **Response Syntax** { 'Location': 'string', 'Bucket': 'string', 'Key': 'string', 'Expiration': 'string', 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'VersionId': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Location** *(string) --* The URI that identifies the newly created object. * **Bucket** *(string) --* The name of the bucket that contains the newly created object. Does not return the access point ARN or access point alias if used. Note: Access points are not supported by directory buckets. * **Key** *(string) --* The object key of the newly created object. * **Expiration** *(string) --* 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. Note: This functionality is not supported for directory buckets. * **ETag** *(string) --* Entity tag that identifies the newly created object's data. Objects with different object data will have different entity tags. The entity tag is an opaque string. The entity tag may or may not be an MD5 digest of the object data. If the entity tag is not an MD5 digest of the object data, it will contain one or more nonhexadecimal characters and/or will consist of less than 32 or more than 32 hexadecimal digits. For more information about how the entity tag is calculated, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the object. The "CRC64NVME" checksum is always a full object checksum. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header as a data integrity check to verify that the checksum type that is received is the same checksum type that was specified during the "CreateMultipartUpload" request. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when storing this object in Amazon S3. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **VersionId** *(string) --* Version ID of the newly created object, in case the bucket has versioning turned on. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example completes a multipart upload. response = client.complete_multipart_upload( Bucket='examplebucket', Key='bigobject', MultipartUpload={ 'Parts': [ { 'ETag': '"d8c2eafd90c266e19ab9dcacc479f8af"', 'PartNumber': '1', }, { 'ETag': '"d8c2eafd90c266e19ab9dcacc479f8af"', 'PartNumber': '2', }, ], }, UploadId='7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--', ) print(response) Expected Output: { 'Bucket': 'acexamplebucket', 'ETag': '"4d9031c7644d8081c2829f4ea23c55f7-2"', 'Key': 'bigobject', 'Location': 'https://examplebucket.s3.amazonaws.com/bigobject', 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_accelerate_configuration get_bucket_accelerate_configuration *********************************** S3.Client.get_bucket_accelerate_configuration(**kwargs) Note: This operation is not supported for directory buckets. This implementation of the GET action uses the "accelerate" subresource to return the Transfer Acceleration state of a bucket, which is either "Enabled" or "Suspended". Amazon S3 Transfer Acceleration is a bucket-level feature that enables you to perform faster data transfers to and from Amazon S3. To use this operation, you must have permission to perform the "s3:GetAccelerateConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to your Amazon S3 Resources in the *Amazon S3 User Guide*. You set the Transfer Acceleration state of an existing bucket to "Enabled" or "Suspended" by using the PutBucketAccelerateConfiguration operation. A GET "accelerate" request does not return a state value for a bucket that has no transfer acceleration state. A bucket has no Transfer Acceleration state if a state has never been set on the bucket. For more information about transfer acceleration, see Transfer Acceleration in the Amazon S3 User Guide. The following operations are related to "GetBucketAccelerateConfiguration": * PutBucketAccelerateConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_accelerate_configuration( Bucket='string', ExpectedBucketOwner='string', RequestPayer='requester' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which the accelerate configuration is retrieved. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Return type: dict Returns: **Response Syntax** { 'Status': 'Enabled'|'Suspended', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Status** *(string) --* The accelerate configuration of the bucket. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. S3 / Client / list_multipart_uploads list_multipart_uploads ********************** S3.Client.list_multipart_uploads(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. This operation lists in-progress multipart uploads in a bucket. An in-progress multipart upload is a multipart upload that has been initiated by the "CreateMultipartUpload" request, but has not yet been completed or aborted. Note: **Directory buckets** - If multipart uploads in a directory bucket are in progress, you can't delete the bucket until all the in-progress multipart uploads are aborted or completed. To delete these in-progress multipart uploads, use the "ListMultipartUploads" operation to list the in-progress multipart uploads in the bucket and use the "AbortMultipartUpload" operation to abort all the in-progress multipart uploads. The "ListMultipartUploads" operation returns a maximum of 1,000 multipart uploads in the response. The limit of 1,000 multipart uploads is also the default value. You can further limit the number of uploads in a response by specifying the "max-uploads" request parameter. If there are more than 1,000 multipart uploads that satisfy your "ListMultipartUploads" request, the response returns an "IsTruncated" element with the value of "true", a "NextKeyMarker" element, and a "NextUploadIdMarker" element. To list the remaining multipart uploads, you need to make subsequent "ListMultipartUploads" requests. In these requests, include two query parameters: "key-marker" and "upload-id-marker". Set the value of "key-marker" to the "NextKeyMarker" value from the previous response. Similarly, set the value of "upload-id-marker" to the "NextUploadIdMarker" value from the previous response. Note: **Directory buckets** - The "upload-id-marker" element and the "NextUploadIdMarker" element aren't supported by directory buckets. To list the additional multipart uploads, you only need to set the value of "key-marker" to the "NextKeyMarker" value from the previous response. For more information about multipart uploads, see Uploading Objects Using Multipart Upload in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. Sorting of multipart uploads in response * **General purpose bucket** - In the "ListMultipartUploads" response, the multipart uploads are sorted based on two criteria: * Key-based sorting - Multipart uploads are initially sorted in ascending order based on their object keys. * Time-based sorting - For uploads that share the same object key, they are further sorted in ascending order based on the upload initiation time. Among uploads with the same key, the one that was initiated first will appear before the ones that were initiated later. * **Directory bucket** - In the "ListMultipartUploads" response, the multipart uploads aren't sorted lexicographically based on the object keys. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "ListMultipartUploads": * CreateMultipartUpload * UploadPart * CompleteMultipartUpload * ListParts * AbortMultipartUpload See also: AWS API Documentation **Request Syntax** response = client.list_multipart_uploads( Bucket='string', Delimiter='string', EncodingType='url', KeyMarker='string', MaxUploads=123, Prefix='string', UploadIdMarker='string', ExpectedBucketOwner='string', RequestPayer='requester' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to which the multipart upload was initiated. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Delimiter** (*string*) -- Character you use to group keys. All keys that contain the same string between the prefix, if specified, and the first occurrence of the delimiter after the prefix are grouped under a single result element, "CommonPrefixes". If you don't specify the prefix parameter, then the substring starts at the beginning of the key. The keys that are grouped under "CommonPrefixes" result element are not returned elsewhere in the response. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent-encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **KeyMarker** (*string*) -- Specifies the multipart upload after which listing should begin. Note: * **General purpose buckets** - For general purpose buckets, "key-marker" is an object key. Together with "upload-id- marker", this parameter specifies the multipart upload after which listing should begin. If "upload-id-marker" is not specified, only the keys lexicographically greater than the specified "key-marker" will be included in the list. If "upload-id-marker" is specified, any multipart uploads for a key equal to the "key-marker" might also be included, provided those multipart uploads have upload IDs lexicographically greater than the specified "upload-id- marker". * **Directory buckets** - For directory buckets, "key- marker" is obfuscated and isn't a real object key. The "upload-id-marker" parameter isn't supported by directory buckets. To list the additional multipart uploads, you only need to set the value of "key-marker" to the "NextKeyMarker" value from the previous response. In the "ListMultipartUploads" response, the multipart uploads aren't sorted lexicographically based on the object keys. * **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. You can use prefixes to separate a bucket into different grouping of keys. (You can think of using "prefix" to make groups in the same way that you'd use a folder in a file system.) Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **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. Otherwise, any multipart uploads for a key equal to the key-marker might be included in the list only if they have an upload ID lexicographically greater than the specified "upload-id- marker". Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Return type: dict Returns: **Response Syntax** { 'Bucket': 'string', 'KeyMarker': 'string', 'UploadIdMarker': 'string', 'NextKeyMarker': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'NextUploadIdMarker': 'string', 'MaxUploads': 123, 'IsTruncated': True|False, 'Uploads': [ { 'UploadId': 'string', 'Key': 'string', 'Initiated': datetime(2015, 1, 1), 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Initiator': { 'ID': 'string', 'DisplayName': 'string' }, 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT' }, ], 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **Bucket** *(string) --* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or access point alias if used. * **KeyMarker** *(string) --* The key at or after which the listing began. * **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. Otherwise, any multipart uploads for a key equal to the key- marker might be included in the list only if they have an upload ID lexicographically greater than the specified "upload-id-marker". Note: This functionality is not supported for directory buckets. * **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. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * **Delimiter** *(string) --* Contains the delimiter you specified in the request. If you don't specify a delimiter in your request, this element is absent from the response. Note: **Directory buckets** - For directory buckets, "/" is the only supported delimiter. * **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. Note: This functionality is not supported for directory buckets. * **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** *(list) --* Container for elements related to a particular multipart upload. A response can contain zero or more "Upload" elements. * *(dict) --* Container for the "MultipartUpload" for the Amazon S3 object. * **UploadId** *(string) --* Upload ID that identifies the multipart upload. * **Key** *(string) --* Key of the object for which the multipart upload was initiated. * **Initiated** *(datetime) --* Date and time at which the multipart upload was initiated. * **StorageClass** *(string) --* The class of storage used to store the object. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **Owner** *(dict) --* Specifies the owner of the object that is part of the multipart upload. Note: **Directory buckets** - The bucket owner is returned as the object owner for all the objects. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **Initiator** *(dict) --* Identifies who initiated the multipart upload. * **ID** *(string) --* If the principal is an Amazon Web Services account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value. Note: **Directory buckets** - If the principal is an Amazon Web Services account, it provides the Amazon Web Services account ID. If the principal is an IAM User, it provides a user ARN value. * **DisplayName** *(string) --* Name of the Principal. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** *(string) --* The algorithm that was used to create a checksum of the object. * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **CommonPrefixes** *(list) --* If you specify a delimiter in the request, then the result returns each distinct key prefix containing the delimiter in a "CommonPrefixes" element. The distinct key prefixes are returned in the "Prefix" child element. Note: **Directory buckets** - For directory buckets, only prefixes that end in a delimiter ( "/") are supported. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode object keys in the response. If you specify the "encoding-type" request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements: "Delimiter", "KeyMarker", "Prefix", "NextKeyMarker", "Key". * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example lists in-progress multipart uploads on a specific bucket. response = client.list_multipart_uploads( Bucket='examplebucket', ) print(response) Expected Output: { 'Uploads': [ { 'Initiated': datetime(2014, 5, 1, 5, 40, 58, 3, 121, 0), 'Initiator': { 'DisplayName': 'display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Key': 'JavaFile', 'Owner': { 'DisplayName': 'display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'StorageClass': 'STANDARD', 'UploadId': 'examplelUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--', }, { 'Initiated': datetime(2014, 5, 1, 5, 41, 27, 3, 121, 0), 'Initiator': { 'DisplayName': 'display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Key': 'JavaFile', 'Owner': { 'DisplayName': 'display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'StorageClass': 'STANDARD', 'UploadId': 'examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--', }, ], 'ResponseMetadata': { '...': '...', }, } The following example specifies the upload-id-marker and key-marker from previous truncated response to retrieve next setup of multipart uploads. response = client.list_multipart_uploads( Bucket='examplebucket', KeyMarker='nextkeyfrompreviousresponse', MaxUploads='2', UploadIdMarker='valuefrompreviousresponse', ) print(response) Expected Output: { 'Bucket': 'acl1', 'IsTruncated': True, 'KeyMarker': '', 'MaxUploads': '2', 'NextKeyMarker': 'someobjectkey', 'NextUploadIdMarker': 'examplelo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--', 'UploadIdMarker': '', 'Uploads': [ { 'Initiated': datetime(2014, 5, 1, 5, 40, 58, 3, 121, 0), 'Initiator': { 'DisplayName': 'ownder-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Key': 'JavaFile', 'Owner': { 'DisplayName': 'mohanataws', 'ID': '852b113e7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'StorageClass': 'STANDARD', 'UploadId': 'gZ30jIqlUa.CInXklLQtSMJITdUnoZ1Y5GACB5UckOtspm5zbDMCkPF_qkfZzMiFZ6dksmcnqxJyIBvQMG9X9Q--', }, { 'Initiated': datetime(2014, 5, 1, 5, 41, 27, 3, 121, 0), 'Initiator': { 'DisplayName': 'ownder-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Key': 'JavaFile', 'Owner': { 'DisplayName': 'ownder-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'StorageClass': 'STANDARD', 'UploadId': 'b7tZSqIlo91lv1iwvWpvCiJWugw2xXLPAD7Z8cJyX9.WiIRgNrdG6Ldsn.9FtS63TCl1Uf5faTB.1U5Ckcbmdw--', }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / update_bucket_metadata_journal_table_configuration update_bucket_metadata_journal_table_configuration ************************************************** S3.Client.update_bucket_metadata_journal_table_configuration(**kwargs) Enables or disables journal table record expiration for an S3 Metadata configuration on a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the *Amazon S3 User Guide*. Permissions To use this operation, you must have the "s3:UpdateBucketMetadataJournalTableConfiguration" permission. For more information, see Setting up permissions for configuring metadata tables in the *Amazon S3 User Guide*. The following operations are related to "UpdateBucketMetadataJournalTableConfiguration": * CreateBucketMetadataConfiguration * DeleteBucketMetadataConfiguration * GetBucketMetadataConfiguration * UpdateBucketMetadataInventoryTableConfiguration See also: AWS API Documentation **Request Syntax** response = client.update_bucket_metadata_journal_table_configuration( Bucket='string', ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', JournalTableConfiguration={ 'RecordExpiration': { 'Expiration': 'ENABLED'|'DISABLED', 'Days': 123 } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The general purpose bucket that corresponds to the metadata configuration that you want to enable or disable journal table record expiration for. * **ContentMD5** (*string*) -- The "Content-MD5" header for the journal table configuration. * **ChecksumAlgorithm** (*string*) -- The checksum algorithm to use with your journal table configuration. * **JournalTableConfiguration** (*dict*) -- **[REQUIRED]** The contents of your journal table configuration. * **RecordExpiration** *(dict) --* **[REQUIRED]** The journal table record expiration settings for the journal table. * **Expiration** *(string) --* **[REQUIRED]** Specifies whether journal table record expiration is enabled or disabled. * **Days** *(integer) --* If you enable journal table record expiration, you can set the number of days to retain your journal table records. Journal table records must be retained for a minimum of 7 days. To set this value, specify any whole number from "7" to "2147483647". For example, to retain your journal table records for one year, set this value to "365". * **ExpectedBucketOwner** (*string*) -- The expected owner of the general purpose bucket that corresponds to the metadata table configuration that you want to enable or disable journal table record expiration for. Returns: None S3 / Client / list_object_versions list_object_versions ******************** S3.Client.list_object_versions(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will stop returning "DisplayName". Update your applications to use canonical IDs (unique identifier for Amazon Web Services accounts), Amazon Web Services account ID (12 digit identifier) or IAM ARNs (full resource naming) as a direct replacement of "DisplayName".This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Returns metadata about all versions of the objects in a bucket. You can also use request parameters as selection criteria to return metadata about a subset of all the object versions. Warning: To use this operation, you must have permission to perform the "s3:ListBucketVersions" action. Be aware of the name difference. Note: A "200 OK" response can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately. To use this operation, you must have READ access to the bucket. The following operations are related to "ListObjectVersions": * ListObjectsV2 * GetObject * PutObject * DeleteObject See also: AWS API Documentation **Request Syntax** response = client.list_object_versions( Bucket='string', Delimiter='string', EncodingType='url', KeyMarker='string', MaxKeys=123, Prefix='string', VersionIdMarker='string', ExpectedBucketOwner='string', RequestPayer='requester', OptionalObjectAttributes=[ 'RestoreStatus', ] ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name that contains the objects. * **Delimiter** (*string*) -- A delimiter is a character that you specify to group keys. All keys that contain the same string between the "prefix" and the first occurrence of the delimiter are grouped under a single result element in "CommonPrefixes". These groups are counted as one result against the "max-keys" limitation. These keys are not returned elsewhere in the response. "CommonPrefixes" is filtered out from results if it is not lexicographically greater than the key-marker. * **EncodingType** (*string*) -- Encoding type used by Amazon S3 to encode the object keys in the response. Responses are encoded only in UTF-8. An object key can contain any Unicode character. However, the XML 1.0 parser can't parse certain characters, such as characters with an ASCII value from 0 to 10. For characters that aren't supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response. For more information about characters to avoid in object key names, see Object key naming guidelines. Note: When using the URL encoding type, non-ASCII characters that are used in an object's key name will be percent-encoded according to UTF-8 code values. For example, the object "test_file(3).png" will appear as "test_file%283%29.png". * **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. By default, the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more. If additional keys satisfy the search criteria, but were not returned because "max-keys" was exceeded, the response contains "true". To return the additional keys, see "key-marker" and "version-id-marker". * **Prefix** (*string*) -- Use this parameter to select only those keys that begin with the specified prefix. You can use prefixes to separate a bucket into different groupings of keys. (You can think of using "prefix" to make groups in the same way that you'd use a folder in a file system.) You can use "prefix" with "delimiter" to roll up numerous objects into a single result under "CommonPrefixes". * **VersionIdMarker** (*string*) -- Specifies the object version you want to start listing from. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **OptionalObjectAttributes** (*list*) -- Specifies the optional fields that you want returned in the response. Fields that you do not specify are not returned. * *(string) --* Return type: dict Returns: **Response Syntax** { 'IsTruncated': True|False, 'KeyMarker': 'string', 'VersionIdMarker': 'string', 'NextKeyMarker': 'string', 'NextVersionIdMarker': 'string', 'Versions': [ { 'ETag': 'string', 'ChecksumAlgorithm': [ 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ], 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'Size': 123, 'StorageClass': 'STANDARD', 'Key': 'string', 'VersionId': 'string', 'IsLatest': True|False, 'LastModified': datetime(2015, 1, 1), 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'RestoreStatus': { 'IsRestoreInProgress': True|False, 'RestoreExpiryDate': datetime(2015, 1, 1) } }, ], 'DeleteMarkers': [ { 'Owner': { 'DisplayName': 'string', 'ID': 'string' }, 'Key': 'string', 'VersionId': 'string', 'IsLatest': True|False, 'LastModified': datetime(2015, 1, 1) }, ], 'Name': 'string', 'Prefix': 'string', 'Delimiter': 'string', 'MaxKeys': 123, 'CommonPrefixes': [ { 'Prefix': 'string' }, ], 'EncodingType': 'url', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **IsTruncated** *(boolean) --* A flag that indicates whether 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 by 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) --* Marks the last version of the key returned in a truncated response. * **NextKeyMarker** *(string) --* When the number of responses exceeds the value of "MaxKeys", "NextKeyMarker" specifies the first key not returned that satisfies the search criteria. Use this value for the key- marker request parameter in a subsequent request. * **NextVersionIdMarker** *(string) --* When the number of responses exceeds the value of "MaxKeys", "NextVersionIdMarker" specifies the first object version not returned that satisfies the search criteria. Use this value for the "version-id-marker" request parameter in a subsequent request. * **Versions** *(list) --* Container for version information. * *(dict) --* The version of an object. * **ETag** *(string) --* The entity tag is an MD5 hash of that version of the object. * **ChecksumAlgorithm** *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* * **ChecksumType** *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Size** *(integer) --* Size in bytes of the object. * **StorageClass** *(string) --* The class of storage used to store the object. * **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** *(datetime) --* Date and time when the object was last modified. * **Owner** *(dict) --* Specifies the owner of the object. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **RestoreStatus** *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" * **DeleteMarkers** *(list) --* Container for an object that is a delete marker. To learn more about delete markers, see Working with delete markers. * *(dict) --* Information about the delete marker. * **Owner** *(dict) --* The account that created the delete marker. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. * **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** *(datetime) --* Date and time when the object was last modified. * **Name** *(string) --* The bucket name. * **Prefix** *(string) --* Selects objects that start with the value supplied by this parameter. * **Delimiter** *(string) --* The delimiter grouping the included keys. A delimiter is a character that you specify to group keys. All keys that contain the same string between the prefix and the first occurrence of the delimiter are grouped under a single result element in "CommonPrefixes". These groups are counted as one result against the "max-keys" limitation. These keys are not returned elsewhere in the response. * **MaxKeys** *(integer) --* Specifies the maximum number of objects to return. * **CommonPrefixes** *(list) --* All of the keys rolled up into a common prefix count as a single return when calculating the number of returns. * *(dict) --* Container for all (if there are any) keys between Prefix and the next occurrence of the string specified by a delimiter. CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix. For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. * **Prefix** *(string) --* Container for the specified common prefix. * **EncodingType** *(string) --* Encoding type used by Amazon S3 to encode object key names in the XML response. If you specify the "encoding-type" request parameter, Amazon S3 includes this element in the response, and returns encoded key name values in the following response elements: "KeyMarker, NextKeyMarker, Prefix, Key", and "Delimiter". * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example return versions of an object with specific key name prefix. The request limits the number of items returned to two. If there are are more than two object version, S3 returns NextToken in the response. You can specify this token value in your next request to fetch next set of object versions. response = client.list_object_versions( Bucket='examplebucket', Prefix='HappyFace.jpg', ) print(response) Expected Output: { 'Versions': [ { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'IsLatest': True, 'Key': 'HappyFace.jpg', 'LastModified': datetime(2016, 12, 15, 1, 19, 41, 3, 350, 0), 'Owner': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Size': 3191, 'StorageClass': 'STANDARD', 'VersionId': 'null', }, { 'ETag': '"6805f2cfc46c0f04559748bb039d69ae"', 'IsLatest': False, 'Key': 'HappyFace.jpg', 'LastModified': datetime(2016, 12, 13, 0, 58, 26, 1, 348, 0), 'Owner': { 'DisplayName': 'owner-display-name', 'ID': 'examplee7a2f25102679df27bb0ae12b3f85be6f290b936c4393484be31bebcc', }, 'Size': 3191, 'StorageClass': 'STANDARD', 'VersionId': 'PHtexPGjH2y.zBgT8LmB7wwLI2mpbz.k', }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_tagging get_bucket_tagging ****************** S3.Client.get_bucket_tagging(**kwargs) Note: This operation is not supported for directory buckets. Returns the tag set associated with the bucket. To use this operation, you must have permission to perform the "s3:GetBucketTagging" action. By default, the bucket owner has this permission and can grant this permission to others. "GetBucketTagging" has the following special error: * Error code: "NoSuchTagSet" * Description: There is no tag set associated with the bucket. The following operations are related to "GetBucketTagging": * PutBucketTagging * DeleteBucketTagging See also: AWS API Documentation **Request Syntax** response = client.get_bucket_tagging( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the tagging information. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **TagSet** *(list) --* Contains the tag set. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. **Examples** The following example returns tag set associated with a bucket response = client.get_bucket_tagging( Bucket='examplebucket', ) print(response) Expected Output: { 'TagSet': [ { 'Key': 'key1', 'Value': 'value1', }, { 'Key': 'key2', 'Value': 'value2', }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / upload_part upload_part *********** S3.Client.upload_part(**kwargs) Uploads a part in a multipart upload. Note: In this operation, you provide new data as a part of an object in your request. However, you have an option to specify your existing Amazon S3 object as a data source for the part you are uploading. To upload a part from an existing object, you use the UploadPartCopy operation. You must initiate a multipart upload (see CreateMultipartUpload) before you can upload any part. In response to your initiate request, Amazon S3 returns an upload ID, a unique identifier that you must include in your upload part request. Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely identifies a part and also defines its position within the object being created. If you upload a new part using the same part number that was used with a previous part, the previously uploaded part is overwritten. For information about maximum and minimum part sizes and other multipart upload specifications, see Multipart upload limits in the *Amazon S3 User Guide*. 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. For more information on multipart uploads, go to Multipart Upload Overview in the >>*<>*<<. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*.Permissions * **General purpose bucket permissions** - To perform a multipart upload with encryption using an Key Management Service key, the requester must have permission to the "kms:Decrypt" and "kms:GenerateDataKey" actions on the key. The requester must also have permissions for the "kms:GenerateDataKey" action for the "CreateMultipartUpload" API. Then, the requester needs permissions for the "kms:Decrypt" action on the "UploadPart" and "UploadPartCopy" APIs. 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 about KMS permissions, see Protecting data using server-side encryption with KMS in the *Amazon S3 User Guide*. For information about the permissions required to use the multipart upload API, see Multipart upload and permissions and Multipart upload API and permissions in the *Amazon S3 User Guide*. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted with SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Data integrity **General purpose bucket** - To ensure that data is not corrupted traversing the network, specify the "Content-MD5" header in the upload part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match, Amazon S3 returns an error. If the upload request is signed with Signature Version 4, then Amazon Web Services S3 uses the "x-amz-content-sha256" header as a checksum instead of "Content-MD5". For more information see Authenticating Requests: Using the Authorization Header (Amazon Web Services Signature Version 4). Note: **Directory buckets** - MD5 is not supported by directory buckets. You can use checksum algorithms to check object integrity.Encryption * **General purpose bucket** - Server-side encryption is for data encryption at rest. Amazon S3 encrypts your data as it writes it to disks in its data centers and decrypts it when you access it. You have mutually exclusive options to protect data using server- side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS), and Customer-Provided Keys (SSE-C). Amazon S3 encrypts data with server-side encryption using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest using server-side encryption with other key options. The option you use depends on whether you want to use KMS keys (SSE-KMS) or provide your own encryption key (SSE-C). Server-side encryption is supported by the S3 Multipart Upload operations. Unless you are using a customer-provided encryption key (SSE-C), you don't need to specify the encryption parameters in each UploadPart request. Instead, you only need to specify the server-side encryption parameters in the initial Initiate Multipart request. For more information, see CreateMultipartUpload. If you request server-side encryption using a customer-provided encryption key (SSE-C) in your initiate multipart upload request, you must provide identical encryption information in each part upload using the following request headers. * x-amz-server-side-encryption-customer-algorithm * x-amz-server-side-encryption-customer-key * x-amz-server-side-encryption-customer-key-MD5 For more information, see Using Server-Side Encryption in the *Amazon S3 User Guide*. * **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "aws:kms"). Special errors * Error Code: "NoSuchUpload" * Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed. * HTTP Status Code: 404 Not Found * SOAP Fault Code Prefix: Client HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "UploadPart": * CreateMultipartUpload * CompleteMultipartUpload * AbortMultipartUpload * ListParts * ListMultipartUploads See also: AWS API Documentation **Request Syntax** response = client.upload_part( Body=b'bytes'|file, Bucket='string', ContentLength=123, ContentMD5='string', ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ChecksumCRC32='string', ChecksumCRC32C='string', ChecksumCRC64NVME='string', ChecksumSHA1='string', ChecksumSHA256='string', Key='string', PartNumber=123, UploadId='string', SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', ExpectedBucketOwner='string' ) Parameters: * **Body** (*bytes** or **seekable file-like object*) -- Object data. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to which the multipart upload was initiated. **Directory buckets** - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format "Bucket-name.s3express-zone-id.region- code.amazonaws.com". Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format "bucket-base-name--zone-id--x-s3" (for example, "amzn-s3-demo-bucket--usw2-az1--x-s3"). For information about bucket naming restrictions, see Directory bucket naming rules in the *Amazon S3 User Guide*. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. Note: Object Lambda access points are not supported by directory buckets. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **ContentLength** (*integer*) -- Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically. * **ContentMD5** (*string*) -- The Base64 encoded 128-bit MD5 digest of the part data. This parameter is auto-populated when using the command from the CLI. This parameter is required if object lock parameters are specified. Note: This functionality is not supported for directory buckets. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. This checksum algorithm must be the same for all parts and it match the checksum value supplied in the "CreateMultipartUpload" request. * **ChecksumCRC32** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 32-bit "CRC32C" checksum of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 160-bit "SHA1" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** (*string*) -- This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 256-bit "SHA256" digest of the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Object key for which the multipart upload was initiated. * **PartNumber** (*integer*) -- **[REQUIRED]** Part number of part being uploaded. This is a positive integer between 1 and 10,000. * **UploadId** (*string*) -- **[REQUIRED]** Upload ID identifying the multipart upload whose part is being uploaded. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **ETag** *(string) --* Entity tag for the uploaded object. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* This header can be used as a data integrity check to verify that the data received is the same data that was originally sent. This header specifies the Base64 encoded, 64-bit "CRC64NVME" checksum of the part. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. **Examples** The following example uploads part 1 of a multipart upload. The example specifies a file name for the part data. The Upload ID is same that is returned by the initiate multipart upload. response = client.upload_part( Body='fileToUpload', Bucket='examplebucket', Key='examplelargeobject', PartNumber='1', UploadId='xadcOB_7YPBOJuoFiQ9cz4P3Pe6FIZwO4f7wN93uHsNBEw97pl5eNwzExg0LAT2dUN91cOmrEQHDsP3WA60CEg--', ) print(response) Expected Output: { 'ETag': '"d8c2eafd90c266e19ab9dcacc479f8af"', 'ResponseMetadata': { '...': '...', }, } S3 / Client / select_object_content select_object_content ********************* S3.Client.select_object_content(**kwargs) Note: This operation is not supported for directory buckets. This action filters the contents of an Amazon S3 object based on a simple structured query language (SQL) statement. In the request, along with the SQL expression, you must also specify a data serialization format (JSON, CSV, or Apache Parquet) of the object. Amazon S3 uses this format to parse object data into records, and returns only records that match the specified SQL expression. You must also specify the data serialization format for the response. This functionality is not supported for Amazon S3 on Outposts. For more information about Amazon S3 Select, see Selecting Content from Objects and SELECT Command in the *Amazon S3 User Guide*. Permissions You must have the "s3:GetObject" permission for this operation. Amazon S3 Select does not support anonymous access. For more information about permissions, see Specifying Permissions in a Policy in the *Amazon S3 User Guide*. Object Data Formats You can use Amazon S3 Select to query objects that have the following format properties: * *CSV, JSON, and Parquet* - Objects must be in CSV, JSON, or Parquet format. * *UTF-8* - UTF-8 is the only encoding type Amazon S3 Select supports. * *GZIP or BZIP2* - CSV and JSON files can be compressed using GZIP or BZIP2. GZIP and BZIP2 are the only compression formats that Amazon S3 Select supports for CSV and JSON files. Amazon S3 Select supports columnar compression for Parquet using GZIP or Snappy. Amazon S3 Select does not support whole-object compression for Parquet objects. * *Server-side encryption* - Amazon S3 Select supports querying objects that are protected with server-side encryption. For objects that are encrypted with customer-provided encryption keys (SSE-C), you must use HTTPS, and you must use the headers that are documented in the GetObject. For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. For objects that are encrypted with Amazon S3 managed keys (SSE-S3) and Amazon Web Services KMS keys (SSE-KMS), server-side encryption is handled transparently, so you don't need to specify anything. For more information about server-side encryption, including SSE-S3 and SSE-KMS, see Protecting Data Using Server-Side Encryption in the *Amazon S3 User Guide*. Working with the Response Body Given the response size is unknown, Amazon S3 Select streams the response as a series of messages and includes a "Transfer-Encoding" header with "chunked" as its value in the response. For more information, see Appendix: SelectObjectContent Response. GetObject Support The "SelectObjectContent" action does not support the following "GetObject" functionality. For more information, see GetObject. * "Range": Although you can specify a scan range for an Amazon S3 Select request (see SelectObjectContentRequest - ScanRange in the request parameters), you cannot specify the range of bytes of an object to return. * The "GLACIER", "DEEP_ARCHIVE", and "REDUCED_REDUNDANCY" storage classes, or the "ARCHIVE_ACCESS" and "DEEP_ARCHIVE_ACCESS" access tiers of the "INTELLIGENT_TIERING" storage class: You cannot query objects in the "GLACIER", "DEEP_ARCHIVE", or "REDUCED_REDUNDANCY" storage classes, nor objects in the "ARCHIVE_ACCESS" or "DEEP_ARCHIVE_ACCESS" access tiers of the "INTELLIGENT_TIERING" storage class. For more information about storage classes, see Using Amazon S3 storage classes in the *Amazon S3 User Guide*. Special Errors For a list of special errors for this operation, see List of SELECT Object Content Error Codes The following operations are related to "SelectObjectContent": * GetObject * GetBucketLifecycleConfiguration * PutBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.select_object_content( Bucket='string', Key='string', SSECustomerAlgorithm='string', SSECustomerKey='string', Expression='string', ExpressionType='SQL', RequestProgress={ 'Enabled': True|False }, InputSerialization={ 'CSV': { 'FileHeaderInfo': 'USE'|'IGNORE'|'NONE', 'Comments': 'string', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string', 'AllowQuotedRecordDelimiter': True|False }, 'CompressionType': 'NONE'|'GZIP'|'BZIP2', 'JSON': { 'Type': 'DOCUMENT'|'LINES' }, 'Parquet': {} }, OutputSerialization={ 'CSV': { 'QuoteFields': 'ALWAYS'|'ASNEEDED', 'QuoteEscapeCharacter': 'string', 'RecordDelimiter': 'string', 'FieldDelimiter': 'string', 'QuoteCharacter': 'string' }, 'JSON': { 'RecordDelimiter': 'string' } }, ScanRange={ 'Start': 123, 'End': 123 }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The S3 bucket. * **Key** (*string*) -- **[REQUIRED]** The object key. * **SSECustomerAlgorithm** (*string*) -- The server-side encryption (SSE) algorithm used to encrypt the object. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. * **SSECustomerKey** (*string*) -- The server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. * **SSECustomerKeyMD5** (*string*) -- The MD5 server-side encryption (SSE) customer managed key. This parameter is needed only when the object was created using a checksum algorithm. For more information, see Protecting data using SSE-C keys in the *Amazon S3 User Guide*. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **Expression** (*string*) -- **[REQUIRED]** The expression that is used to query the object. * **ExpressionType** (*string*) -- **[REQUIRED]** The type of the provided expression (for example, SQL). * **RequestProgress** (*dict*) -- Specifies if periodic request progress information should be enabled. * **Enabled** *(boolean) --* Specifies whether periodic QueryProgress frames should be sent. Valid values: TRUE, FALSE. Default value: FALSE. * **InputSerialization** (*dict*) -- **[REQUIRED]** Describes the format of the data in the object that is being queried. * **CSV** *(dict) --* Describes the serialization of a CSV-encoded object. * **FileHeaderInfo** *(string) --* Describes the first line of input. Valid values are: * "NONE": First line is not a header. * "IGNORE": First line is a header, but you can't use the header values to indicate the column in an expression. You can use column position (such as _1, _2, …) to indicate the column ( "SELECT s._1 FROM OBJECT s"). * "Use": First line is a header, and you can use the header value to identify a column in an expression ( "SELECT "name" FROM OBJECT"). * **Comments** *(string) --* A single character used to indicate that a row should be ignored when the character is present at the start of that row. You can specify any character to indicate a comment line. The default character is "#". Default: "#" * **QuoteEscapeCharacter** *(string) --* A single character used for escaping the quotation mark character inside an already escaped value. For example, the value """" a , b """" is parsed as "" a , b "". * **RecordDelimiter** *(string) --* A single character used to separate individual records in the input. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* A single character used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". Type: String Default: """ Ancestors: "CSV" * **AllowQuotedRecordDelimiter** *(boolean) --* Specifies that CSV field values may contain quoted record delimiters and such records should be allowed. Default value is FALSE. Setting this value to TRUE may lower performance. * **CompressionType** *(string) --* Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default Value: NONE. * **JSON** *(dict) --* Specifies JSON as object's input serialization format. * **Type** *(string) --* The type of JSON. Valid values: Document, Lines. * **Parquet** *(dict) --* Specifies Parquet as object's input serialization format. * **OutputSerialization** (*dict*) -- **[REQUIRED]** Describes the format of the data that you want Amazon S3 to return in response. * **CSV** *(dict) --* Describes the serialization of CSV-encoded Select results. * **QuoteFields** *(string) --* Indicates whether to use quotation marks around output fields. * "ALWAYS": Always use quotation marks for output fields. * "ASNEEDED": Use quotation marks for output fields when needed. * **QuoteEscapeCharacter** *(string) --* The single character used for escaping the quote character inside an already escaped value. * **RecordDelimiter** *(string) --* A single character used to separate individual records in the output. Instead of the default value, you can specify an arbitrary delimiter. * **FieldDelimiter** *(string) --* The value used to separate individual fields in a record. You can specify an arbitrary delimiter. * **QuoteCharacter** *(string) --* A single character used for escaping when the field delimiter is part of the value. For example, if the value is "a, b", Amazon S3 wraps this field value in quotation marks, as follows: "" a , b "". * **JSON** *(dict) --* Specifies JSON as request's output serialization format. * **RecordDelimiter** *(string) --* The value used to separate individual records in the output. If no value is specified, Amazon S3 uses a newline character ('n'). * **ScanRange** (*dict*) -- Specifies the byte range of the object to get the records from. A record is processed when its first byte is contained by the range. This parameter is optional, but when specified, it must not be empty. See RFC 2616, Section 14.35.1 about how to specify the start and end of the range. >>``<50100" - process only the records starting between the bytes 50 and 100 (inclusive, counting from zero) * "50" - process only the records starting after the byte 50 * "50" - process only the records within the last 50 bytes of the file. * **Start** *(integer) --* Specifies the start of the byte range. This parameter is optional. Valid values: non-negative integers. The default value is 0. If only "start" is supplied, it means scan from that point to the end of the file. For example, "50" means scan from byte 50 until the end of the file. * **End** *(integer) --* Specifies the end of the byte range. This parameter is optional. Valid values: non-negative integers. The default value is one less than the size of the object being queried. If only the End parameter is supplied, it is interpreted to mean scan the last N bytes of the file. For example, "50" means scan the last 50 bytes. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: The response of this operation contains an "EventStream" member. When iterated the "EventStream" will yield events based on the structure below, where only one of the top level keys will be present for any given event. **Response Syntax** { 'Payload': EventStream({ 'Records': { 'Payload': b'bytes' }, 'Stats': { 'Details': { 'BytesScanned': 123, 'BytesProcessed': 123, 'BytesReturned': 123 } }, 'Progress': { 'Details': { 'BytesScanned': 123, 'BytesProcessed': 123, 'BytesReturned': 123 } }, 'Cont': {}, 'End': {} }) } **Response Structure** * *(dict) --* * **Payload** ("EventStream") -- The array of results. * **Records** *(dict) --* The Records Event. * **Payload** *(bytes) --* The byte array of partial, one or more result records. S3 Select doesn't guarantee that a record will be self- contained in one record frame. To ensure continuous streaming of data, S3 Select might split the same record across multiple record frames instead of aggregating the results in memory. Some S3 clients (for example, the SDKforJava) handle this behavior by creating a "ByteStream" out of the response by default. Other clients might not handle this behavior by default. In those cases, you must aggregate the results on the client side and parse the response. * **Stats** *(dict) --* The Stats Event. * **Details** *(dict) --* The Stats event details. * **BytesScanned** *(integer) --* The total number of object bytes scanned. * **BytesProcessed** *(integer) --* The total number of uncompressed object bytes processed. * **BytesReturned** *(integer) --* The total number of bytes of records payload data returned. * **Progress** *(dict) --* The Progress Event. * **Details** *(dict) --* The Progress event details. * **BytesScanned** *(integer) --* The current number of object bytes scanned. * **BytesProcessed** *(integer) --* The current number of uncompressed object bytes processed. * **BytesReturned** *(integer) --* The current number of bytes of records payload data returned. * **Cont** *(dict) --* The Continuation Event. * **End** *(dict) --* The End Event. S3 / Client / get_bucket_cors get_bucket_cors *************** S3.Client.get_bucket_cors(**kwargs) Note: This operation is not supported for directory buckets. Returns the Cross-Origin Resource Sharing (CORS) configuration information set for the bucket. To use this operation, you must have permission to perform the "s3:GetBucketCORS" action. By default, the bucket owner has this permission and can grant it to others. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. For more information about CORS, see Enabling Cross-Origin Resource Sharing. The following operations are related to "GetBucketCors": * PutBucketCors * DeleteBucketCors See also: AWS API Documentation **Request Syntax** response = client.get_bucket_cors( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name for which to get the cors configuration. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'CORSRules': [ { 'ID': 'string', 'AllowedHeaders': [ 'string', ], 'AllowedMethods': [ 'string', ], 'AllowedOrigins': [ 'string', ], 'ExposeHeaders': [ 'string', ], 'MaxAgeSeconds': 123 }, ] } **Response Structure** * *(dict) --* * **CORSRules** *(list) --* A set of origins and methods (cross-origin access that you want to allow). You can add up to 100 rules to the configuration. * *(dict) --* Specifies a cross-origin access rule for an Amazon S3 bucket. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **AllowedHeaders** *(list) --* Headers that are specified in the "Access-Control- Request-Headers" header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed. * *(string) --* * **AllowedMethods** *(list) --* An HTTP method that you allow the origin to execute. Valid values are "GET", "PUT", "HEAD", "POST", and "DELETE". * *(string) --* * **AllowedOrigins** *(list) --* One or more origins you want customers to be able to access the bucket from. * *(string) --* * **ExposeHeaders** *(list) --* 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). * *(string) --* * **MaxAgeSeconds** *(integer) --* The time in seconds that your browser is to cache the preflight response for the specified resource. **Examples** The following example returns cross-origin resource sharing (CORS) configuration set on a bucket. response = client.get_bucket_cors( Bucket='examplebucket', ) print(response) Expected Output: { 'CORSRules': [ { 'AllowedHeaders': [ 'Authorization', ], 'AllowedMethods': [ 'GET', ], 'AllowedOrigins': [ '*', ], 'MaxAgeSeconds': 3000, }, ], 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_bucket_logging put_bucket_logging ****************** S3.Client.put_bucket_logging(**kwargs) Warning: End of support notice: Beginning October 1, 2025, Amazon S3 will discontinue support for creating new Email Grantee Access Control Lists (ACL). Email Grantee ACLs created prior to this date will continue to work and remain accessible through the Amazon Web Services Management Console, Command Line Interface (CLI), SDKs, and REST API. However, you will no longer be able to create new Email Grantee ACLs.This change affects the following Amazon Web Services Regions: US East (N. Virginia) Region, US West (N. California) Region, US West (Oregon) Region, Asia Pacific (Singapore) Region, Asia Pacific (Sydney) Region, Asia Pacific (Tokyo) Region, Europe (Ireland) Region, and South America (São Paulo) Region. Note: This operation is not supported for directory buckets. Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters. All logs are saved to buckets in the same Amazon Web Services Region as the source bucket. To set the logging status of a bucket, you must be the bucket owner. The bucket owner is automatically granted FULL_CONTROL to all logs. You use the "Grantee" request element to grant access to other people. The "Permissions" request element specifies the kind of access the grantee has to the logs. Warning: If the target bucket for log delivery uses the bucket owner enforced setting for S3 Object Ownership, you can't use the "Grantee" request element to grant access to others. Permissions can only be granted using policies. For more information, see Permissions for server access log delivery in the *Amazon S3 User Guide*.Grantee Values You can specify the person (grantee) to whom you're assigning access rights (by using request elements) in the following ways. For examples of how to specify these grantee values in JSON format, see the Amazon Web Services CLI example in Enabling Amazon S3 server access logging in the *Amazon S3 User Guide*. * By the person's ID: "<>ID<><>GranteesEmail<> " "DisplayName" is optional and ignored in the request. * By Email address: "<>Grantees@email.com<>" The grantee is resolved to the "CanonicalUser" and, in a response to a "GETObjectAcl" request, appears as the CanonicalUser. * By URI: "<>http://acs.amazonaws.com/group s/global/AuthenticatedUsers<>" To enable logging, you use "LoggingEnabled" and its children request elements. To disable logging, you use an empty "BucketLoggingStatus" request element: "" For more information about server access logging, see Server Access Logging in the *Amazon S3 User Guide*. For more information about creating a bucket, see CreateBucket. For more information about returning the logging status of a bucket, see GetBucketLogging. The following operations are related to "PutBucketLogging": * PutObject * DeleteBucket * CreateBucket * GetBucketLogging See also: AWS API Documentation **Request Syntax** response = client.put_bucket_logging( Bucket='string', BucketLoggingStatus={ 'LoggingEnabled': { 'TargetBucket': 'string', 'TargetGrants': [ { 'Grantee': { 'DisplayName': 'string', 'EmailAddress': 'string', 'ID': 'string', 'Type': 'CanonicalUser'|'AmazonCustomerByEmail'|'Group', 'URI': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE' }, ], 'TargetPrefix': 'string', 'TargetObjectKeyFormat': { 'SimplePrefix': {} , 'PartitionedPrefix': { 'PartitionDateSource': 'EventTime'|'DeliveryTime' } } } }, ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to set the logging parameters. * **BucketLoggingStatus** (*dict*) -- **[REQUIRED]** Container for logging status information. * **LoggingEnabled** *(dict) --* Describes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket. For more information, see PUT Bucket logging in the *Amazon S3 API Reference*. * **TargetBucket** *(string) --* **[REQUIRED]** 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** *(list) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions for server access log delivery in the *Amazon S3 User Guide*. * *(dict) --* Container for granting information. Buckets that use the bucket owner enforced setting for Object Ownership don't support target grants. For more information, see Permissions server access log delivery in the *Amazon S3 User Guide*. * **Grantee** *(dict) --* Container for the person being granted permissions. * **DisplayName** *(string) --* Screen name of the grantee. * **EmailAddress** *(string) --* Email address of the grantee. Note: Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference. * **ID** *(string) --* The canonical user ID of the grantee. * **Type** *(string) --* **[REQUIRED]** Type of grantee * **URI** *(string) --* URI of the grantee group. * **Permission** *(string) --* Logging permissions assigned to the grantee for the bucket. * **TargetPrefix** *(string) --* **[REQUIRED]** A prefix for all log object keys. If you store log files from multiple Amazon S3 buckets in a single bucket, you can use a prefix to distinguish which log files came from which bucket. * **TargetObjectKeyFormat** *(dict) --* Amazon S3 key format for log objects. * **SimplePrefix** *(dict) --* To use the simple format for S3 keys for log objects. To specify SimplePrefix format, set SimplePrefix to {}. * **PartitionedPrefix** *(dict) --* Partitioned S3 key for log objects. * **PartitionDateSource** *(string) --* Specifies the partition date source for the partitioned prefix. "PartitionDateSource" can be "EventTime" or "DeliveryTime". For "DeliveryTime", the time in the log file names corresponds to the delivery time for the log files. For "EventTime", The logs delivered are for a specific day only. The year, month, and day correspond to the day on which the event occurred, and the hour, minutes and seconds are set to 00 in the key. * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None **Examples** The following example sets logging policy on a bucket. For the Log Delivery group to deliver logs to the destination bucket, it needs permission for the READ_ACP action which the policy grants. response = client.put_bucket_logging( Bucket='sourcebucket', BucketLoggingStatus={ 'LoggingEnabled': { 'TargetBucket': 'targetbucket', 'TargetGrants': [ { 'Grantee': { 'Type': 'Group', 'URI': 'http://acs.amazonaws.com/groups/global/AllUsers', }, 'Permission': 'READ', }, ], 'TargetPrefix': 'MyBucketLogs/', }, }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_bucket_location get_bucket_location ******************* S3.Client.get_bucket_location(**kwargs) Note: This operation is not supported for directory buckets. Returns the Region the bucket resides in. You set the bucket's Region using the "LocationConstraint" request parameter in a "CreateBucket" request. For more information, see CreateBucket. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. Note: We recommend that you use HeadBucket to return the Region that a bucket resides in. For backward compatibility, Amazon S3 continues to support GetBucketLocation. The following operations are related to "GetBucketLocation": * GetObject * CreateBucket See also: AWS API Documentation **Request Syntax** response = client.get_bucket_location( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to get the location. When you use this API operation with an access point, provide the alias of the access point in place of the bucket name. When you use this API operation with an Object Lambda access point, provide the alias of the Object Lambda access point in place of the bucket name. If the Object Lambda access point alias in a request is not valid, the error code "InvalidAccessPointAliasError" is returned. For more information about "InvalidAccessPointAliasError", see List of Error Codes. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'LocationConstraint': 'af-south-1'|'ap-east-1'|'ap-northeast-1'|'ap-northeast-2'|'ap-northeast-3'|'ap-south-1'|'ap-south-2'|'ap-southeast-1'|'ap-southeast-2'|'ap-southeast-3'|'ap-southeast-4'|'ap-southeast-5'|'ca-central-1'|'cn-north-1'|'cn-northwest-1'|'EU'|'eu-central-1'|'eu-central-2'|'eu-north-1'|'eu-south-1'|'eu-south-2'|'eu-west-1'|'eu-west-2'|'eu-west-3'|'il-central-1'|'me-central-1'|'me-south-1'|'sa-east-1'|'us-east-2'|'us-gov-east-1'|'us-gov-west-1'|'us-west-1'|'us-west-2' } **Response Structure** * *(dict) --* * **LocationConstraint** *(string) --* Specifies the Region where the bucket resides. For a list of all the Amazon S3 supported location constraints by Region, see Regions and Endpoints. Buckets in Region "us-east-1" have a LocationConstraint of "null". Buckets with a LocationConstraint of "EU" reside in "eu-west-1". **Examples** The following example returns bucket location. response = client.get_bucket_location( Bucket='examplebucket', ) print(response) Expected Output: { 'LocationConstraint': 'us-west-2', 'ResponseMetadata': { '...': '...', }, } S3 / Client / put_bucket_analytics_configuration put_bucket_analytics_configuration ********************************** S3.Client.put_bucket_analytics_configuration(**kwargs) Note: This operation is not supported for directory buckets. Sets an analytics configuration for the bucket (specified by the analytics configuration ID). You can have up to 1,000 analytics configurations per bucket. You can choose to have storage class analysis export analysis reports sent to a comma-separated values (CSV) flat file. See the "DataExport" request element. Reports are updated daily and are based on the object filters that you configure. When selecting data export, you specify a destination bucket and an optional destination prefix where the file is written. You can export the data to a destination bucket in a different account. However, the destination bucket must be in the same Region as the bucket that you are making the PUT analytics configuration to. For more information, see Amazon S3 Analytics – Storage Class Analysis. Warning: You must create a bucket policy on the destination bucket where the exported file is written to grant permissions to Amazon S3 to write objects to the bucket. For an example policy, see Granting Permissions for Amazon S3 Inventory and Storage Class Analysis. To use this operation, you must have permissions to perform the "s3:PutAnalyticsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. "PutBucketAnalyticsConfiguration" has the following special errors: * * *HTTP Error: HTTP 400 Bad Request* * *Code: InvalidArgument* * *Cause: Invalid argument.* * * *HTTP Error: HTTP 400 Bad Request* * *Code: TooManyConfigurations* * *Cause: You are attempting to create a new configuration but have already reached the 1,000-configuration limit.* * * *HTTP Error: HTTP 403 Forbidden* * *Code: AccessDenied* * *Cause: You are not the owner of the specified bucket, or you do not have the s3:PutAnalyticsConfiguration bucket permission to set the configuration on the bucket.* The following operations are related to "PutBucketAnalyticsConfiguration": * GetBucketAnalyticsConfiguration * DeleteBucketAnalyticsConfiguration * ListBucketAnalyticsConfigurations See also: AWS API Documentation **Request Syntax** response = client.put_bucket_analytics_configuration( Bucket='string', Id='string', AnalyticsConfiguration={ 'Id': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'StorageClassAnalysis': { 'DataExport': { 'OutputSchemaVersion': 'V_1', 'Destination': { 'S3BucketDestination': { 'Format': 'CSV', 'BucketAccountId': 'string', 'Bucket': 'string', 'Prefix': 'string' } } } } }, ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket to which an analytics configuration is stored. * **Id** (*string*) -- **[REQUIRED]** The ID that identifies the analytics configuration. * **AnalyticsConfiguration** (*dict*) -- **[REQUIRED]** The configuration and any analyses for the analytics filter. * **Id** *(string) --* **[REQUIRED]** The ID that identifies the analytics configuration. * **Filter** *(dict) --* The filter used to describe a set of objects for analyses. A filter must have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). If no filter is provided, all objects will be considered in any analysis. * **Prefix** *(string) --* The prefix to use when evaluating an analytics filter. * **Tag** *(dict) --* The tag to use when evaluating an analytics filter. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **And** *(dict) --* A conjunction (logical AND) of predicates, which is used in evaluating an analytics filter. The operator must have at least two predicates. * **Prefix** *(string) --* The prefix to use when evaluating an AND predicate: The prefix that an object must have to be included in the metrics results. * **Tags** *(list) --* The list of tags to use when evaluating an AND predicate. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* **[REQUIRED]** Name of the object key. * **Value** *(string) --* **[REQUIRED]** Value of the tag. * **StorageClassAnalysis** *(dict) --* **[REQUIRED]** Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes. * **DataExport** *(dict) --* Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported. * **OutputSchemaVersion** *(string) --* **[REQUIRED]** The version of the output schema to use when exporting data. Must be "V_1". * **Destination** *(dict) --* **[REQUIRED]** The place to store the data for an analysis. * **S3BucketDestination** *(dict) --* **[REQUIRED]** A destination signifying output to an S3 bucket. * **Format** *(string) --* **[REQUIRED]** Specifies the file format used when exporting data to Amazon S3. * **BucketAccountId** *(string) --* The account ID that owns the destination S3 bucket. If no account ID is provided, the owner is not validated before exporting data. Note: Although this value is optional, we strongly recommend that you set it to help prevent problems if the destination bucket ownership changes. * **Bucket** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the bucket to which data is exported. * **Prefix** *(string) --* The prefix to use when exporting data. The prefix is prepended to all results. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / put_bucket_notification_configuration put_bucket_notification_configuration ************************************* S3.Client.put_bucket_notification_configuration(**kwargs) Note: This operation is not supported for directory buckets. Enables notifications of specified events for a bucket. For more information about event notifications, see Configuring Event Notifications. Using this API, you can replace an existing notification configuration. The configuration is an XML file that defines the event types that you want Amazon S3 to publish and the destination where you want Amazon S3 to publish an event notification when it detects an event of the specified type. By default, your bucket has no event notifications configured. That is, the notification configuration will be an empty "NotificationConfiguration". "" "" This action replaces the existing notification configuration with the configuration you include in the request body. After Amazon S3 receives this request, it first verifies that any Amazon Simple Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon SQS) destination exists, and that the bucket owner has permission to publish to it by sending a test notification. In the case of Lambda destinations, Amazon S3 verifies that the Lambda function permissions grant Amazon S3 permission to invoke the function from the Amazon S3 bucket. For more information, see Configuring Notifications for Amazon S3 Events. You can disable notifications by adding the empty NotificationConfiguration element. For more information about the number of event notification configurations that you can create per bucket, see Amazon S3 service quotas in *Amazon Web Services General Reference*. By default, only the bucket owner can configure notifications on a bucket. However, bucket owners can use a bucket policy to grant permission to other users to set this configuration with the required "s3:PutBucketNotification" permission. Note: The PUT notification is an atomic operation. For example, suppose your notification configuration includes SNS topic, SQS queue, and Lambda function configurations. When you send a PUT request with this configuration, Amazon S3 sends test messages to your SNS topic. If the message fails, the entire PUT action will fail, and Amazon S3 will not add the configuration to your bucket. If the configuration in the request body includes only one "TopicConfiguration" specifying only the "s3:ReducedRedundancyLostObject" event type, the response will also include the "x-amz-sns-test-message-id" header containing the message ID of the test notification sent to the topic. The following action is related to "PutBucketNotificationConfiguration": * GetBucketNotificationConfiguration See also: AWS API Documentation **Request Syntax** response = client.put_bucket_notification_configuration( Bucket='string', NotificationConfiguration={ 'TopicConfigurations': [ { 'Id': 'string', 'TopicArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'QueueConfigurations': [ { 'Id': 'string', 'QueueArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'LambdaFunctionConfigurations': [ { 'Id': 'string', 'LambdaFunctionArn': 'string', 'Events': [ 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated'|'s3:ObjectRestore:*'|'s3:ObjectRestore:Post'|'s3:ObjectRestore:Completed'|'s3:Replication:*'|'s3:Replication:OperationFailedReplication'|'s3:Replication:OperationNotTracked'|'s3:Replication:OperationMissedThreshold'|'s3:Replication:OperationReplicatedAfterThreshold'|'s3:ObjectRestore:Delete'|'s3:LifecycleTransition'|'s3:IntelligentTiering'|'s3:ObjectAcl:Put'|'s3:LifecycleExpiration:*'|'s3:LifecycleExpiration:Delete'|'s3:LifecycleExpiration:DeleteMarkerCreated'|'s3:ObjectTagging:*'|'s3:ObjectTagging:Put'|'s3:ObjectTagging:Delete', ], 'Filter': { 'Key': { 'FilterRules': [ { 'Name': 'prefix'|'suffix', 'Value': 'string' }, ] } } }, ], 'EventBridgeConfiguration': {} }, ExpectedBucketOwner='string', SkipDestinationValidation=True|False ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket. * **NotificationConfiguration** (*dict*) -- **[REQUIRED]** A container for specifying the notification configuration of the bucket. If this element is empty, notifications are turned off for the bucket. * **TopicConfigurations** *(list) --* The topic to which notifications are sent and the events for which notifications are generated. * *(dict) --* A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **TopicArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* **[REQUIRED]** The Amazon S3 bucket event about which to send notifications. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **QueueConfigurations** *(list) --* The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. * *(dict) --* Specifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **QueueArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events of the specified type. * **Events** *(list) --* **[REQUIRED]** A collection of bucket events for which to send notifications * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **LambdaFunctionConfigurations** *(list) --* Describes the Lambda functions to invoke and the events for which to invoke them. * *(dict) --* A container for specifying the configuration for Lambda notifications. * **Id** *(string) --* An optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID. * **LambdaFunctionArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes when the specified event type occurs. * **Events** *(list) --* **[REQUIRED]** The Amazon S3 bucket event for which to invoke the Lambda function. For more information, see Supported Event Types in the *Amazon S3 User Guide*. * *(string) --* The bucket event for which to send notifications. * **Filter** *(dict) --* Specifies object key name filtering rules. For information about key name filtering, see Configuring event notifications using object key name filtering in the *Amazon S3 User Guide*. * **Key** *(dict) --* A container for object key name prefix and suffix filtering rules. * **FilterRules** *(list) --* A list of containers for the key-value pair that defines the criteria for the filter rule. * *(dict) --* Specifies the Amazon S3 object key name to filter on. An object key name is the name assigned to an object in your Amazon S3 bucket. You specify whether to filter on the suffix or prefix of the object key name. A prefix is a specific string of characters at the beginning of an object key name, which you can use to organize objects. For example, you can start the key names of related objects with a prefix, such as "2023-" or "engineering/". Then, you can use "FilterRule" to find objects in a bucket with key names that have the same prefix. A suffix is similar to a prefix, but it is at the end of the object key name instead of at the beginning. * **Name** *(string) --* The object key name prefix or suffix identifying one or more objects to which the filtering rule applies. The maximum length is 1,024 characters. Overlapping prefixes and suffixes are not supported. For more information, see Configuring Event Notifications in the *Amazon S3 User Guide*. * **Value** *(string) --* The value that the filter searches for in object key names. * **EventBridgeConfiguration** *(dict) --* Enables delivery of events to Amazon EventBridge. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **SkipDestinationValidation** (*boolean*) -- Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or false value. Returns: None **Examples** The following example sets notification configuration on a bucket to publish the object created events to an SNS topic. response = client.put_bucket_notification_configuration( Bucket='examplebucket', NotificationConfiguration={ 'TopicConfigurations': [ { 'Events': [ 's3:ObjectCreated:*', ], 'TopicArn': 'arn:aws:sns:us-west-2:123456789012:s3-notification-topic', }, ], }, ) print(response) Expected Output: { 'ResponseMetadata': { '...': '...', }, } S3 / Client / delete_bucket_metrics_configuration delete_bucket_metrics_configuration *********************************** S3.Client.delete_bucket_metrics_configuration(**kwargs) Note: This operation is not supported for directory buckets. Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration ID) from the bucket. Note that this doesn't include the daily storage metrics. To use this operation, you must have permissions to perform the "s3:PutMetricsConfiguration" action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. For information about CloudWatch request metrics for Amazon S3, see Monitoring Metrics with Amazon CloudWatch. The following operations are related to "DeleteBucketMetricsConfiguration": * GetBucketMetricsConfiguration * PutBucketMetricsConfiguration * ListBucketMetricsConfigurations * Monitoring Metrics with Amazon CloudWatch See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_metrics_configuration( Bucket='string', Id='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket containing the metrics configuration to delete. * **Id** (*string*) -- **[REQUIRED]** The ID used to identify the metrics configuration. The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None S3 / Client / get_bucket_website get_bucket_website ****************** S3.Client.get_bucket_website(**kwargs) Note: This operation is not supported for directory buckets. Returns the website configuration for a bucket. To host website on Amazon S3, you can configure a bucket as website by adding a website configuration. For more information about hosting websites, see Hosting Websites on Amazon S3. This GET action requires the "S3:GetBucketWebsite" permission. By default, only the bucket owner can read the bucket website configuration. However, bucket owners can allow other users to read the website configuration by writing a bucket policy granting them the "S3:GetBucketWebsite" permission. The following operations are related to "GetBucketWebsite": * DeleteBucketWebsite * PutBucketWebsite See also: AWS API Documentation **Request Syntax** response = client.get_bucket_website( Bucket='string', ExpectedBucketOwner='string' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name for which to get the website configuration. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Return type: dict Returns: **Response Syntax** { 'RedirectAllRequestsTo': { 'HostName': 'string', 'Protocol': 'http'|'https' }, 'IndexDocument': { 'Suffix': 'string' }, 'ErrorDocument': { 'Key': 'string' }, 'RoutingRules': [ { 'Condition': { 'HttpErrorCodeReturnedEquals': 'string', 'KeyPrefixEquals': 'string' }, 'Redirect': { 'HostName': 'string', 'HttpRedirectCode': 'string', 'Protocol': 'http'|'https', 'ReplaceKeyPrefixWith': 'string', 'ReplaceKeyWith': 'string' } }, ] } **Response Structure** * *(dict) --* * **RedirectAllRequestsTo** *(dict) --* Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket. * **HostName** *(string) --* Name of the host where requests are redirected. * **Protocol** *(string) --* Protocol to use when redirecting requests. The default is the protocol that is used in the original request. * **IndexDocument** *(dict) --* The name of the index document for the website (for example "index.html"). * **Suffix** *(string) --* A suffix that is appended to a request that is for a directory on the website endpoint. (For example, 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **ErrorDocument** *(dict) --* The object key name of the website error document to use for 4XX class errors. * **Key** *(string) --* The object key name to use when a 4XX class error occurs. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **RoutingRules** *(list) --* Rules that define when a redirect is applied and the redirect behavior. * *(dict) --* Specifies the redirect behavior and when a redirect is applied. For more information about routing rules, see Configuring advanced conditional redirects in the *Amazon S3 User Guide*. * **Condition** *(dict) --* 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Redirect** *(dict) --* 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 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 when redirecting requests. The default is the protocol that is used in the original request. * **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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **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 siblings is present. Can be present only if "ReplaceKeyPrefixWith" is not provided. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. **Examples** The following example retrieves website configuration of a bucket. response = client.get_bucket_website( Bucket='examplebucket', ) print(response) Expected Output: { 'ErrorDocument': { 'Key': 'error.html', }, 'IndexDocument': { 'Suffix': 'index.html', }, 'ResponseMetadata': { '...': '...', }, } S3 / Client / get_object_tagging get_object_tagging ****************** S3.Client.get_object_tagging(**kwargs) Note: This operation is not supported for directory buckets. Returns the tag-set of an object. You send the GET request against the tagging subresource associated with the object. To use this operation, you must have permission to perform the "s3:GetObjectTagging" action. By default, the GET action returns information about current version of an object. For a versioned bucket, you can have multiple versions of an object in your bucket. To retrieve tags of any other version, use the versionId query parameter. You also need permission for the "s3:GetObjectVersionTagging" action. By default, the bucket owner has this permission and can grant this permission to others. For information about the Amazon S3 object tagging feature, see Object Tagging. The following actions are related to "GetObjectTagging": * DeleteObjectTagging * GetObjectAttributes * PutObjectTagging See also: AWS API Documentation **Request Syntax** response = client.get_object_tagging( Bucket='string', Key='string', VersionId='string', ExpectedBucketOwner='string', RequestPayer='requester' ) Parameters: * **Bucket** (*string*) -- **[REQUIRED]** The bucket name containing the object for which to get the tagging information. **Access points** - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form *AccessPointName*-*A ccountId*.s3-accesspoint.*Region*.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the *Amazon S3 User Guide*. **S3 on Outposts** - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form "AccessPointName- AccountId.outpostID.s3-outposts.Region.amazonaws.com". When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see What is S3 on Outposts? in the *Amazon S3 User Guide*. * **Key** (*string*) -- **[REQUIRED]** Object key for which to get the tagging information. * **VersionId** (*string*) -- The versionId of the object for which to get the tagging information. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Return type: dict Returns: **Response Syntax** { 'VersionId': 'string', 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **VersionId** *(string) --* The versionId of the object for which you got the tagging information. * **TagSet** *(list) --* Contains the tag set. * *(dict) --* A container of a key value name pair. * **Key** *(string) --* Name of the object key. * **Value** *(string) --* Value of the tag. **Examples** The following example retrieves tag set of an object. response = client.get_object_tagging( Bucket='examplebucket', Key='HappyFace.jpg', ) print(response) Expected Output: { 'TagSet': [ { 'Key': 'Key4', 'Value': 'Value4', }, { 'Key': 'Key3', 'Value': 'Value3', }, ], 'VersionId': 'null', 'ResponseMetadata': { '...': '...', }, } The following example retrieves tag set of an object. The request specifies object version. response = client.get_object_tagging( Bucket='examplebucket', Key='exampleobject', VersionId='ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI', ) print(response) Expected Output: { 'TagSet': [ { 'Key': 'Key1', 'Value': 'Value1', }, ], 'VersionId': 'ydlaNkwWm0SfKJR.T1b1fIdPRbldTYRI', 'ResponseMetadata': { '...': '...', }, } BucketWebsite / Attribute / redirect_all_requests_to redirect_all_requests_to ************************ S3.BucketWebsite.redirect_all_requests_to * *(dict) --* Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket. * **HostName** *(string) --* Name of the host where requests are redirected. * **Protocol** *(string) --* Protocol to use when redirecting requests. The default is the protocol that is used in the original request. BucketWebsite / Action / get_available_subresources get_available_subresources ************************** S3.BucketWebsite.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketWebsite / Action / put put *** S3.BucketWebsite.put(**kwargs) Note: This operation is not supported for directory buckets. Sets the configuration of the website that is specified in the "website" subresource. To configure a bucket as a website, you can add this subresource on the bucket with website configuration information such as the file name of the index document and any redirect rules. For more information, see Hosting Websites on Amazon S3. This PUT action requires the "S3:PutBucketWebsite" permission. By default, only the bucket owner can configure the website attached to a bucket; however, bucket owners can allow other users to set the website configuration by writing a bucket policy that grants them the "S3:PutBucketWebsite" permission. To redirect all website requests sent to the bucket's website endpoint, you add a website configuration with the following elements. Because all requests are sent to another website, you don't need to provide index document name for the bucket. * "WebsiteConfiguration" * "RedirectAllRequestsTo" * "HostName" * "Protocol" If you want granular control over redirects, you can use the following elements to add routing rules that describe conditions for redirecting requests and information about the redirect destination. In this case, the website configuration must provide an index document for the bucket, because some requests might not be redirected. * "WebsiteConfiguration" * "IndexDocument" * "Suffix" * "ErrorDocument" * "Key" * "RoutingRules" * "RoutingRule" * "Condition" * "HttpErrorCodeReturnedEquals" * "KeyPrefixEquals" * "Redirect" * "Protocol" * "HostName" * "ReplaceKeyPrefixWith" * "ReplaceKeyWith" * "HttpRedirectCode" Amazon S3 has a limitation of 50 routing rules per website configuration. If you require more than 50 routing rules, you can use object redirect. For more information, see Configuring an Object Redirect in the *Amazon S3 User Guide*. The maximum request length is limited to 128 KB. See also: AWS API Documentation **Request Syntax** response = bucket_website.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', WebsiteConfiguration={ 'ErrorDocument': { 'Key': 'string' }, 'IndexDocument': { 'Suffix': 'string' }, 'RedirectAllRequestsTo': { 'HostName': 'string', 'Protocol': 'http'|'https' }, 'RoutingRules': [ { 'Condition': { 'HttpErrorCodeReturnedEquals': 'string', 'KeyPrefixEquals': 'string' }, 'Redirect': { 'HostName': 'string', 'HttpRedirectCode': 'string', 'Protocol': 'http'|'https', 'ReplaceKeyPrefixWith': 'string', 'ReplaceKeyWith': 'string' } }, ] }, ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **WebsiteConfiguration** (*dict*) -- **[REQUIRED]** Container for the request. * **ErrorDocument** *(dict) --* The name of the error document for the website. * **Key** *(string) --* **[REQUIRED]** The object key name to use when a 4XX class error occurs. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **IndexDocument** *(dict) --* The name of the index document for the website. * **Suffix** *(string) --* **[REQUIRED]** A suffix that is appended to a request that is for a directory on the website endpoint. (For example, 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **RedirectAllRequestsTo** *(dict) --* The redirect behavior for every request to this bucket's website endpoint. Warning: If you specify this property, you can't specify any other property. * **HostName** *(string) --* **[REQUIRED]** Name of the host where requests are redirected. * **Protocol** *(string) --* Protocol to use when redirecting requests. The default is the protocol that is used in the original request. * **RoutingRules** *(list) --* Rules that define when a redirect is applied and the redirect behavior. * *(dict) --* Specifies the redirect behavior and when a redirect is applied. For more information about routing rules, see Configuring advanced conditional redirects in the *Amazon S3 User Guide*. * **Condition** *(dict) --* 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Redirect** *(dict) --* **[REQUIRED]** 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 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 when redirecting requests. The default is the protocol that is used in the original request. * **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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **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 siblings is present. Can be present only if "ReplaceKeyPrefixWith" is not provided. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketWebsite / Action / load load **** S3.BucketWebsite.load() Calls "S3.Client.get_bucket_website()" to update the attributes of the BucketWebsite resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_website.load() Returns: None S3 / Resource / BucketWebsite BucketWebsite ************* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketWebsite(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketWebsite: import boto3 s3 = boto3.resource('s3') bucket_website = s3.BucketWebsite('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketWebsite's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * error_document * index_document * redirect_all_requests_to * routing_rules Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketWebsite / Identifier / bucket_name bucket_name *********** S3.BucketWebsite.bucket_name *(string)* The BucketWebsite's bucket_name identifier. This **must** be set. BucketWebsite / Sub-Resource / Bucket Bucket ****** S3.BucketWebsite.Bucket() Creates a Bucket resource.: bucket = bucket_website.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketWebsite / Action / reload reload ****** S3.BucketWebsite.reload() Calls "S3.Client.get_bucket_website()" to update the attributes of the BucketWebsite resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_website.reload() Returns: None BucketWebsite / Attribute / routing_rules routing_rules ************* S3.BucketWebsite.routing_rules * *(list) --* Rules that define when a redirect is applied and the redirect behavior. * *(dict) --* Specifies the redirect behavior and when a redirect is applied. For more information about routing rules, see Configuring advanced conditional redirects in the *Amazon S3 User Guide*. * **Condition** *(dict) --* 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Redirect** *(dict) --* 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 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 when redirecting requests. The default is the protocol that is used in the original request. * **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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **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 siblings is present. Can be present only if "ReplaceKeyPrefixWith" is not provided. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. BucketWebsite / Attribute / index_document index_document ************** S3.BucketWebsite.index_document * *(dict) --* The name of the index document for the website (for example "index.html"). * **Suffix** *(string) --* A suffix that is appended to a request that is for a directory on the website endpoint. (For example, 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. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. BucketWebsite / Attribute / error_document error_document ************** S3.BucketWebsite.error_document * *(dict) --* The object key name of the website error document to use for 4XX class errors. * **Key** *(string) --* The object key name to use when a 4XX class error occurs. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. BucketWebsite / Action / delete delete ****** S3.BucketWebsite.delete(**kwargs) Note: This operation is not supported for directory buckets. This action removes the website configuration for a bucket. Amazon S3 returns a "200 OK" response upon successfully deleting a website configuration on the specified bucket. You will get a "200 OK" response if the website configuration you are trying to delete does not exist on the bucket. Amazon S3 returns a "404" response if the bucket specified in the request does not exist. This DELETE action requires the "S3:DeleteBucketWebsite" permission. By default, only the bucket owner can delete the website configuration attached to a bucket. However, bucket owners can grant other users permission to delete the website configuration by writing a bucket policy granting them the "S3:DeleteBucketWebsite" permission. For more information about hosting websites, see Hosting Websites on Amazon S3. The following operations are related to "DeleteBucketWebsite": * GetBucketWebsite * PutBucketWebsite See also: AWS API Documentation **Request Syntax** response = bucket_website.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketLifecycle / Action / get_available_subresources get_available_subresources ************************** S3.BucketLifecycle.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str BucketLifecycle / Action / put put *** S3.BucketLifecycle.put(**kwargs) Note: This operation is not supported for directory buckets. Warning: For an updated version of this API, see PutBucketLifecycleConfiguration. This version has been deprecated. Existing lifecycle configurations will work. For new lifecycle configurations, use the updated API. Note: This operation is not supported for directory buckets. Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration. For information about lifecycle configuration, see Object Lifecycle Management in the *Amazon S3 User Guide*. By default, all Amazon S3 resources, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration) are private. Only the resource owner, the Amazon Web Services account that created the resource, can access it. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, users must get the "s3:PutLifecycleConfiguration" permission. You can also explicitly deny permissions. Explicit denial also supersedes any other permissions. If you want to prevent users or accounts from removing or deleting objects from your bucket, you must deny them permissions for the following actions: * "s3:DeleteObject" * "s3:DeleteObjectVersion" * "s3:PutLifecycleConfiguration" For more information about permissions, see Managing Access Permissions to your Amazon S3 Resources in the *Amazon S3 User Guide*. For more examples of transitioning objects to storage classes such as STANDARD_IA or ONEZONE_IA, see Examples of Lifecycle Configuration. The following operations are related to "PutBucketLifecycle": * >>`<`__(Deprecated) * GetBucketLifecycleConfiguration * RestoreObject * By default, a resource owner—in this case, a bucket owner, which is the Amazon Web Services account that created the bucket—can perform any of the operations. A resource owner can also grant others permission to perform the operation. For more information, see the following topics in the Amazon S3 User Guide: * Specifying Permissions in a Policy * Managing Access Permissions to your Amazon S3 Resources Danger: This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity. See also: AWS API Documentation **Request Syntax** response = bucket_lifecycle.put( ChecksumAlgorithm='CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME', LifecycleConfiguration={ 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Prefix': 'string', 'Status': 'Enabled'|'Disabled', 'Transition': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR' }, 'NoncurrentVersionTransition': { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'NewerNoncurrentVersions': 123 }, 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] }, ExpectedBucketOwner='string' ) Parameters: * **ChecksumAlgorithm** (*string*) -- Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding "x-amz- checksum" or "x-amz-trailer" header sent. Otherwise, Amazon S3 fails the request with the HTTP status code "400 Bad Request". For more information, see Checking object integrity in the *Amazon S3 User Guide*. If you provide an individual checksum, Amazon S3 ignores any provided "ChecksumAlgorithm" parameter. * **LifecycleConfiguration** (*dict*) -- * **Rules** *(list) --* **[REQUIRED]** Specifies lifecycle configuration rules for an Amazon S3 bucket. * *(dict) --* Specifies lifecycle rules for an Amazon S3 bucket. For more information, see Put Bucket Lifecycle Configuration in the *Amazon S3 API Reference*. For examples, see Put Bucket Lifecycle Configuration Examples. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value can't be longer than 255 characters. * **Prefix** *(string) --* **[REQUIRED]** Object key prefix that identifies one or more objects to which this rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Status** *(string) --* **[REQUIRED]** If "Enabled", the rule is currently being applied. If "Disabled", the rule is not currently being applied. * **Transition** *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransition** *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Returns: None BucketLifecycle / Attribute / rules rules ***** S3.BucketLifecycle.rules * *(list) --* Container for a lifecycle rule. * *(dict) --* Specifies lifecycle rules for an Amazon S3 bucket. For more information, see Put Bucket Lifecycle Configuration in the *Amazon S3 API Reference*. For examples, see Put Bucket Lifecycle Configuration Examples. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object. * **Date** *(datetime) --* Indicates at what date the object is to be moved or deleted. The date value must conform to the ISO 8601 format. The time is always midnight UTC. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **ID** *(string) --* Unique identifier for the rule. The value can't be longer than 255 characters. * **Prefix** *(string) --* Object key prefix that identifies one or more objects to which this rule applies. Warning: Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints. * **Status** *(string) --* If "Enabled", the rule is currently being applied. If "Disabled", the rule is not currently being applied. * **Transition** *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 lifecycle configuration rules, see Transitioning Objects Using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. If the specified storage class is "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE", valid values are "0" or positive integers. If the specified storage class is "STANDARD_IA" or "ONEZONE_IA", valid values are positive integers greater than "30". Be aware that some storage classes have a minimum storage duration and that you're charged for transitioning objects before their minimum storage duration. For more information, see Constraints and considerations for transitions in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransition** *(dict) --* Container for the transition rule that describes when noncurrent objects transition to the "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" 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 "STANDARD_IA", "ONEZONE_IA", "INTELLIGENT_TIERING", "GLACIER_IR", "GLACIER", or "DEEP_ARCHIVE" storage class at a specific period in the object's lifetime. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain in the same storage class before transitioning objects. You can specify up to 100 noncurrent versions to retain. Amazon S3 will transition any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **NoncurrentVersionExpiration** *(dict) --* 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. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. The value must be a non-zero positive integer. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions Amazon S3 will retain. You can specify up to 100 noncurrent versions to retain. Amazon S3 will permanently delete any additional noncurrent versions beyond the specified number to retain. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. BucketLifecycle / Action / load load **** S3.BucketLifecycle.load() Calls "S3.Client.get_bucket_lifecycle()" to update the attributes of the BucketLifecycle resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_lifecycle.load() Returns: None S3 / Resource / BucketLifecycle BucketLifecycle *************** Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.BucketLifecycle(bucket_name) A resource representing an Amazon Simple Storage Service (S3) BucketLifecycle: import boto3 s3 = boto3.resource('s3') bucket_lifecycle = s3.BucketLifecycle('bucket_name') Parameters: **bucket_name** (*string*) -- The BucketLifecycle's bucket_name identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * rules Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get_available_subresources * load * put * reload Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Bucket BucketLifecycle / Identifier / bucket_name bucket_name *********** S3.BucketLifecycle.bucket_name *(string)* The BucketLifecycle's bucket_name identifier. This **must** be set. BucketLifecycle / Sub-Resource / Bucket Bucket ****** S3.BucketLifecycle.Bucket() Creates a Bucket resource.: bucket = bucket_lifecycle.Bucket() Return type: "S3.Bucket" Returns: A Bucket resource BucketLifecycle / Action / reload reload ****** S3.BucketLifecycle.reload() Calls "S3.Client.get_bucket_lifecycle()" to update the attributes of the BucketLifecycle resource. Note that the load and reload methods are the same method and can be used interchangeably. See also: AWS API Documentation **Request Syntax** bucket_lifecycle.reload() Returns: None BucketLifecycle / Action / delete delete ****** S3.BucketLifecycle.delete(**kwargs) Deletes the lifecycle configuration from the specified bucket. Amazon S3 removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration. Permissions * **General purpose bucket permissions** - By default, all Amazon S3 resources are private, including buckets, objects, and related subresources (for example, lifecycle configuration and website configuration). Only the resource owner (that is, the Amazon Web Services account that created it) can access the resource. The resource owner can optionally grant access permissions to others by writing an access policy. For this operation, a user must have the "s3:PutLifecycleConfiguration" permission. For more information about permissions, see Managing Access Permissions to Your Amazon S3 Resources. * **Directory bucket permissions** - You must have the "s3express:PutLifecycleConfiguration" permission in an IAM identity-based policy to use this operation. Cross-account access to this API operation isn't supported. The resource owner can optionally grant access permissions to others by creating a role or user for them as long as they are within the same account as the owner and resource. For more information about directory bucket policies and permissions, see Authorizing Regional endpoint APIs with IAM in the *Amazon S3 User Guide*. Note: **Directory buckets** - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format >>``<>``<<. Virtual-hosted-style requests aren't supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". For more information about the object expiration, see Elements to Describe Lifecycle Actions. Related actions include: * PutBucketLifecycleConfiguration * GetBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = bucket_lifecycle.delete( ExpectedBucketOwner='string' ) Parameters: **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). Note: This parameter applies to general purpose buckets only. It is not supported for directory bucket lifecycle configurations. Returns: None ObjectVersion / Attribute / restore_status restore_status ************** S3.ObjectVersion.restore_status * *(dict) --* Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the *Amazon S3 User Guide*. * **IsRestoreInProgress** *(boolean) --* Specifies whether the object is currently being restored. If the object restoration is in progress, the header returns the value "TRUE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="true"" If the object restoration has completed, the header returns the value "FALSE". For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" If the object hasn't been restored, there is no header response. * **RestoreExpiryDate** *(datetime) --* Indicates when the restored copy will expire. This value is populated only if the object has already been restored. For example: "x-amz-optional-object-attributes: IsRestoreInProgress="false", RestoreExpiryDate="2012-12-21T00:00:00.000Z"" ObjectVersion / Action / get_available_subresources get_available_subresources ************************** S3.ObjectVersion.get_available_subresources() Returns a list of all the available sub-resources for this Resource. Returns: A list containing the name of each sub-resource for this resource Return type: list of str ObjectVersion / Attribute / storage_class storage_class ************* S3.ObjectVersion.storage_class * *(string) --* The class of storage used to store the object. ObjectVersion / Attribute / owner owner ***** S3.ObjectVersion.owner * *(dict) --* Specifies the owner of the object. * **DisplayName** *(string) --* Container for the display name of the owner. This value is only supported in the following Amazon Web Services Regions: * US East (N. Virginia) * US West (N. California) * US West (Oregon) * Asia Pacific (Singapore) * Asia Pacific (Sydney) * Asia Pacific (Tokyo) * Europe (Ireland) * South America (São Paulo) Note: This functionality is not supported for directory buckets. * **ID** *(string) --* Container for the ID of the owner. ObjectVersion / Attribute / checksum_type checksum_type ************* S3.ObjectVersion.checksum_type * *(string) --* The checksum type that is used to calculate the object’s checksum value. For more information, see Checking object integrity in the *Amazon S3 User Guide*. S3 / Resource / ObjectVersion ObjectVersion ************* Note: Before using anything on this page, please refer to the resources user guide for the most recent guidance on using resources. class S3.ObjectVersion(bucket_name, object_key, id) A resource representing an Amazon Simple Storage Service (S3) ObjectVersion: import boto3 s3 = boto3.resource('s3') object_version = s3.ObjectVersion('bucket_name','object_key','id') Parameters: * **bucket_name** (*string*) -- The ObjectVersion's bucket_name identifier. This **must** be set. * **object_key** (*string*) -- The ObjectVersion's object_key identifier. This **must** be set. * **id** (*string*) -- The ObjectVersion's id identifier. This **must** be set. Identifiers =========== Identifiers are properties of a resource that are set upon instantiation of the resource. For more information about identifiers refer to the Resources Introduction Guide. These are the resource's available identifiers: * bucket_name * object_key * id Attributes ========== Attributes provide access to the properties of a resource. Attributes are lazy-loaded the first time one is accessed via the "load()" method. For more information about attributes refer to the Resources Introduction Guide. These are the resource's available attributes: * checksum_algorithm * checksum_type * e_tag * is_latest * key * last_modified * owner * restore_status * size * storage_class * version_id Actions ======= Actions call operations on resources. They may automatically handle the passing in of arguments set from identifiers and some attributes. For more information about actions refer to the Resources Introduction Guide. These are the resource's available actions: * delete * get * get_available_subresources * head Sub-resources ============= Sub-resources are methods that create a new instance of a child resource. This resource's identifiers get passed along to the child. For more information about sub-resources refer to the Resources Introduction Guide. These are the resource's available sub-resources: * Object ObjectVersion / Attribute / version_id version_id ********** S3.ObjectVersion.version_id * *(string) --* Version ID of an object. ObjectVersion / Identifier / bucket_name bucket_name *********** S3.ObjectVersion.bucket_name *(string)* The ObjectVersion's bucket_name identifier. This **must** be set. ObjectVersion / Attribute / size size **** S3.ObjectVersion.size * *(integer) --* Size in bytes of the object. ObjectVersion / Action / get get *** S3.ObjectVersion.get(**kwargs) Retrieves an object from Amazon S3. In the "GetObject" request, specify the full key name for the object. **General purpose buckets** - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg", specify the object key name as "/photos/2006/February/sample.jpg". For a path-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "examplebucket", specify the object key name as "/examplebucket/photos/2006/February/sample.jpg". For more information about request types, see HTTP Host Header Bucket Specification in the *Amazon S3 User Guide*. **Directory buckets** - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object "photos/2006/February/sample.jpg" in the bucket named "amzn-s3-demo-bucket--usw2-az1--x-s3", specify the object key name as "/photos/2006/February/sample.jpg". Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. Permissions * **General purpose bucket permissions** - You must have the required permissions in a policy. To use "GetObject", you must have the "READ" access to the object (or version). If you grant "READ" access to the anonymous user, the "GetObject" operation returns the object without using an authorization header. For more information, see Specifying permissions in a policy in the *Amazon S3 User Guide*. If you include a "versionId" in your request header, you must have the "s3:GetObjectVersion" permission to access a specific version of an object. The "s3:GetObject" permission is not required in this scenario. If you request the current version of an object without a specific "versionId" in the request header, only the "s3:GetObject" permission is required. The "s3:GetObjectVersion" permission is not required in this scenario. If the object that you request doesn’t exist, the error that Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" error. * If you don’t have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Access Denied" error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If the object is encrypted using SSE-KMS, you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key. Storage classes If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a copy using RestoreObject. Otherwise, this operation returns an "InvalidObjectState" error. For information about restoring archived objects, see Restoring Archived Objects in the *Amazon S3 User Guide*. **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. Unsupported storage class values won't write a destination object and will respond with the HTTP status code "400 Bad Request". Encryption Encryption request headers, like "x-amz-server-side-encryption", should not be sent for the "GetObject" requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your "GetObject" requests for the object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. Overriding response header values through the request There are times when you want to override certain response header values of a "GetObject" response. For example, you might override the "Content-Disposition" response header value through your "GetObject" request. You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code "200 OK" is returned. The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. The response headers that you can override for the "GetObject" response are "Cache-Control", "Content-Disposition", "Content- Encoding", "Content-Language", "Content-Type", and "Expires". To override values for a set of response headers in the "GetObject" response, you can use the following query parameters in the request. * "response-cache-control" * "response-content-disposition" * "response-content-encoding" * "response-content-language" * "response-content-type" * "response-expires" Note: When you use these parameters, you must sign the request by using either an Authorization header or a presigned URL. These parameters cannot be used with an unsigned (anonymous) request.HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following operations are related to "GetObject": * ListBuckets * GetObjectAcl See also: AWS API Documentation **Request Syntax** response = object_version.get( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified in this header; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" status code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified in this header; otherwise, return a "304 Not Modified" error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: `` If-None-Match`` condition evaluates to "false", and; "If-Modified-Since" condition evaluates to "true"; then, S3 returns "304 Not Modified" HTTP status code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a "412 Precondition Failed" error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: "If-Match" condition evaluates to "true", and; "If-Unmodified-Since" condition evaluates to "false"; then, S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- Downloads the specified byte range of an object. For more information about the HTTP Range header, see https://www.rfc- editor.org/rfc/rfc9110.html#name-range. Note: Amazon S3 doesn't support retrieving multiple ranges of data per "GET" request. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when decrypting the object (for example, "AES256"). If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKey** (*string*) -- Specifies the customer-provided encryption key that you originally provided for Amazon S3 to encrypt the data before storing it. This value is used to decrypt the object when recovering it and must match the one used when storing the data. The key must be appropriate for use with the algorithm specified in the "x-amz-server-side-encryption-customer- algorithm" header. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** (*string*) -- Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you GET the object, you must use the following headers: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. Useful for downloading just a part of an object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this mode must be enabled. Return type: dict Returns: **Response Syntax** { 'Body': StreamingBody(), 'DeleteMarker': True|False, 'AcceptRanges': 'string', 'Expiration': 'string', 'Restore': 'string', 'LastModified': datetime(2015, 1, 1), 'ContentLength': 123, 'ETag': 'string', 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'MissingMeta': 123, 'VersionId': 'string', 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'ContentRange': 'string', 'ContentType': 'string', 'Expires': datetime(2015, 1, 1), 'ExpiresString': 'string', 'WebsiteRedirectLocation': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'Metadata': { 'string': 'string' }, 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', 'PartsCount': 123, 'TagCount': 123, 'ObjectLockMode': 'GOVERNANCE'|'COMPLIANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'ObjectLockLegalHoldStatus': 'ON'|'OFF' } **Response Structure** * *(dict) --* * **Body** ("StreamingBody") -- Object data. * **DeleteMarker** *(boolean) --* Indicates whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response. Note: * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes "x-amz-delete-marker: true" in the response. * If the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **AcceptRanges** *(string) --* Indicates that a range of bytes was specified in the request. * **Expiration** *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **Restore** *(string) --* Provides information about object restoration action and expiration time of the restored object copy. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **LastModified** *(datetime) --* Date and time when the object was last modified. **General purpose buckets** - When you specify a "versionId" of the object in your request, if the specified version in the request is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. * **ContentLength** *(integer) --* Size of the body in bytes. * **ETag** *(string) --* An entity tag (ETag) is an opaque identifier assigned by a web server to a specific version of a resource found at a URL. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32" checksum of the object. This checksum is only present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in the "CreateMultipartUpload" request. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **MissingMeta** *(integer) --* This is set to the number of metadata entries not returned in the headers that are prefixed with "x-amz-meta-". 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. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. * **CacheControl** *(string) --* Specifies caching behavior along the request/reply chain. * **ContentDisposition** *(string) --* Specifies presentational information for the object. * **ContentEncoding** *(string) --* Indicates 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. * **ContentRange** *(string) --* The portion of the object returned in the response. * **ContentType** *(string) --* A standard MIME type describing the format of the object data. * **Expires** *(datetime) --* The date and time at which the object is no longer cacheable. Note: This member has been deprecated. Please use "ExpiresString" instead. * **ExpiresString** *(string) --* The raw, unparsed value of the "Expires" field. * **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. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **Metadata** *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **StorageClass** *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ReplicationStatus** *(string) --* Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule. Note: This functionality is not supported for directory buckets. * **PartsCount** *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. * **TagCount** *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** *(string) --* The Object Lock mode that's currently in place for this object. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date and time when this object's Object Lock will expire. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** *(string) --* Indicates whether this object has an active legal hold. This field is only returned if you have permission to view an object's legal hold status. Note: This functionality is not supported for directory buckets. ObjectVersion / Attribute / key key *** S3.ObjectVersion.key * *(string) --* The object key. ObjectVersion / Attribute / checksum_algorithm checksum_algorithm ****************** S3.ObjectVersion.checksum_algorithm * *(list) --* The algorithm that was used to create a checksum of the object. * *(string) --* ObjectVersion / Sub-Resource / Object Object ****** S3.ObjectVersion.Object() Creates a Object resource.: object = object_version.Object() Return type: "S3.Object" Returns: A Object resource ObjectVersion / Identifier / object_key object_key ********** S3.ObjectVersion.object_key *(string)* The ObjectVersion's object_key identifier. This **must** be set. ObjectVersion / Attribute / e_tag e_tag ***** S3.ObjectVersion.e_tag * *(string) --* The entity tag is an MD5 hash of that version of the object. ObjectVersion / Identifier / id id ** S3.ObjectVersion.id *(string)* The ObjectVersion's id identifier. This **must** be set. ObjectVersion / Attribute / last_modified last_modified ************* S3.ObjectVersion.last_modified * *(datetime) --* Date and time when the object was last modified. ObjectVersion / Action / head head **** S3.ObjectVersion.head(**kwargs) The "HEAD" operation retrieves metadata from an object without returning the object itself. This operation is useful if you're interested only in an object's metadata. Note: A "HEAD" request has the same options as a "GET" operation on an object. The response is identical to the "GET" response except that there is no response body. Because of this, if the "HEAD" request generates an error, it returns a generic code, such as "400 Bad Request", "403 Forbidden", "404 Not Found", "405 Method Not Allowed", "412 Precondition Failed", or "304 Not Modified". It's not possible to retrieve the exact exception of these error codes. Request headers are limited to 8 KB in size. For more information, see Common Request Headers. Permissions * **General purpose bucket permissions** - To use "HEAD", you must have the "s3:GetObject" permission. You need the relevant read object (or version) permission for this operation. For more information, see Actions, resources, and condition keys for Amazon S3 in the *Amazon S3 User Guide*. For more information about the permissions to S3 API operations by S3 resource types, see Required permissions for Amazon S3 API operations in the *Amazon S3 User Guide*. If the object you request doesn't exist, the error that Amazon S3 returns depends on whether you also have the "s3:ListBucket" permission. * If you have the "s3:ListBucket" permission on the bucket, Amazon S3 returns an HTTP status code "404 Not Found" error. * If you don’t have the "s3:ListBucket" permission, Amazon S3 returns an HTTP status code "403 Forbidden" error. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. If you enable "x-amz-checksum-mode" in the request and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Encryption Note: Encryption request headers, like "x-amz-server-side-encryption", should not be sent for "HEAD" requests if your object uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3 managed encryption keys (SSE-S3). The "x-amz-server- side-encryption" header is used when you "PUT" an object to S3 and want to specify the encryption method. If you include this header in a "HEAD" request for an object that uses these types of keys, you’ll get an HTTP "400 Bad Request" error. It's because the encryption method can't be changed when you retrieve the object. If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are: * "x-amz-server-side-encryption-customer-algorithm" * "x-amz-server-side-encryption-customer-key" * "x-amz-server-side-encryption-customer-key-MD5" For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the *Amazon S3 User Guide*. Note: **Directory bucket** - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*.Versioning * If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes "x-amz- delete-marker: true" in the response. * If the specified version is a delete marker, the response returns a "405 Method Not Allowed" error and the "Last-Modified: timestamp" response header. Note: * **Directory buckets** - Delete marker is not supported for directory buckets. * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". Note: For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual- hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. The following actions are related to "HeadObject": * GetObject * GetObjectAttributes See also: AWS API Documentation **Request Syntax** response = object_version.head( IfMatch='string', IfModifiedSince=datetime(2015, 1, 1), IfNoneMatch='string', IfUnmodifiedSince=datetime(2015, 1, 1), Range='string', ResponseCacheControl='string', ResponseContentDisposition='string', ResponseContentEncoding='string', ResponseContentLanguage='string', ResponseContentType='string', ResponseExpires=datetime(2015, 1, 1), SSECustomerAlgorithm='string', SSECustomerKey='string', RequestPayer='requester', PartNumber=123, ExpectedBucketOwner='string', ChecksumMode='ENABLED' ) Parameters: * **IfMatch** (*string*) -- Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **IfModifiedSince** (*datetime*) -- Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfNoneMatch** (*string*) -- Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error. If both of the "If-None-Match" and "If-Modified-Since" headers are present in the request as follows: * "If-None-Match" condition evaluates to "false", and; * "If-Modified-Since" condition evaluates to "true"; Then Amazon S3 returns the "304 Not Modified" response code. For more information about conditional requests, see RFC 7232. * **IfUnmodifiedSince** (*datetime*) -- Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error. If both of the "If-Match" and "If-Unmodified-Since" headers are present in the request as follows: * "If-Match" condition evaluates to "true", and; * "If-Unmodified-Since" condition evaluates to "false"; Then Amazon S3 returns "200 OK" and the data requested. For more information about conditional requests, see RFC 7232. * **Range** (*string*) -- HeadObject returns only the metadata for an object. If the Range is satisfiable, only the "ContentLength" is affected in the response. If the Range is not satisfiable, S3 returns a "416 - Requested Range Not Satisfiable" error. * **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** (*datetime*) -- Sets the "Expires" header of the response. * **SSECustomerAlgorithm** (*string*) -- Specifies the algorithm to use when encrypting the object (for example, AES256). Note: This functionality is not supported for directory buckets. * **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 S3 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. Note: This functionality is not supported for directory buckets. * **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 that the encryption key was transmitted without error. Note: This functionality is not supported for directory buckets. Please note that this parameter is automatically populated if it is not provided. Including this parameter is not required * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **PartNumber** (*integer*) -- Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **ChecksumMode** (*string*) -- To retrieve the checksum, this parameter must be enabled. **General purpose buckets** - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the "kms:Decrypt" action to retrieve the checksum. **Directory buckets** - If you enable "ChecksumMode" and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the "kms:GenerateDataKey" and "kms:Decrypt" permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object. Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'AcceptRanges': 'string', 'Expiration': 'string', 'Restore': 'string', 'ArchiveStatus': 'ARCHIVE_ACCESS'|'DEEP_ARCHIVE_ACCESS', 'LastModified': datetime(2015, 1, 1), 'ContentLength': 123, 'ChecksumCRC32': 'string', 'ChecksumCRC32C': 'string', 'ChecksumCRC64NVME': 'string', 'ChecksumSHA1': 'string', 'ChecksumSHA256': 'string', 'ChecksumType': 'COMPOSITE'|'FULL_OBJECT', 'ETag': 'string', 'MissingMeta': 123, 'VersionId': 'string', 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'ContentType': 'string', 'ContentRange': 'string', 'Expires': datetime(2015, 1, 1), 'ExpiresString': 'string', 'WebsiteRedirectLocation': 'string', 'ServerSideEncryption': 'AES256'|'aws:fsx'|'aws:kms'|'aws:kms:dsse', 'Metadata': { 'string': 'string' }, 'SSECustomerAlgorithm': 'string', 'SSECustomerKeyMD5': 'string', 'SSEKMSKeyId': 'string', 'BucketKeyEnabled': True|False, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR'|'SNOW'|'EXPRESS_ONEZONE'|'FSX_OPENZFS', 'RequestCharged': 'requester', 'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'|'COMPLETED', 'PartsCount': 123, 'TagCount': 123, 'ObjectLockMode': 'GOVERNANCE'|'COMPLIANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'ObjectLockLegalHoldStatus': 'ON'|'OFF' } **Response Structure** * *(dict) --* * **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. Note: This functionality is not supported for directory buckets. * **AcceptRanges** *(string) --* Indicates that a range of bytes was specified. * **Expiration** *(string) --* If the object expiration is configured (see PutBucketLifecycleConfiguration), 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. Note: Object expiration information is not returned in directory buckets and this header returns the value " "NotImplemented"" in all responses for directory buckets. * **Restore** *(string) --* If the object is an archived object (an object whose storage class is GLACIER), the response includes this header if either the archive restoration is in progress (see RestoreObject or an archive copy is already restored. If an archive copy is already restored, the header value indicates when Amazon S3 is scheduled to delete the object copy. For example: "x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 GMT"" If the object restoration is in progress, the header returns the value "ongoing-request="true"". For more information about archiving objects, see Transitioning Objects: General Considerations. Note: This functionality is not supported for directory buckets. Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones. * **ArchiveStatus** *(string) --* The archive state of the head object. Note: This functionality is not supported for directory buckets. * **LastModified** *(datetime) --* Date and time when the object was last modified. * **ContentLength** *(integer) --* Size of the body in bytes. * **ChecksumCRC32** *(string) --* The Base64 encoded, 32-bit "CRC32 checksum" of the object. This checksum is only be present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC32C** *(string) --* The Base64 encoded, 32-bit "CRC32C" checksum of the object. This checksum is only present if the checksum was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumCRC64NVME** *(string) --* The Base64 encoded, 64-bit "CRC64NVME" checksum of the object. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ChecksumSHA1** *(string) --* The Base64 encoded, 160-bit "SHA1" digest of the object. This will only be present if the object was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumSHA256** *(string) --* The Base64 encoded, 256-bit "SHA256" digest of the object. This will only be present if the object was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the *Amazon S3 User Guide*. * **ChecksumType** *(string) --* The checksum type, which determines how part-level checksums are combined to create an object-level checksum for multipart objects. You can use this header response to verify that the checksum type that is received is the same checksum type that was specified in "CreateMultipartUpload" request. For more information, see Checking object integrity in the Amazon S3 User Guide. * **ETag** *(string) --* An entity tag (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. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Version ID of the object. Note: This functionality is not supported for directory buckets. * **CacheControl** *(string) --* Specifies caching behavior along the request/reply chain. * **ContentDisposition** *(string) --* Specifies presentational information for the object. * **ContentEncoding** *(string) --* Indicates 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. * **ContentRange** *(string) --* The portion of the object returned in the response for a "GET" request. * **Expires** *(datetime) --* The date and time at which the object is no longer cacheable. Note: This member has been deprecated. Please use "ExpiresString" instead. * **ExpiresString** *(string) --* The raw, unparsed value of the "Expires" field. * **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. Note: This functionality is not supported for directory buckets. * **ServerSideEncryption** *(string) --* The server-side encryption algorithm used when you store this object in Amazon S3 or Amazon FSx. Note: When accessing data stored in Amazon FSx file systems using S3 access points, the only valid server side encryption option is "aws:fsx". * **Metadata** *(dict) --* A map of metadata to store with the object in S3. * *(string) --* * *(string) --* * **SSECustomerAlgorithm** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used. Note: This functionality is not supported for directory buckets. * **SSECustomerKeyMD5** *(string) --* If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key. Note: This functionality is not supported for directory buckets. * **SSEKMSKeyId** *(string) --* If present, indicates the ID of the KMS key that was used for object encryption. * **BucketKeyEnabled** *(boolean) --* Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS). * **StorageClass** *(string) --* Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects. For more information, see Storage Classes. Note: **Directory buckets** - Directory buckets only support "EXPRESS_ONEZONE" (the S3 Express One Zone storage class) in Availability Zones and "ONEZONE_IA" (the S3 One Zone- Infrequent Access storage class) in Dedicated Local Zones. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. * **ReplicationStatus** *(string) --* Amazon S3 can return this header if your request involves a bucket that is either a source or a destination in a replication rule. In replication, you have a source bucket on which you configure replication and destination bucket or buckets where Amazon S3 stores object replicas. When you request an object ( "GetObject") or object metadata ( "HeadObject") from these buckets, Amazon S3 will return the "x-amz- replication-status" header in the response as follows: * **If requesting an object from the source bucket**, Amazon S3 will return the "x-amz-replication-status" header if the object in your request is eligible for replication. For example, suppose that in your replication configuration, you specify object prefix "TaxDocs" requesting Amazon S3 to replicate objects with key prefix "TaxDocs". Any objects you upload with this key name prefix, for example "TaxDocs/document1.pdf", are eligible for replication. For any object request with this key name prefix, Amazon S3 will return the "x-amz-replication- status" header with value PENDING, COMPLETED or FAILED indicating object replication status. * **If requesting an object from a destination bucket**, Amazon S3 will return the "x-amz-replication-status" header with value REPLICA if the object in your request is a replica that Amazon S3 created and there is no replica modification replication in progress. * **When replicating objects to multiple destination buckets**, the "x-amz-replication-status" header acts differently. The header of the source object will only return a value of COMPLETED when replication is successful to all destinations. The header will remain at value PENDING until replication has completed for all destinations. If one or more destinations fails replication the header will return FAILED. For more information, see Replication. Note: This functionality is not supported for directory buckets. * **PartsCount** *(integer) --* The count of parts this object has. This value is only returned if you specify "partNumber" in your request and the object was uploaded as a multipart upload. * **TagCount** *(integer) --* The number of tags, if any, on the object, when you have the relevant permission to read object tags. You can use GetObjectTagging to retrieve the tag set associated with an object. Note: This functionality is not supported for directory buckets. * **ObjectLockMode** *(string) --* The Object Lock mode, if any, that's in effect for this object. This header is only returned if the requester has the "s3:GetObjectRetention" permission. For more information about S3 Object Lock, see Object Lock. Note: This functionality is not supported for directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date and time when the Object Lock retention period expires. This header is only returned if the requester has the "s3:GetObjectRetention" permission. Note: This functionality is not supported for directory buckets. * **ObjectLockLegalHoldStatus** *(string) --* Specifies whether a legal hold is in effect for this object. This header is only returned if the requester has the "s3:GetObjectLegalHold" permission. This header is not returned if the specified version of this object has never had a legal hold applied. For more information about S3 Object Lock, see Object Lock. Note: This functionality is not supported for directory buckets. ObjectVersion / Attribute / is_latest is_latest ********* S3.ObjectVersion.is_latest * *(boolean) --* Specifies whether the object is (true) or is not (false) the latest version of an object. ObjectVersion / Action / delete delete ****** S3.ObjectVersion.delete(**kwargs) Removes an object from a bucket. The behavior depends on the bucket's versioning state: * If bucket versioning is not enabled, the operation permanently deletes the object. * If bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the object. To permanently delete an object in a versioned bucket, you must include the object’s "versionId" in the request. For more information about versioning-enabled buckets, see Deleting object versions from a versioning-enabled bucket. * If bucket versioning is suspended, the operation removes the object that has a null "versionId", if there is one, and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null "versionId", and all versions of the object have a "versionId", Amazon S3 does not remove the object and only inserts a delete marker. To permanently delete an object that has a "versionId", you must include the object’s "versionId" in the request. For more information about versioning-suspended buckets, see Deleting objects from versioning-suspended buckets. Note: * **Directory buckets** - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the "null" value of the version ID is supported by directory buckets. You can only specify "null" to the "versionId" query parameter in the request. * **Directory buckets** - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format >>``<>``<<. Path-style requests are not supported. For more information about endpoints in Availability Zones, see Regional and Zonal endpoints for directory buckets in Availability Zones in the *Amazon S3 User Guide*. For more information about endpoints in Local Zones, see Concepts for directory buckets in Local Zones in the *Amazon S3 User Guide*. To remove a specific version, you must use the "versionId" query parameter. Using this query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3 sets the response header "x-amz-delete-marker" to true. If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include the "x-amz-mfa" request header in the DELETE "versionId" request. Requests that include "x-amz-mfa" must use HTTPS. For more information about MFA Delete, see Using MFA Delete in the *Amazon S3 User Guide*. To see sample requests that use versioning, see Sample Request. Note: **Directory buckets** - MFA delete is not supported by directory buckets. You can delete objects by explicitly calling DELETE Object or calling ( PutBucketLifecycle) to enable Amazon S3 to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them the "s3:DeleteObject", "s3:DeleteObjectVersion", and "s3:PutLifeCycleConfiguration" actions. Note: **Directory buckets** - S3 Lifecycle is not supported by directory buckets.Permissions * **General purpose bucket permissions** - The following permissions are required in your policies when your "DeleteObjects" request includes specific headers. * "s3:DeleteObject" - To delete an object from a bucket, you must always have the "s3:DeleteObject" permission. * "s3:DeleteObjectVersion" - To delete a specific version of an object from a versioning-enabled bucket, you must have the "s3:DeleteObjectVersion" permission. * **Directory bucket permissions** - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the "s3express:CreateSession" permission to the directory bucket in a bucket policy or an IAM identity- based policy. Then, you make the "CreateSession" API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another "CreateSession" API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "Bucket-name .s3express-zone-id.region-code.amazonaws.com". The following action is related to "DeleteObject": * PutObject See also: AWS API Documentation **Request Syntax** response = object_version.delete( MFA='string', RequestPayer='requester', BypassGovernanceRetention=True|False, ExpectedBucketOwner='string', IfMatch='string', IfMatchLastModifiedTime=datetime(2015, 1, 1), IfMatchSize=123 ) Parameters: * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled. Note: This functionality is not supported for directory buckets. * **RequestPayer** (*string*) -- Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the *Amazon S3 User Guide*. Note: This functionality is not supported for directory buckets. * **BypassGovernanceRetention** (*boolean*) -- Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the "s3:BypassGovernanceRetention" permission. Note: This functionality is not supported for directory buckets. * **ExpectedBucketOwner** (*string*) -- The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code "403 Forbidden" (access denied). * **IfMatch** (*string*) -- The "If-Match" header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a "412 Precondition Failed" error. If the ETag matches or if the object doesn't exist, the operation will return a "204 Success (No Content) response". For more information about conditional requests, see RFC 7232. Note: This functionality is only supported for directory buckets. * **IfMatchLastModifiedTime** (*datetime*) -- If present, the object is deleted only if its modification times matches the provided "Timestamp". If the "Timestamp" values do not match, the operation returns a "412 Precondition Failed" error. If the "Timestamp" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. * **IfMatchSize** (*integer*) -- If present, the object is deleted only if its size matches the provided size in bytes. If the "Size" value does not match, the operation returns a "412 Precondition Failed" error. If the "Size" matches or if the object doesn’t exist, the operation returns a "204 Success (No Content)" response. Note: This functionality is only supported for directory buckets. Warning: You can use the "If-Match", "x-amz-if-match-last-modified- time" and "x-amz-if-match-size" conditional headers in conjunction with each-other or individually. Return type: dict Returns: **Response Syntax** { 'DeleteMarker': True|False, 'VersionId': 'string', 'RequestCharged': 'requester' } **Response Structure** * *(dict) --* * **DeleteMarker** *(boolean) --* Indicates whether the specified object version that was permanently deleted was (true) or was not (false) a delete marker before deletion. In a simple DELETE, this header indicates whether (true) or not (false) the current version of the object is a delete marker. To learn more about delete markers, see Working with delete markers. Note: This functionality is not supported for directory buckets. * **VersionId** *(string) --* Returns the version ID of the delete marker created as a result of the DELETE operation. Note: This functionality is not supported for directory buckets. * **RequestCharged** *(string) --* If present, indicates that the requester was successfully charged for the request. For more information, see Using Requester Pays buckets for storage transfers and usage in the *Amazon Simple Storage Service user guide*. Note: This functionality is not supported for directory buckets. S3Control ********* Client ====== class S3Control.Client A low-level client representing AWS S3 Control Amazon Web Services S3 Control provides access to Amazon S3 control plane actions. import boto3 client = boto3.client('s3control') These are the available methods: * associate_access_grants_identity_center * can_paginate * close * create_access_grant * create_access_grants_instance * create_access_grants_location * create_access_point * create_access_point_for_object_lambda * create_bucket * create_job * create_multi_region_access_point * create_storage_lens_group * delete_access_grant * delete_access_grants_instance * delete_access_grants_instance_resource_policy * delete_access_grants_location * delete_access_point * delete_access_point_for_object_lambda * delete_access_point_policy * delete_access_point_policy_for_object_lambda * delete_access_point_scope * delete_bucket * delete_bucket_lifecycle_configuration * delete_bucket_policy * delete_bucket_replication * delete_bucket_tagging * delete_job_tagging * delete_multi_region_access_point * delete_public_access_block * delete_storage_lens_configuration * delete_storage_lens_configuration_tagging * delete_storage_lens_group * describe_job * describe_multi_region_access_point_operation * dissociate_access_grants_identity_center * get_access_grant * get_access_grants_instance * get_access_grants_instance_for_prefix * get_access_grants_instance_resource_policy * get_access_grants_location * get_access_point * get_access_point_configuration_for_object_lambda * get_access_point_for_object_lambda * get_access_point_policy * get_access_point_policy_for_object_lambda * get_access_point_policy_status * get_access_point_policy_status_for_object_lambda * get_access_point_scope * get_bucket * get_bucket_lifecycle_configuration * get_bucket_policy * get_bucket_replication * get_bucket_tagging * get_bucket_versioning * get_data_access * get_job_tagging * get_multi_region_access_point * get_multi_region_access_point_policy * get_multi_region_access_point_policy_status * get_multi_region_access_point_routes * get_paginator * get_public_access_block * get_storage_lens_configuration * get_storage_lens_configuration_tagging * get_storage_lens_group * get_waiter * list_access_grants * list_access_grants_instances * list_access_grants_locations * list_access_points * list_access_points_for_directory_buckets * list_access_points_for_object_lambda * list_caller_access_grants * list_jobs * list_multi_region_access_points * list_regional_buckets * list_storage_lens_configurations * list_storage_lens_groups * list_tags_for_resource * put_access_grants_instance_resource_policy * put_access_point_configuration_for_object_lambda * put_access_point_policy * put_access_point_policy_for_object_lambda * put_access_point_scope * put_bucket_lifecycle_configuration * put_bucket_policy * put_bucket_replication * put_bucket_tagging * put_bucket_versioning * put_job_tagging * put_multi_region_access_point_policy * put_public_access_block * put_storage_lens_configuration * put_storage_lens_configuration_tagging * submit_multi_region_access_point_routes * tag_resource * untag_resource * update_access_grants_location * update_job_priority * update_job_status * update_storage_lens_group Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListAccessPointsForDirectoryBuckets * ListAccessPointsForObjectLambda * ListCallerAccessGrants S3Control / Paginator / ListAccessPointsForObjectLambda ListAccessPointsForObjectLambda ******************************* class S3Control.Paginator.ListAccessPointsForObjectLambda paginator = client.get_paginator('list_access_points_for_object_lambda') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Control.Client.list_access_points_for_object_lambda()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( AccountId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'ObjectLambdaAccessPointList': [ { 'Name': 'string', 'ObjectLambdaAccessPointArn': 'string', 'Alias': { 'Value': 'string', 'Status': 'PROVISIONING'|'READY' } }, ], } **Response Structure** * *(dict) --* * **ObjectLambdaAccessPointList** *(list) --* Returns list of Object Lambda Access Points. * *(dict) --* An access point with an attached Lambda function used to access transformed data from an Amazon S3 bucket. * **Name** *(string) --* The name of the Object Lambda Access Point. * **ObjectLambdaAccessPointArn** *(string) --* Specifies the ARN for the Object Lambda Access Point. * **Alias** *(dict) --* The alias of the Object Lambda Access Point. * **Value** *(string) --* The alias value of the Object Lambda Access Point. * **Status** *(string) --* The status of the Object Lambda Access Point alias. If the status is "PROVISIONING", the Object Lambda Access Point is provisioning the alias and the alias is not ready for use yet. If the status is "READY", the Object Lambda Access Point alias is successfully provisioned and ready for use. S3Control / Paginator / ListAccessPointsForDirectoryBuckets ListAccessPointsForDirectoryBuckets *********************************** class S3Control.Paginator.ListAccessPointsForDirectoryBuckets paginator = client.get_paginator('list_access_points_for_directory_buckets') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Control.Client.list_access_points_for_directory_buckets()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( AccountId='string', DirectoryBucket='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the access points. * **DirectoryBucket** (*string*) -- The name of the directory bucket associated with the access points you want to list. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'AccessPointList': [ { 'Name': 'string', 'NetworkOrigin': 'Internet'|'VPC', 'VpcConfiguration': { 'VpcId': 'string' }, 'Bucket': 'string', 'AccessPointArn': 'string', 'Alias': 'string', 'BucketAccountId': 'string', 'DataSourceId': 'string', 'DataSourceType': 'string' }, ], } **Response Structure** * *(dict) --* * **AccessPointList** *(list) --* Contains identification and configuration information for one or more access points associated with the directory bucket. * *(dict) --* An access point used to access a bucket. * **Name** *(string) --* The name of this access point. * **NetworkOrigin** *(string) --* Indicates whether this access point allows access from the public internet. If "VpcConfiguration" is specified for this access point, then "NetworkOrigin" is "VPC", and the access point doesn't allow access from the public internet. Otherwise, "NetworkOrigin" is "Internet", and the access point allows access from the public internet, subject to the access point and bucket access policies. * **VpcConfiguration** *(dict) --* The virtual private cloud (VPC) configuration for this access point, if one exists. Note: This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services. * **VpcId** *(string) --* If this field is specified, this access point will only allow connections from the specified VPC ID. * **Bucket** *(string) --* The name of the bucket associated with this access point. * **AccessPointArn** *(string) --* The ARN for the access point. * **Alias** *(string) --* The name or alias of the access point. * **BucketAccountId** *(string) --* The Amazon Web Services account ID associated with the S3 bucket associated with this access point. * **DataSourceId** *(string) --* A unique identifier for the data source of the access point. * **DataSourceType** *(string) --* The type of the data source that the access point is attached to. S3Control / Paginator / ListCallerAccessGrants ListCallerAccessGrants ********************** class S3Control.Paginator.ListCallerAccessGrants paginator = client.get_paginator('list_caller_access_grants') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Control.Client.list_caller_access_grants()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( AccountId='string', GrantScope='string', AllowedByApplication=True|False, PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **GrantScope** (*string*) -- The S3 path of the data that you would like to access. Must start with "s3://". You can optionally pass only the beginning characters of a path, and S3 Access Grants will search for all applicable grants for the path fragment. * **AllowedByApplication** (*boolean*) -- If this optional parameter is passed in the request, a filter is applied to the results. The results will include only the access grants for the caller's Identity Center application or for any other applications ( "ALL"). * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'CallerAccessGrantsList': [ { 'Permission': 'READ'|'WRITE'|'READWRITE', 'GrantScope': 'string', 'ApplicationArn': 'string' }, ] } **Response Structure** * *(dict) --* * **CallerAccessGrantsList** *(list) --* A list of the caller's access grants that were created using S3 Access Grants and that grant the caller access to the S3 data of the Amazon Web Services account ID that was specified in the request. * *(dict) --* Part of "ListCallerAccessGrantsResult". Each entry includes the permission level (READ, WRITE, or READWRITE) and the grant scope of the access grant. If the grant also includes an application ARN, the grantee can only access the S3 data through this application. * **Permission** *(string) --* The type of permission granted, which can be one of the following values: * "READ" - Grants read-only access to the S3 data. * "WRITE" - Grants write-only access to the S3 data. * "READWRITE" - Grants both read and write access to the S3 data. * **GrantScope** *(string) --* The S3 path of the data to which you have been granted access. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. S3Control / Client / put_bucket_replication put_bucket_replication ********************** S3Control.Client.put_bucket_replication(**kwargs) Note: This action creates an Amazon S3 on Outposts bucket's replication configuration. To create an S3 bucket's replication configuration, see PutBucketReplication in the *Amazon S3 API Reference*. Creates a replication configuration or replaces an existing one. For information about S3 replication on Outposts configuration, see Replicating objects for S3 on Outposts in the *Amazon S3 User Guide*. Note: It can take a while to propagate "PUT" or "DELETE" requests for a replication configuration to all S3 on Outposts systems. Therefore, the replication configuration that's returned by a "GET" request soon after a "PUT" or "DELETE" request might return a more recent result than what's on the Outpost. If an Outpost is offline, the delay in updating the replication configuration on that Outpost can be significant. Specify the replication configuration in the request body. In the replication configuration, you provide the following information: * The name of the destination bucket or buckets where you want S3 on Outposts to replicate objects * The Identity and Access Management (IAM) role that S3 on Outposts can assume to replicate objects on your behalf * Other relevant information, such as replication rules A replication configuration must include at least one rule and can contain a maximum of 100. Each rule identifies a subset of objects to replicate by filtering the objects in the source Outposts bucket. To choose additional subsets of objects to replicate, add a rule for each subset. To specify a subset of the objects in the source Outposts bucket to apply a replication rule to, add the "Filter" element as a child of the "Rule" element. You can filter objects based on an object key prefix, one or more object tags, or both. When you add the "Filter" element in the configuration, you must also add the following elements: "DeleteMarkerReplication", "Status", and "Priority". Using "PutBucketReplication" on Outposts requires that both the source and destination buckets must have versioning enabled. For information about enabling versioning on a bucket, see Managing S3 Versioning for your S3 on Outposts bucket. For information about S3 on Outposts replication failure reasons, see Replication failure reasons in the *Amazon S3 User Guide*. **Handling Replication of Encrypted Objects** Outposts buckets are encrypted at all times. All the objects in the source Outposts bucket are encrypted and can be replicated. Also, all the replicas in the destination Outposts bucket are encrypted with the same encryption key as the objects in the source Outposts bucket. **Permissions** To create a "PutBucketReplication" request, you must have "s3-outposts:PutReplicationConfiguration" permissions for the bucket. The Outposts bucket owner has this permission by default and can grant it to others. For more information about permissions, see Setting up IAM with S3 on Outposts and Managing access to S3 on Outposts buckets. Note: To perform this operation, the user or role must also have the "iam:CreateRole" and "iam:PassRole" permissions. For more information, see Granting a user permissions to pass a role to an Amazon Web Services service. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following operations are related to "PutBucketReplication": * GetBucketReplication * DeleteBucketReplication See also: AWS API Documentation **Request Syntax** response = client.put_bucket_replication( AccountId='string', Bucket='string', ReplicationConfiguration={ 'Role': 'string', 'Rules': [ { 'ID': 'string', 'Priority': 123, 'Prefix': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'Status': 'Enabled'|'Disabled', 'SourceSelectionCriteria': { 'SseKmsEncryptedObjects': { 'Status': 'Enabled'|'Disabled' }, 'ReplicaModifications': { 'Status': 'Enabled'|'Disabled' } }, 'ExistingObjectReplication': { 'Status': 'Enabled'|'Disabled' }, 'Destination': { 'Account': 'string', 'Bucket': 'string', 'ReplicationTime': { 'Status': 'Enabled'|'Disabled', 'Time': { 'Minutes': 123 } }, 'AccessControlTranslation': { 'Owner': 'Destination' }, 'EncryptionConfiguration': { 'ReplicaKmsKeyID': 'string' }, 'Metrics': { 'Status': 'Enabled'|'Disabled', 'EventThreshold': { 'Minutes': 123 } }, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR' }, 'DeleteMarkerReplication': { 'Status': 'Enabled'|'Disabled' }, 'Bucket': 'string' }, ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the S3 on Outposts bucket to set the configuration for. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. * **ReplicationConfiguration** (*dict*) -- **[REQUIRED]** * **Role** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that S3 on Outposts assumes when replicating objects. For information about S3 replication on Outposts configuration, see Setting up replication in the *Amazon S3 User Guide*. * **Rules** *(list) --* **[REQUIRED]** A container for one or more replication rules. A replication configuration must have at least one rule and can contain an array of 100 rules at the most. * *(dict) --* Specifies which S3 on Outposts objects to replicate and where to store the replicas. * **ID** *(string) --* A unique identifier for the rule. The maximum value is 255 characters. * **Priority** *(integer) --* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts attempts to replicate objects according to all replication rules. However, if there are two or more rules with the same destination Outposts bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority. For more information, see Creating replication rules on Outposts in the *Amazon S3 User Guide*. * **Prefix** *(string) --* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **Filter** *(dict) --* A filter that identifies the subset of objects to which the replication rule applies. A "Filter" element must specify exactly one "Prefix", "Tag", or "And" child element. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects that the rule applies to. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **Tag** *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **And** *(dict) --* A container for specifying rule filters. The filters determine the subset of objects that the rule applies to. This element is required only if you specify more than one filter. For example: * If you specify both a "Prefix" and a "Tag" filter, wrap these filters in an "And" element. * If you specify a filter based on multiple tags, wrap the "Tag" elements in an "And" element. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects that the rule applies to. * **Tags** *(list) --* An array of tags that contain key and value pairs. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **Status** *(string) --* **[REQUIRED]** Specifies whether the rule is enabled. * **SourceSelectionCriteria** *(dict) --* A container that describes additional filters for identifying the source Outposts objects that you want to replicate. You can choose to enable or disable the replication of these objects. * **SseKmsEncryptedObjects** *(dict) --* A filter that you can use to select Amazon S3 objects that are encrypted with server-side encryption by using Key Management Service (KMS) keys. If you include "SourceSelectionCriteria" in the replication configuration, this element is required. Note: This is not supported by Amazon S3 on Outposts buckets. * **Status** *(string) --* **[REQUIRED]** Specifies whether Amazon S3 replicates objects that are created with server-side encryption by using an KMS key stored in Key Management Service. * **ReplicaModifications** *(dict) --* A filter that you can use to specify whether replica modification sync is enabled. S3 on Outposts replica modification sync can help you keep object metadata synchronized between replicas and source objects. By default, S3 on Outposts replicates metadata from the source objects to the replicas only. When replica modification sync is enabled, S3 on Outposts replicates metadata changes made to the replica copies back to the source object, making the replication bidirectional. To replicate object metadata modifications on replicas, you can specify this element and set the "Status" of this element to "Enabled". Note: You must enable replica modification sync on the source and destination buckets to replicate replica metadata changes between the source and the replicas. * **Status** *(string) --* **[REQUIRED]** Specifies whether S3 on Outposts replicates modifications to object metadata on replicas. * **ExistingObjectReplication** *(dict) --* An optional configuration to replicate existing source bucket objects. Note: This is not supported by Amazon S3 on Outposts buckets. * **Status** *(string) --* **[REQUIRED]** Specifies whether Amazon S3 replicates existing source bucket objects. * **Destination** *(dict) --* **[REQUIRED]** A container for information about the replication destination and its configurations. * **Account** *(string) --* The destination bucket owner's account ID. * **Bucket** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the access point for the destination bucket where you want S3 on Outposts to store the replication results. * **ReplicationTime** *(dict) --* A container that specifies S3 Replication Time Control (S3 RTC) settings, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a "Metrics" block. Note: This is not supported by Amazon S3 on Outposts buckets. * **Status** *(string) --* **[REQUIRED]** Specifies whether S3 Replication Time Control (S3 RTC) is enabled. * **Time** *(dict) --* **[REQUIRED]** A container that specifies the time by which replication should be complete for all objects and operations on objects. * **Minutes** *(integer) --* Contains an integer that specifies the time period in minutes. Valid value: 15 * **AccessControlTranslation** *(dict) --* Specify this property only in a cross-account scenario (where the source and destination bucket owners are not the same), and you want to change replica ownership to the Amazon Web Services account that owns the destination bucket. If this property is not specified in the replication configuration, the replicas are owned by same Amazon Web Services account that owns the source object. Note: This is not supported by Amazon S3 on Outposts buckets. * **Owner** *(string) --* **[REQUIRED]** Specifies the replica ownership. * **EncryptionConfiguration** *(dict) --* A container that provides information about encryption. If "SourceSelectionCriteria" is specified, you must specify this element. Note: This is not supported by Amazon S3 on Outposts buckets. * **ReplicaKmsKeyID** *(string) --* Specifies the ID of the customer managed KMS key that's stored in Key Management Service (KMS) for the destination bucket. This ID is either the Amazon Resource Name (ARN) for the KMS key or the alias ARN for the KMS key. Amazon S3 uses this KMS key to encrypt replica objects. Amazon S3 supports only symmetric encryption KMS keys. For more information, see Symmetric encryption KMS keys in the *Amazon Web Services Key Management Service Developer Guide*. * **Metrics** *(dict) --* A container that specifies replication metrics-related settings. * **Status** *(string) --* **[REQUIRED]** Specifies whether replication metrics are enabled. * **EventThreshold** *(dict) --* A container that specifies the time threshold for emitting the "s3:Replication:OperationMissedThreshold" event. Note: This is not supported by Amazon S3 on Outposts buckets. * **Minutes** *(integer) --* Contains an integer that specifies the time period in minutes. Valid value: 15 * **StorageClass** *(string) --* The storage class to use when replicating objects. All objects stored on S3 on Outposts are stored in the "OUTPOSTS" storage class. S3 on Outposts uses the "OUTPOSTS" storage class to create the object replicas. Note: Values other than "OUTPOSTS" aren't supported by Amazon S3 on Outposts. * **DeleteMarkerReplication** *(dict) --* Specifies whether S3 on Outposts replicates delete markers. If you specify a "Filter" element in your replication configuration, you must also include a "DeleteMarkerReplication" element. If your "Filter" includes a "Tag" element, the "DeleteMarkerReplication" element's "Status" child element must be set to "Disabled", because S3 on Outposts doesn't support replicating delete markers for tag-based rules. For more information about delete marker replication, see How delete operations affect replication in the *Amazon S3 User Guide*. * **Status** *(string) --* **[REQUIRED]** Indicates whether to replicate delete markers. * **Bucket** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to replicate the objects from. Returns: None S3Control / Client / get_storage_lens_configuration get_storage_lens_configuration ****************************** S3Control.Client.get_storage_lens_configuration(**kwargs) Note: This operation is not supported by directory buckets. Gets the Amazon S3 Storage Lens configuration. For more information, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. For a complete list of S3 Storage Lens metrics, see S3 Storage Lens metrics glossary in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:GetStorageLensConfiguration" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.get_storage_lens_configuration( ConfigId='string', AccountId='string' ) Parameters: * **ConfigId** (*string*) -- **[REQUIRED]** The ID of the Amazon S3 Storage Lens configuration. * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. Return type: dict Returns: **Response Syntax** { 'StorageLensConfiguration': { 'Id': 'string', 'AccountLevel': { 'ActivityMetrics': { 'IsEnabled': True|False }, 'BucketLevel': { 'ActivityMetrics': { 'IsEnabled': True|False }, 'PrefixLevel': { 'StorageMetrics': { 'IsEnabled': True|False, 'SelectionCriteria': { 'Delimiter': 'string', 'MaxDepth': 123, 'MinStorageBytesPercentage': 123.0 } } }, 'AdvancedCostOptimizationMetrics': { 'IsEnabled': True|False }, 'AdvancedDataProtectionMetrics': { 'IsEnabled': True|False }, 'DetailedStatusCodesMetrics': { 'IsEnabled': True|False } }, 'AdvancedCostOptimizationMetrics': { 'IsEnabled': True|False }, 'AdvancedDataProtectionMetrics': { 'IsEnabled': True|False }, 'DetailedStatusCodesMetrics': { 'IsEnabled': True|False }, 'StorageLensGroupLevel': { 'SelectionCriteria': { 'Include': [ 'string', ], 'Exclude': [ 'string', ] } } }, 'Include': { 'Buckets': [ 'string', ], 'Regions': [ 'string', ] }, 'Exclude': { 'Buckets': [ 'string', ], 'Regions': [ 'string', ] }, 'DataExport': { 'S3BucketDestination': { 'Format': 'CSV'|'Parquet', 'OutputSchemaVersion': 'V_1', 'AccountId': 'string', 'Arn': 'string', 'Prefix': 'string', 'Encryption': { 'SSES3': {}, 'SSEKMS': { 'KeyId': 'string' } } }, 'CloudWatchMetrics': { 'IsEnabled': True|False } }, 'IsEnabled': True|False, 'AwsOrg': { 'Arn': 'string' }, 'StorageLensArn': 'string' } } **Response Structure** * *(dict) --* * **StorageLensConfiguration** *(dict) --* The S3 Storage Lens configuration requested. * **Id** *(string) --* A container for the Amazon S3 Storage Lens configuration ID. * **AccountLevel** *(dict) --* A container for all the account-level configurations of your S3 Storage Lens configuration. * **ActivityMetrics** *(dict) --* A container element for S3 Storage Lens activity metrics. * **IsEnabled** *(boolean) --* A container that indicates whether activity metrics are enabled. * **BucketLevel** *(dict) --* A container element for the S3 Storage Lens bucket-level configuration. * **ActivityMetrics** *(dict) --* A container for the bucket-level activity metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether activity metrics are enabled. * **PrefixLevel** *(dict) --* A container for the prefix-level metrics for S3 Storage Lens. * **StorageMetrics** *(dict) --* A container for the prefix-level storage metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container for whether prefix-level storage metrics are enabled. * **SelectionCriteria** *(dict) --* * **Delimiter** *(string) --* A container for the delimiter of the selection criteria being used. * **MaxDepth** *(integer) --* The max depth of the selection criteria * **MinStorageBytesPercentage** *(float) --* The minimum number of storage bytes percentage whose metrics will be selected. Note: You must choose a value greater than or equal to "1.0". * **AdvancedCostOptimizationMetrics** *(dict) --* A container for bucket-level advanced cost- optimization metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether advanced cost- optimization metrics are enabled. * **AdvancedDataProtectionMetrics** *(dict) --* A container for bucket-level advanced data-protection metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether advanced data- protection metrics are enabled. * **DetailedStatusCodesMetrics** *(dict) --* A container for bucket-level detailed status code metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether detailed status code metrics are enabled. * **AdvancedCostOptimizationMetrics** *(dict) --* A container element for S3 Storage Lens advanced cost- optimization metrics. * **IsEnabled** *(boolean) --* A container that indicates whether advanced cost- optimization metrics are enabled. * **AdvancedDataProtectionMetrics** *(dict) --* A container element for S3 Storage Lens advanced data- protection metrics. * **IsEnabled** *(boolean) --* A container that indicates whether advanced data- protection metrics are enabled. * **DetailedStatusCodesMetrics** *(dict) --* A container element for detailed status code metrics. * **IsEnabled** *(boolean) --* A container that indicates whether detailed status code metrics are enabled. * **StorageLensGroupLevel** *(dict) --* A container element for S3 Storage Lens groups metrics. * **SelectionCriteria** *(dict) --* Indicates which Storage Lens group ARNs to include or exclude in the Storage Lens group aggregation. If this value is left null, then all Storage Lens groups are selected. * **Include** *(list) --* Indicates which Storage Lens group ARNs to include in the Storage Lens group aggregation. * *(string) --* * **Exclude** *(list) --* Indicates which Storage Lens group ARNs to exclude from the Storage Lens group aggregation. * *(string) --* * **Include** *(dict) --* A container for what is included in this configuration. This container can only be valid if there is no "Exclude" container submitted, and it's not empty. * **Buckets** *(list) --* A container for the S3 Storage Lens bucket includes. * *(string) --* * **Regions** *(list) --* A container for the S3 Storage Lens Region includes. * *(string) --* * **Exclude** *(dict) --* A container for what is excluded in this configuration. This container can only be valid if there is no "Include" container submitted, and it's not empty. * **Buckets** *(list) --* A container for the S3 Storage Lens bucket excludes. * *(string) --* * **Regions** *(list) --* A container for the S3 Storage Lens Region excludes. * *(string) --* * **DataExport** *(dict) --* A container to specify the properties of your S3 Storage Lens metrics export including, the destination, schema and format. * **S3BucketDestination** *(dict) --* A container for the bucket where the S3 Storage Lens metrics export will be located. Note: This bucket must be located in the same Region as the storage lens configuration. * **Format** *(string) --* * **OutputSchemaVersion** *(string) --* The schema version of the export file. * **AccountId** *(string) --* The account ID of the owner of the S3 Storage Lens metrics export bucket. * **Arn** *(string) --* The Amazon Resource Name (ARN) of the bucket. This property is read-only and follows the following format: "arn:aws:s3:us-east-1:example-account- id:bucket/your-destination-bucket-name" * **Prefix** *(string) --* The prefix of the destination bucket where the metrics export will be delivered. * **Encryption** *(dict) --* The container for the type encryption of the metrics exports in this bucket. * **SSES3** *(dict) --* * **SSEKMS** *(dict) --* * **KeyId** *(string) --* A container for the ARN of the SSE-KMS encryption. This property is read-only and follows the following format: "arn:aws:kms:us-east-1:example- account-id:key/example-9a73-4afc- 8d29-8f5900cef44e" * **CloudWatchMetrics** *(dict) --* A container for enabling Amazon CloudWatch publishing for S3 Storage Lens metrics. * **IsEnabled** *(boolean) --* A container that indicates whether CloudWatch publishing for S3 Storage Lens metrics is enabled. A value of "true" indicates that CloudWatch publishing for S3 Storage Lens metrics is enabled. * **IsEnabled** *(boolean) --* A container for whether the S3 Storage Lens configuration is enabled. * **AwsOrg** *(dict) --* A container for the Amazon Web Services organization for this S3 Storage Lens configuration. * **Arn** *(string) --* A container for the Amazon Resource Name (ARN) of the Amazon Web Services organization. This property is read- only and follows the following format: "arn:aws:organizations:us-east-1:example-account- id:organization/o-ex2l495dck" * **StorageLensArn** *(string) --* The Amazon Resource Name (ARN) of the S3 Storage Lens configuration. This property is read-only and follows the following format: "arn:aws:s3:us-east-1:example-account-id :storage-lens/your-dashboard-name" S3Control / Client / dissociate_access_grants_identity_center dissociate_access_grants_identity_center **************************************** S3Control.Client.dissociate_access_grants_identity_center(**kwargs) Dissociates the Amazon Web Services IAM Identity Center instance from the S3 Access Grants instance. Permissions You must have the "s3:DissociateAccessGrantsIdentityCenter" permission to use this operation. Additional Permissions You must have the "sso:DeleteApplication" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.dissociate_access_grants_identity_center( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. Returns: None S3Control / Client / list_access_points list_access_points ****************** S3Control.Client.list_access_points(**kwargs) Note: This operation is not supported by directory buckets. Returns a list of the access points. You can retrieve up to 1,000 access points per call. If the call returns more than 1,000 access points (or the number specified in "maxResults", whichever is less), the response will include a continuation token that you can use to list the additional access points. Returns only access points attached to S3 buckets by default. To return all access points specify "DataSourceType" as "ALL". All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "ListAccessPoints": * CreateAccessPoint * DeleteAccessPoint * GetAccessPoint See also: AWS API Documentation **Request Syntax** response = client.list_access_points( AccountId='string', Bucket='string', NextToken='string', MaxResults=123, DataSourceId='string', DataSourceType='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the account that owns the specified access points. * **Bucket** (*string*) -- The name of the bucket whose associated access points you want to list. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. * **NextToken** (*string*) -- A continuation token. If a previous call to "ListAccessPoints" returned a continuation token in the "NextToken" field, then providing that value here causes Amazon S3 to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of access points that you want to include in the list. If the specified bucket has more than this number of access points, then the response will include a continuation token in the "NextToken" field that you can use to retrieve the next page of access points. * **DataSourceId** (*string*) -- The unique identifier for the data source of the access point. * **DataSourceType** (*string*) -- The type of the data source that the access point is attached to. Returns only access points attached to S3 buckets by default. To return all access points specify "DataSourceType" as "ALL". Return type: dict Returns: **Response Syntax** { 'AccessPointList': [ { 'Name': 'string', 'NetworkOrigin': 'Internet'|'VPC', 'VpcConfiguration': { 'VpcId': 'string' }, 'Bucket': 'string', 'AccessPointArn': 'string', 'Alias': 'string', 'BucketAccountId': 'string', 'DataSourceId': 'string', 'DataSourceType': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AccessPointList** *(list) --* Contains identification and configuration information for one or more access points associated with the specified bucket. * *(dict) --* An access point used to access a bucket. * **Name** *(string) --* The name of this access point. * **NetworkOrigin** *(string) --* Indicates whether this access point allows access from the public internet. If "VpcConfiguration" is specified for this access point, then "NetworkOrigin" is "VPC", and the access point doesn't allow access from the public internet. Otherwise, "NetworkOrigin" is "Internet", and the access point allows access from the public internet, subject to the access point and bucket access policies. * **VpcConfiguration** *(dict) --* The virtual private cloud (VPC) configuration for this access point, if one exists. Note: This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services. * **VpcId** *(string) --* If this field is specified, this access point will only allow connections from the specified VPC ID. * **Bucket** *(string) --* The name of the bucket associated with this access point. * **AccessPointArn** *(string) --* The ARN for the access point. * **Alias** *(string) --* The name or alias of the access point. * **BucketAccountId** *(string) --* The Amazon Web Services account ID associated with the S3 bucket associated with this access point. * **DataSourceId** *(string) --* A unique identifier for the data source of the access point. * **DataSourceType** *(string) --* The type of the data source that the access point is attached to. * **NextToken** *(string) --* If the specified bucket has more access points than can be returned in one call to this API, this field contains a continuation token that you can provide in subsequent calls to this API to retrieve additional access points. S3Control / Client / put_access_point_policy put_access_point_policy *********************** S3Control.Client.put_access_point_policy(**kwargs) Associates an access policy with the specified access point. Each access point can have only one policy, so a request made to this API replaces any existing policy associated with the specified access point. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "PutAccessPointPolicy": * GetAccessPointPolicy * DeleteAccessPointPolicy See also: AWS API Documentation **Request Syntax** response = client.put_access_point_policy( AccountId='string', Name='string', Policy='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for owner of the bucket associated with the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point that you want to associate with the specified policy. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format "arn:aws:s3-outposts:::outpost//accesspoint/". For example, to access the access point "reports-ap" through Outpost "my-outpost" owned by account "123456789012" in Region "us-west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/accesspoint/reports- ap". The value must be URL encoded. * **Policy** (*string*) -- **[REQUIRED]** The policy that you want to apply to the specified access point. For more information about access point policies, see Managing data access with Amazon S3 access points or Managing access to shared datasets in directory buckets with access points in the *Amazon S3 User Guide*. Returns: None S3Control / Client / get_access_grants_location get_access_grants_location ************************** S3Control.Client.get_access_grants_location(**kwargs) Retrieves the details of a particular location registered in your S3 Access Grants instance. Permissions You must have the "s3:GetAccessGrantsLocation" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_access_grants_location( AccountId='string', AccessGrantsLocationId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **AccessGrantsLocationId** (*string*) -- **[REQUIRED]** The ID of the registered location that you are retrieving. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. Return type: dict Returns: **Response Syntax** { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationArn': 'string', 'LocationScope': 'string', 'IAMRoleArn': 'string' } **Response Structure** * *(dict) --* * **CreatedAt** *(datetime) --* The date and time when you registered the location. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationArn** *(string) --* The Amazon Resource Name (ARN) of the registered location. * **LocationScope** *(string) --* The S3 URI path to the registered location. The location scope can be the default S3 location "s3://", the S3 path to a bucket, or the S3 path to a bucket and prefix. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the "engineering/" prefix or object key names that start with the "marketing/campaigns/" prefix. * **IAMRoleArn** *(string) --* The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location. S3Control / Client / get_paginator get_paginator ************* S3Control.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. S3Control / Client / put_public_access_block put_public_access_block *********************** S3Control.Client.put_public_access_block(**kwargs) Note: This operation is not supported by directory buckets. Creates or modifies the "PublicAccessBlock" configuration for an Amazon Web Services account. For this operation, users must have the "s3:PutAccountPublicAccessBlock" permission. For more information, see Using Amazon S3 block public access. Related actions include: * GetPublicAccessBlock * DeletePublicAccessBlock See also: AWS API Documentation **Request Syntax** response = client.put_public_access_block( PublicAccessBlockConfiguration={ 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, AccountId='string' ) Parameters: * **PublicAccessBlockConfiguration** (*dict*) -- **[REQUIRED]** The "PublicAccessBlock" configuration that you want to apply to the specified Amazon Web Services account. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the Amazon Web Services account whose "PublicAccessBlock" configuration you want to set. Returns: None S3Control / Client / list_access_points_for_directory_buckets list_access_points_for_directory_buckets **************************************** S3Control.Client.list_access_points_for_directory_buckets(**kwargs) Returns a list of the access points that are owned by the Amazon Web Services account and that are associated with the specified directory bucket. To list access points for general purpose buckets, see ListAccesspoints. To use this operation, you must have the permission to perform the "s3express:ListAccessPointsForDirectoryBuckets" action. For information about REST API errors, see REST error responses. See also: AWS API Documentation **Request Syntax** response = client.list_access_points_for_directory_buckets( AccountId='string', DirectoryBucket='string', NextToken='string', MaxResults=123 ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the access points. * **DirectoryBucket** (*string*) -- The name of the directory bucket associated with the access points you want to list. * **NextToken** (*string*) -- If "NextToken" is returned, there are more access points available than requested in the "maxResults" value. The value of "NextToken" is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. * **MaxResults** (*integer*) -- The maximum number of access points that you would like returned in the "ListAccessPointsForDirectoryBuckets" response. If the directory bucket is associated with more than this number of access points, the results include the pagination token "NextToken". Make another call using the "NextToken" to retrieve more results. Return type: dict Returns: **Response Syntax** { 'AccessPointList': [ { 'Name': 'string', 'NetworkOrigin': 'Internet'|'VPC', 'VpcConfiguration': { 'VpcId': 'string' }, 'Bucket': 'string', 'AccessPointArn': 'string', 'Alias': 'string', 'BucketAccountId': 'string', 'DataSourceId': 'string', 'DataSourceType': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AccessPointList** *(list) --* Contains identification and configuration information for one or more access points associated with the directory bucket. * *(dict) --* An access point used to access a bucket. * **Name** *(string) --* The name of this access point. * **NetworkOrigin** *(string) --* Indicates whether this access point allows access from the public internet. If "VpcConfiguration" is specified for this access point, then "NetworkOrigin" is "VPC", and the access point doesn't allow access from the public internet. Otherwise, "NetworkOrigin" is "Internet", and the access point allows access from the public internet, subject to the access point and bucket access policies. * **VpcConfiguration** *(dict) --* The virtual private cloud (VPC) configuration for this access point, if one exists. Note: This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services. * **VpcId** *(string) --* If this field is specified, this access point will only allow connections from the specified VPC ID. * **Bucket** *(string) --* The name of the bucket associated with this access point. * **AccessPointArn** *(string) --* The ARN for the access point. * **Alias** *(string) --* The name or alias of the access point. * **BucketAccountId** *(string) --* The Amazon Web Services account ID associated with the S3 bucket associated with this access point. * **DataSourceId** *(string) --* A unique identifier for the data source of the access point. * **DataSourceType** *(string) --* The type of the data source that the access point is attached to. * **NextToken** *(string) --* If "NextToken" is returned, there are more access points available than requested in the "maxResults" value. The value of "NextToken" is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. S3Control / Client / create_storage_lens_group create_storage_lens_group ************************* S3Control.Client.create_storage_lens_group(**kwargs) Creates a new S3 Storage Lens group and associates it with the specified Amazon Web Services account ID. An S3 Storage Lens group is a custom grouping of objects based on prefix, suffix, object tags, object size, object age, or a combination of these filters. For each Storage Lens group that you’ve created, you can also optionally add Amazon Web Services resource tags. For more information about S3 Storage Lens groups, see Working with S3 Storage Lens groups. To use this operation, you must have the permission to perform the "s3:CreateStorageLensGroup" action. If you’re trying to create a Storage Lens group with Amazon Web Services resource tags, you must also have permission to perform the "s3:TagResource" action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. For information about Storage Lens groups errors, see List of Amazon S3 Storage Lens error codes. See also: AWS API Documentation **Request Syntax** response = client.create_storage_lens_group( AccountId='string', StorageLensGroup={ 'Name': 'string', 'Filter': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 }, 'And': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 } }, 'Or': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 } } }, 'StorageLensGroupArn': 'string' }, Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that the Storage Lens group is created from and associated with. * **StorageLensGroup** (*dict*) -- **[REQUIRED]** The Storage Lens group configuration. * **Name** *(string) --* **[REQUIRED]** Contains the name of the Storage Lens group. * **Filter** *(dict) --* **[REQUIRED]** Sets the criteria for the Storage Lens group data that is displayed. For multiple filter conditions, the "AND" or "OR" logical operator is used. * **MatchAnyPrefix** *(list) --* Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed. * *(string) --* * **MatchAnySuffix** *(list) --* Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed. * *(string) --* * **MatchAnyTag** *(list) --* Contains the list of S3 object tags. At least one object tag must be specified. Up to 10 object tags are allowed. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **MatchObjectAge** *(dict) --* Contains "DaysGreaterThan" and "DaysLessThan" to define the object age range (minimum and maximum number of days). * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Contains "BytesGreaterThan" and "BytesLessThan" to define the object size range (minimum and maximum number of Bytes). * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **And** *(dict) --* A logical operator that allows multiple filter conditions to be joined for more complex comparisons of Storage Lens group data. Objects must match all of the listed filter conditions that are joined by the "And" logical operator. Only one of each filter condition is allowed. * **MatchAnyPrefix** *(list) --* Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed. * *(string) --* * **MatchAnySuffix** *(list) --* Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed. * *(string) --* * **MatchAnyTag** *(list) --* Contains the list of object tags. At least one object tag must be specified. Up to 10 object tags are allowed. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **MatchObjectAge** *(dict) --* Contains "DaysGreaterThan" and "DaysLessThan" to define the object age range (minimum and maximum number of days). * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Contains "BytesGreaterThan" and "BytesLessThan" to define the object size range (minimum and maximum number of Bytes). * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **Or** *(dict) --* A single logical operator that allows multiple filter conditions to be joined. Objects can match any of the listed filter conditions, which are joined by the "Or" logical operator. Only one of each filter condition is allowed. * **MatchAnyPrefix** *(list) --* Filters objects that match any of the specified prefixes. * *(string) --* * **MatchAnySuffix** *(list) --* Filters objects that match any of the specified suffixes. * *(string) --* * **MatchAnyTag** *(list) --* Filters objects that match any of the specified S3 object tags. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **MatchObjectAge** *(dict) --* Filters objects that match the specified object age range. * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Filters objects that match the specified object size range. * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **StorageLensGroupArn** *(string) --* Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only. * **Tags** (*list*) -- The Amazon Web Services resource tags that you're adding to your Storage Lens group. This parameter is optional. * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* **[REQUIRED]** The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* **[REQUIRED]** The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. Returns: None S3Control / Client / create_access_grants_instance create_access_grants_instance ***************************** S3Control.Client.create_access_grants_instance(**kwargs) Creates an S3 Access Grants instance, which serves as a logical grouping for access grants. You can create one S3 Access Grants instance per Region per account. Permissions You must have the "s3:CreateAccessGrantsInstance" permission to use this operation. Additional Permissions To associate an IAM Identity Center instance with your S3 Access Grants instance, you must also have the "sso:DescribeInstance", "sso:CreateApplication", "sso:PutApplicationGrant", and "sso:PutApplicationAuthenticationMethod" permissions. See also: AWS API Documentation **Request Syntax** response = client.create_access_grants_instance( AccountId='string', IdentityCenterArn='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **IdentityCenterArn** (*string*) -- If you would like to associate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, use this field to pass the Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the ListInstances API operation to retrieve a list of your Identity Center instances and their ARNs. * **Tags** (*list*) -- The Amazon Web Services resource tags that you are adding to the S3 Access Grants instance. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* **[REQUIRED]** The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* **[REQUIRED]** The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. Return type: dict Returns: **Response Syntax** { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantsInstanceId': 'string', 'AccessGrantsInstanceArn': 'string', 'IdentityCenterArn': 'string', 'IdentityCenterInstanceArn': 'string', 'IdentityCenterApplicationArn': 'string' } **Response Structure** * *(dict) --* * **CreatedAt** *(datetime) --* The date and time when you created the S3 Access Grants instance. * **AccessGrantsInstanceId** *(string) --* The ID of the S3 Access Grants instance. The ID is "default". You can have one S3 Access Grants instance per Region per account. * **AccessGrantsInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the ListInstances API operation to retrieve a list of your Identity Center instances and their ARNs. * **IdentityCenterArn** *(string) --* If you associated your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) of the IAM Identity Center instance application; a subresource of the original Identity Center instance. S3 Access Grants creates this Identity Center application for the specific S3 Access Grants instance. * **IdentityCenterInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the ListInstances API operation to retrieve a list of your Identity Center instances and their ARNs. * **IdentityCenterApplicationArn** *(string) --* If you associated your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) of the IAM Identity Center instance application; a subresource of the original Identity Center instance. S3 Access Grants creates this Identity Center application for the specific S3 Access Grants instance. S3Control / Client / get_access_point_policy_status get_access_point_policy_status ****************************** S3Control.Client.get_access_point_policy_status(**kwargs) Note: This operation is not supported by directory buckets. Indicates whether the specified access point currently has a policy that allows public access. For more information about public access through access points, see Managing Data Access with Amazon S3 access points in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.get_access_point_policy_status( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point whose policy status you want to retrieve. Return type: dict Returns: **Response Syntax** { 'PolicyStatus': { 'IsPublic': True|False } } **Response Structure** * *(dict) --* * **PolicyStatus** *(dict) --* Indicates the current policy status of the specified access point. * **IsPublic** *(boolean) --* S3Control / Client / delete_bucket_tagging delete_bucket_tagging ********************* S3Control.Client.delete_bucket_tagging(**kwargs) Note: This action deletes an Amazon S3 on Outposts bucket's tags. To delete an S3 bucket tags, see DeleteBucketTagging in the *Amazon S3 API Reference*. Deletes the tags from the Outposts bucket. For more information, see Using Amazon S3 on Outposts in *Amazon S3 User Guide*. To use this action, you must have permission to perform the "PutBucketTagging" action. By default, the bucket owner has this permission and can grant this permission to others. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "DeleteBucketTagging": * GetBucketTagging * PutBucketTagging See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_tagging( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket tag set to be removed. * **Bucket** (*string*) -- **[REQUIRED]** The bucket ARN that has the tag set to be removed. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Returns: None S3Control / Client / get_access_point_policy_status_for_object_lambda get_access_point_policy_status_for_object_lambda ************************************************ S3Control.Client.get_access_point_policy_status_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Returns the status of the resource policy associated with an Object Lambda Access Point. See also: AWS API Documentation **Request Syntax** response = client.get_access_point_policy_status_for_object_lambda( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point. Return type: dict Returns: **Response Syntax** { 'PolicyStatus': { 'IsPublic': True|False } } **Response Structure** * *(dict) --* * **PolicyStatus** *(dict) --* Indicates whether this access point policy is public. For more information about how Amazon S3 evaluates policies to determine whether they are public, see The Meaning of "Public" in the *Amazon S3 User Guide*. * **IsPublic** *(boolean) --* S3Control / Client / put_bucket_lifecycle_configuration put_bucket_lifecycle_configuration ********************************** S3Control.Client.put_bucket_lifecycle_configuration(**kwargs) Note: This action puts a lifecycle configuration to an Amazon S3 on Outposts bucket. To put a lifecycle configuration to an S3 bucket, see PutBucketLifecycleConfiguration in the *Amazon S3 API Reference*. Creates a new lifecycle configuration for the S3 on Outposts bucket or replaces an existing lifecycle configuration. Outposts buckets only support lifecycle configurations that delete/expire objects after a certain period of time and abort incomplete multipart uploads. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "PutBucketLifecycleConfiguration": * GetBucketLifecycleConfiguration * DeleteBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.put_bucket_lifecycle_configuration( AccountId='string', Bucket='string', LifecycleConfiguration={ 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 }, 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 }, 'Status': 'Enabled'|'Disabled', 'Transitions': [ { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE' }, ], 'NoncurrentVersionTransitions': [ { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE' }, ], 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket for which to set the configuration. * **LifecycleConfiguration** (*dict*) -- Container for lifecycle rules. You can add as many as 1,000 rules. * **Rules** *(list) --* A lifecycle rule for individual objects in an Outposts bucket. * *(dict) --* The container for the Outposts bucket lifecycle rule. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. * **Date** *(datetime) --* Indicates at what date the object is to be 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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired. If set to false, the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. To learn more about delete markers, see Working with delete markers. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **Filter** *(dict) --* The container for the filter of lifecycle rule. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **Tag** *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **And** *(dict) --* The container for the "AND" condition for the lifecycle rule. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the rule to apply. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **ObjectSizeGreaterThan** *(integer) --* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule applies to objects with a size that is greater than 7. * **ObjectSizeLessThan** *(integer) --* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule applies to objects with a size that is less than 77. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **Status** *(string) --* **[REQUIRED]** If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. * **Transitions** *(list) --* Specifies when an Amazon S3 object transitions to a specified storage class. Note: This is not supported by Amazon S3 on Outposts buckets. * *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 Lifecycle configuration rules, see Transitioning objects using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransitions** *(list) --* Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific 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 a specific storage class at a set period in the object's lifetime. Note: This is not supported by Amazon S3 on Outposts buckets. * *(dict) --* The container for the noncurrent version transition. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NoncurrentVersionExpiration** *(dict) --* The noncurrent version expiration of the lifecycle rule. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions S3 on Outposts will retain. If there are this many more recent noncurrent versions, S3 on Outposts will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 waits before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload to the Outposts bucket. Returns: None S3Control / Client / can_paginate can_paginate ************ S3Control.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. S3Control / Client / get_storage_lens_configuration_tagging get_storage_lens_configuration_tagging ************************************** S3Control.Client.get_storage_lens_configuration_tagging(**kwargs) Note: This operation is not supported by directory buckets. Gets the tags of Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:GetStorageLensConfigurationTagging" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.get_storage_lens_configuration_tagging( ConfigId='string', AccountId='string' ) Parameters: * **ConfigId** (*string*) -- **[REQUIRED]** The ID of the Amazon S3 Storage Lens configuration. * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. Return type: dict Returns: **Response Syntax** { 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **Tags** *(list) --* The tags of S3 Storage Lens configuration requested. * *(dict) --* * **Key** *(string) --* * **Value** *(string) --* S3Control / Client / delete_access_grants_instance_resource_policy delete_access_grants_instance_resource_policy ********************************************* S3Control.Client.delete_access_grants_instance_resource_policy(**kwargs) Deletes the resource policy of the S3 Access Grants instance. The resource policy is used to manage cross-account access to your S3 Access Grants instance. By deleting the resource policy, you delete any cross-account permissions to your S3 Access Grants instance. Permissions You must have the "s3:DeleteAccessGrantsInstanceResourcePolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_access_grants_instance_resource_policy( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. Returns: None S3Control / Client / delete_bucket_policy delete_bucket_policy ******************** S3Control.Client.delete_bucket_policy(**kwargs) Note: This action deletes an Amazon S3 on Outposts bucket policy. To delete an S3 bucket policy, see DeleteBucketPolicy in the *Amazon S3 API Reference*. This implementation of the DELETE action uses the policy subresource to delete the policy of a specified Amazon S3 on Outposts bucket. If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must have the "s3-outposts:DeleteBucketPolicy" permissions on the specified Outposts bucket and belong to the bucket owner's account to use this action. For more information, see Using Amazon S3 on Outposts in *Amazon S3 User Guide*. If you don't have "DeleteBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: As a security precaution, the root user of the Amazon Web Services account that owns a bucket can always use this action, even if the policy explicitly denies the root user the ability to perform this action. For more information about bucket policies, see Using Bucket Policies and User Policies. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "DeleteBucketPolicy": * GetBucketPolicy * PutBucketPolicy See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_policy( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Returns: None S3Control / Client / list_access_grants_locations list_access_grants_locations **************************** S3Control.Client.list_access_grants_locations(**kwargs) Returns a list of the locations registered in your S3 Access Grants instance. Permissions You must have the "s3:ListAccessGrantsLocations" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_access_grants_locations( AccountId='string', NextToken='string', MaxResults=123, LocationScope='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **NextToken** (*string*) -- A pagination token to request the next page of results. Pass this value into a subsequent "List Access Grants Locations" request in order to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of access grants that you would like returned in the "List Access Grants" response. If the results include the pagination token "NextToken", make another call using the "NextToken" to determine if there are more results. * **LocationScope** (*string*) -- The S3 path to the location that you are registering. The location scope can be the default S3 location "s3://", the S3 path to a bucket "s3://", or the S3 path to a bucket and prefix "s3:///". A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the "engineering/" prefix or object key names that start with the "marketing/campaigns/" prefix. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'AccessGrantsLocationsList': [ { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationArn': 'string', 'LocationScope': 'string', 'IAMRoleArn': 'string' }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A pagination token to request the next page of results. Pass this value into a subsequent "List Access Grants Locations" request in order to retrieve the next page of results. * **AccessGrantsLocationsList** *(list) --* A container for a list of registered locations in an S3 Access Grants instance. * *(dict) --* A container for information about the registered location. * **CreatedAt** *(datetime) --* The date and time when you registered the location. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationArn** *(string) --* The Amazon Resource Name (ARN) of the registered location. * **LocationScope** *(string) --* The S3 path to the location that you are registering. The location scope can be the default S3 location "s3://", the S3 path to a bucket "s3://", or the S3 path to a bucket and prefix "s3:///". A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the "engineering/" prefix or object key names that start with the "marketing/campaigns/" prefix. * **IAMRoleArn** *(string) --* The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location. S3Control / Client / list_jobs list_jobs ********* S3Control.Client.list_jobs(**kwargs) Lists current S3 Batch Operations jobs as well as the jobs that have ended within the last 90 days for the Amazon Web Services account making the request. For more information, see S3 Batch Operations in the *Amazon S3 User Guide*. Permissions To use the "ListJobs" operation, you must have permission to perform the "s3:ListJobs" action. Related actions include: * CreateJob * DescribeJob * UpdateJobPriority * UpdateJobStatus See also: AWS API Documentation **Request Syntax** response = client.list_jobs( AccountId='string', JobStatuses=[ 'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended', ], NextToken='string', MaxResults=123 ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobStatuses** (*list*) -- The "List Jobs" request returns jobs that match the statuses listed in this element. * *(string) --* * **NextToken** (*string*) -- A pagination token to request the next page of results. Use the token that Amazon S3 returned in the "NextToken" element of the "ListJobsResult" from the previous "List Jobs" request. * **MaxResults** (*integer*) -- The maximum number of jobs that Amazon S3 will include in the "List Jobs" response. If there are more jobs than this number, the response will include a pagination token in the "NextToken" field to enable you to retrieve the next page of results. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'Jobs': [ { 'JobId': 'string', 'Description': 'string', 'Operation': 'LambdaInvoke'|'S3PutObjectCopy'|'S3PutObjectAcl'|'S3PutObjectTagging'|'S3DeleteObjectTagging'|'S3InitiateRestoreObject'|'S3PutObjectLegalHold'|'S3PutObjectRetention'|'S3ReplicateObject', 'Priority': 123, 'Status': 'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended', 'CreationTime': datetime(2015, 1, 1), 'TerminationDate': datetime(2015, 1, 1), 'ProgressSummary': { 'TotalNumberOfTasks': 123, 'NumberOfTasksSucceeded': 123, 'NumberOfTasksFailed': 123, 'Timers': { 'ElapsedTimeInActiveSeconds': 123 } } }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* If the "List Jobs" request produced more than the maximum number of results, you can pass this value into a subsequent "List Jobs" request in order to retrieve the next page of results. * **Jobs** *(list) --* The list of current jobs and jobs that have ended within the last 30 days. * *(dict) --* Contains the configuration and status information for a single job retrieved as part of a job list. * **JobId** *(string) --* The ID for the specified job. * **Description** *(string) --* The user-specified description that was included in the specified job's "Create Job" request. * **Operation** *(string) --* The operation that the specified job is configured to run on every object listed in the manifest. * **Priority** *(integer) --* The current priority for the specified job. * **Status** *(string) --* The specified job's current status. * **CreationTime** *(datetime) --* A timestamp indicating when the specified job was created. * **TerminationDate** *(datetime) --* A timestamp indicating when the specified job terminated. A job's termination date is the date and time when it succeeded, failed, or was canceled. * **ProgressSummary** *(dict) --* Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and the number of tasks that failed. * **TotalNumberOfTasks** *(integer) --* * **NumberOfTasksSucceeded** *(integer) --* * **NumberOfTasksFailed** *(integer) --* * **Timers** *(dict) --* The JobTimers attribute of a job's progress summary. * **ElapsedTimeInActiveSeconds** *(integer) --* Indicates the elapsed time in seconds the job has been in the Active job state. **Exceptions** * "S3Control.Client.exceptions.InvalidRequestException" * "S3Control.Client.exceptions.InternalServiceException" * "S3Control.Client.exceptions.InvalidNextTokenException" S3Control / Client / describe_multi_region_access_point_operation describe_multi_region_access_point_operation ******************************************** S3Control.Client.describe_multi_region_access_point_operation(**kwargs) Note: This operation is not supported by directory buckets. Retrieves the status of an asynchronous request to manage a Multi- Region Access Point. For more information about managing Multi- Region Access Points and how asynchronous requests work, see Using Multi-Region Access Points in the *Amazon S3 User Guide*. The following actions are related to "GetMultiRegionAccessPoint": * CreateMultiRegionAccessPoint * DeleteMultiRegionAccessPoint * GetMultiRegionAccessPoint * ListMultiRegionAccessPoints See also: AWS API Documentation **Request Syntax** response = client.describe_multi_region_access_point_operation( AccountId='string', RequestTokenARN='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **RequestTokenARN** (*string*) -- **[REQUIRED]** The request token associated with the request you want to know about. This request token is returned as part of the response when you make an asynchronous request. You provide this token to query about the status of the asynchronous action. Return type: dict Returns: **Response Syntax** { 'AsyncOperation': { 'CreationTime': datetime(2015, 1, 1), 'Operation': 'CreateMultiRegionAccessPoint'|'DeleteMultiRegionAccessPoint'|'PutMultiRegionAccessPointPolicy', 'RequestTokenARN': 'string', 'RequestParameters': { 'CreateMultiRegionAccessPointRequest': { 'Name': 'string', 'PublicAccessBlock': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, 'Regions': [ { 'Bucket': 'string', 'BucketAccountId': 'string' }, ] }, 'DeleteMultiRegionAccessPointRequest': { 'Name': 'string' }, 'PutMultiRegionAccessPointPolicyRequest': { 'Name': 'string', 'Policy': 'string' } }, 'RequestStatus': 'string', 'ResponseDetails': { 'MultiRegionAccessPointDetails': { 'Regions': [ { 'Name': 'string', 'RequestStatus': 'string' }, ] }, 'ErrorDetails': { 'Code': 'string', 'Message': 'string', 'Resource': 'string', 'RequestId': 'string' } } } } **Response Structure** * *(dict) --* * **AsyncOperation** *(dict) --* A container element containing the details of the asynchronous operation. * **CreationTime** *(datetime) --* The time that the request was sent to the service. * **Operation** *(string) --* The specific operation for the asynchronous request. * **RequestTokenARN** *(string) --* The request token associated with the request. * **RequestParameters** *(dict) --* The parameters associated with the request. * **CreateMultiRegionAccessPointRequest** *(dict) --* A container of the parameters for a CreateMultiRegionAccessPoint request. * **Name** *(string) --* The name of the Multi-Region Access Point associated with this request. * **PublicAccessBlock** *(dict) --* The "PublicAccessBlock" configuration that you want to apply to this Amazon S3 account. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the *Amazon S3 User Guide*. This data type is not supported for Amazon S3 on Outposts. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **Regions** *(list) --* The buckets in different Regions that are associated with the Multi-Region Access Point. * *(dict) --* A Region that supports a Multi-Region Access Point as well as the associated bucket for the Region. * **Bucket** *(string) --* The name of the associated bucket for the Region. * **BucketAccountId** *(string) --* The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point. * **DeleteMultiRegionAccessPointRequest** *(dict) --* A container of the parameters for a DeleteMultiRegionAccessPoint request. * **Name** *(string) --* The name of the Multi-Region Access Point associated with this request. * **PutMultiRegionAccessPointPolicyRequest** *(dict) --* A container of the parameters for a PutMultiRegionAccessPoint request. * **Name** *(string) --* The name of the Multi-Region Access Point associated with the request. * **Policy** *(string) --* The policy details for the "PutMultiRegionAccessPoint" request. * **RequestStatus** *(string) --* The current status of the request. * **ResponseDetails** *(dict) --* The details of the response. * **MultiRegionAccessPointDetails** *(dict) --* The details for the Multi-Region Access Point. * **Regions** *(list) --* A collection of status information for the different Regions that a Multi-Region Access Point supports. * *(dict) --* Status information for a single Multi-Region Access Point Region. * **Name** *(string) --* The name of the Region in the Multi-Region Access Point. * **RequestStatus** *(string) --* The current status of the Multi-Region Access Point in this Region. * **ErrorDetails** *(dict) --* Error details for an asynchronous request. * **Code** *(string) --* A string that uniquely identifies the error condition. * **Message** *(string) --* A generic description of the error condition in English. * **Resource** *(string) --* The identifier of the resource associated with the error. * **RequestId** *(string) --* The ID of the request associated with the error. S3Control / Client / delete_access_grants_instance delete_access_grants_instance ***************************** S3Control.Client.delete_access_grants_instance(**kwargs) Deletes your S3 Access Grants instance. You must first delete the access grants and locations before S3 Access Grants can delete the instance. See DeleteAccessGrant and DeleteAccessGrantsLocation. If you have associated an IAM Identity Center instance with your S3 Access Grants instance, you must first dissassociate the Identity Center instance from the S3 Access Grants instance before you can delete the S3 Access Grants instance. See AssociateAccessGrantsIdentityCenter and DissociateAccessGrantsIdentityCenter. Permissions You must have the "s3:DeleteAccessGrantsInstance" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_access_grants_instance( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. Returns: None S3Control / Client / create_access_grant create_access_grant ******************* S3Control.Client.create_access_grant(**kwargs) Creates an access grant that gives a grantee access to your S3 data. The grantee can be an IAM user or role or a directory user, or group. Before you can create a grant, you must have an S3 Access Grants instance in the same Region as the S3 data. You can create an S3 Access Grants instance using the CreateAccessGrantsInstance. You must also have registered at least one S3 data location in your S3 Access Grants instance using CreateAccessGrantsLocation. Permissions You must have the "s3:CreateAccessGrant" permission to use this operation. Additional Permissions For any directory identity - "sso:DescribeInstance" and "sso:DescribeApplication" For directory users - "identitystore:DescribeUser" For directory groups - "identitystore:DescribeGroup" See also: AWS API Documentation **Request Syntax** response = client.create_access_grant( AccountId='string', AccessGrantsLocationId='string', AccessGrantsLocationConfiguration={ 'S3SubPrefix': 'string' }, Grantee={ 'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM', 'GranteeIdentifier': 'string' }, Permission='READ'|'WRITE'|'READWRITE', ApplicationArn='string', S3PrefixType='Object', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **AccessGrantsLocationId** (*string*) -- **[REQUIRED]** The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. If you are passing the "default" location, you cannot create an access grant for the entire default location. You must also specify a bucket or a bucket and prefix in the "Subprefix" field. * **AccessGrantsLocationConfiguration** (*dict*) -- The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access. It contains the "S3SubPrefix" field. The grant scope is the result of appending the subprefix to the location scope of the registered location. * **S3SubPrefix** *(string) --* The "S3SubPrefix" is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location "s3://" because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location "s3://", the "S3SubPrefx" can be a />>*<<, so the full grant scope path would be "s3:///*". Or the "S3SubPrefx" can be "/*", so the full grant scope path would be or "s3:///*". If the "S3SubPrefix" includes a prefix, append the wildcard character "*" after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix. * **Grantee** (*dict*) -- **[REQUIRED]** The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group. * **GranteeType** *(string) --* The type of the grantee to which access has been granted. It can be one of the following values: * "IAM" - An IAM user or role. * "DIRECTORY_USER" - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * "DIRECTORY_GROUP" - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * **GranteeIdentifier** *(string) --* The unique identifier of the "Grantee". If the grantee type is "IAM", the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". You can obtain this UUID from your Amazon Web Services IAM Identity Center instance. * **Permission** (*string*) -- **[REQUIRED]** The type of access that you are granting to your S3 data, which can be set to one of the following values: * "READ" – Grant read-only access to the S3 data. * "WRITE" – Grant write-only access to the S3 data. * "READWRITE" – Grant both read and write access to the S3 data. * **ApplicationArn** (*string*) -- The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If an application ARN is included in the request to create an access grant, the grantee can only access the S3 data through this application. * **S3PrefixType** (*string*) -- The type of "S3SubPrefix". The only possible value is "Object". Pass this value if the access grant scope is an object. Do not pass this value if the access grant scope is a bucket or a bucket and a prefix. * **Tags** (*list*) -- The Amazon Web Services resource tags that you are adding to the access grant. Each tag is a label consisting of a user- defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* **[REQUIRED]** The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* **[REQUIRED]** The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. Return type: dict Returns: **Response Syntax** { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantId': 'string', 'AccessGrantArn': 'string', 'Grantee': { 'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM', 'GranteeIdentifier': 'string' }, 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationConfiguration': { 'S3SubPrefix': 'string' }, 'Permission': 'READ'|'WRITE'|'READWRITE', 'ApplicationArn': 'string', 'GrantScope': 'string' } **Response Structure** * *(dict) --* * **CreatedAt** *(datetime) --* The date and time when you created the access grant. * **AccessGrantId** *(string) --* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. * **AccessGrantArn** *(string) --* The Amazon Resource Name (ARN) of the access grant. * **Grantee** *(dict) --* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group. * **GranteeType** *(string) --* The type of the grantee to which access has been granted. It can be one of the following values: * "IAM" - An IAM user or role. * "DIRECTORY_USER" - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * "DIRECTORY_GROUP" - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * **GranteeIdentifier** *(string) --* The unique identifier of the "Grantee". If the grantee type is "IAM", the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". You can obtain this UUID from your Amazon Web Services IAM Identity Center instance. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationConfiguration** *(dict) --* The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access. * **S3SubPrefix** *(string) --* The "S3SubPrefix" is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location "s3://" because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location "s3://", the "S3SubPrefx" can be a />>*<<, so the full grant scope path would be "s3:///*". Or the "S3SubPrefx" can be "/*", so the full grant scope path would be or "s3:///*". If the "S3SubPrefix" includes a prefix, append the wildcard character "*" after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix. * **Permission** *(string) --* The type of access that you are granting to your S3 data, which can be set to one of the following values: * "READ" – Grant read-only access to the S3 data. * "WRITE" – Grant write-only access to the S3 data. * "READWRITE" – Grant both read and write access to the S3 data. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. * **GrantScope** *(string) --* The S3 path of the data to which you are granting access. It is the result of appending the "Subprefix" to the location scope. S3Control / Client / put_bucket_tagging put_bucket_tagging ****************** S3Control.Client.put_bucket_tagging(**kwargs) Note: This action puts tags on an Amazon S3 on Outposts bucket. To put tags on an S3 bucket, see PutBucketTagging in the *Amazon S3 API Reference*. Sets the tags for an S3 on Outposts bucket. For more information, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. Use tags to organize your Amazon Web Services bill to reflect your own cost structure. To do this, sign up to get your Amazon Web Services account bill with tag key values included. Then, to see the cost of combined resources, organize your billing information according to resources with the same tag key values. For example, you can tag several resources with a specific application name, and then organize your billing information to see the total cost of that application across several services. For more information, see Cost allocation and tagging. Note: Within a bucket, if you add a tag that has the same key as an existing tag, the new value overwrites the old value. For more information, see Using cost allocation in Amazon S3 bucket tags. To use this action, you must have permissions to perform the "s3-outposts:PutBucketTagging" action. The Outposts bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing access permissions to your Amazon S3 resources. "PutBucketTagging" has the following special errors: * Error code: "InvalidTagError" * Description: The tag provided was not a valid tag. This error can occur if the tag did not pass input validation. For information about tag restrictions, see User-Defined Tag Restrictions and Amazon Web Services-Generated Cost Allocation Tag Restrictions. * Error code: "MalformedXMLError" * Description: The XML provided does not match the schema. * Error code: "OperationAbortedError" * Description: A conflicting conditional action is currently in progress against this resource. Try again. * Error code: "InternalError" * Description: The service was unable to apply the provided tag to the bucket. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "PutBucketTagging": * GetBucketTagging * DeleteBucketTagging See also: AWS API Documentation **Request Syntax** response = client.put_bucket_tagging( AccountId='string', Bucket='string', Tagging={ 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. * **Tagging** (*dict*) -- **[REQUIRED]** * **TagSet** *(list) --* **[REQUIRED]** A collection for a set of tags. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag Returns: None S3Control / Client / put_access_point_policy_for_object_lambda put_access_point_policy_for_object_lambda ***************************************** S3Control.Client.put_access_point_policy_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Creates or replaces resource policy for an Object Lambda Access Point. For an example policy, see Creating Object Lambda Access Points in the *Amazon S3 User Guide*. The following actions are related to "PutAccessPointPolicyForObjectLambda": * DeleteAccessPointPolicyForObjectLambda * GetAccessPointPolicyForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.put_access_point_policy_for_object_lambda( AccountId='string', Name='string', Policy='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point. * **Policy** (*string*) -- **[REQUIRED]** Object Lambda Access Point resource policy document. Returns: None S3Control / Client / get_bucket_replication get_bucket_replication ********************** S3Control.Client.get_bucket_replication(**kwargs) Note: This operation gets an Amazon S3 on Outposts bucket's replication configuration. To get an S3 bucket's replication configuration, see GetBucketReplication in the *Amazon S3 API Reference*. Returns the replication configuration of an S3 on Outposts bucket. For more information about S3 on Outposts, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. For information about S3 replication on Outposts configuration, see Replicating objects for S3 on Outposts in the *Amazon S3 User Guide*. Note: It can take a while to propagate "PUT" or "DELETE" requests for a replication configuration to all S3 on Outposts systems. Therefore, the replication configuration that's returned by a "GET" request soon after a "PUT" or "DELETE" request might return a more recent result than what's on the Outpost. If an Outpost is offline, the delay in updating the replication configuration on that Outpost can be significant. This action requires permissions for the "s3-outposts:GetReplicationConfiguration" action. The Outposts bucket owner has this permission by default and can grant it to others. For more information about permissions, see Setting up IAM with S3 on Outposts and Managing access to S3 on Outposts bucket in the *Amazon S3 User Guide*. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. If you include the "Filter" element in a replication configuration, you must also include the "DeleteMarkerReplication", "Status", and "Priority" elements. The response also returns those elements. For information about S3 on Outposts replication failure reasons, see Replication failure reasons in the *Amazon S3 User Guide*. The following operations are related to "GetBucketReplication": * PutBucketReplication * DeleteBucketReplication See also: AWS API Documentation **Request Syntax** response = client.get_bucket_replication( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket to get the replication information for. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'ReplicationConfiguration': { 'Role': 'string', 'Rules': [ { 'ID': 'string', 'Priority': 123, 'Prefix': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } }, 'Status': 'Enabled'|'Disabled', 'SourceSelectionCriteria': { 'SseKmsEncryptedObjects': { 'Status': 'Enabled'|'Disabled' }, 'ReplicaModifications': { 'Status': 'Enabled'|'Disabled' } }, 'ExistingObjectReplication': { 'Status': 'Enabled'|'Disabled' }, 'Destination': { 'Account': 'string', 'Bucket': 'string', 'ReplicationTime': { 'Status': 'Enabled'|'Disabled', 'Time': { 'Minutes': 123 } }, 'AccessControlTranslation': { 'Owner': 'Destination' }, 'EncryptionConfiguration': { 'ReplicaKmsKeyID': 'string' }, 'Metrics': { 'Status': 'Enabled'|'Disabled', 'EventThreshold': { 'Minutes': 123 } }, 'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'GLACIER'|'DEEP_ARCHIVE'|'OUTPOSTS'|'GLACIER_IR' }, 'DeleteMarkerReplication': { 'Status': 'Enabled'|'Disabled' }, 'Bucket': 'string' }, ] } } **Response Structure** * *(dict) --* * **ReplicationConfiguration** *(dict) --* A container for one or more replication rules. A replication configuration must have at least one rule and you can add up to 100 rules. The maximum size of a replication configuration is 128 KB. * **Role** *(string) --* The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that S3 on Outposts assumes when replicating objects. For information about S3 replication on Outposts configuration, see Setting up replication in the *Amazon S3 User Guide*. * **Rules** *(list) --* A container for one or more replication rules. A replication configuration must have at least one rule and can contain an array of 100 rules at the most. * *(dict) --* Specifies which S3 on Outposts objects to replicate and where to store the replicas. * **ID** *(string) --* A unique identifier for the rule. The maximum value is 255 characters. * **Priority** *(integer) --* The priority indicates which rule has precedence whenever two or more replication rules conflict. S3 on Outposts attempts to replicate objects according to all replication rules. However, if there are two or more rules with the same destination Outposts bucket, then objects will be replicated according to the rule with the highest priority. The higher the number, the higher the priority. For more information, see Creating replication rules on Outposts in the *Amazon S3 User Guide*. * **Prefix** *(string) --* An object key name prefix that identifies the object or objects to which the rule applies. The maximum prefix length is 1,024 characters. To include all objects in an Outposts bucket, specify an empty string. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **Filter** *(dict) --* A filter that identifies the subset of objects to which the replication rule applies. A "Filter" element must specify exactly one "Prefix", "Tag", or "And" child element. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects that the rule applies to. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **Tag** *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **And** *(dict) --* A container for specifying rule filters. The filters determine the subset of objects that the rule applies to. This element is required only if you specify more than one filter. For example: * If you specify both a "Prefix" and a "Tag" filter, wrap these filters in an "And" element. * If you specify a filter based on multiple tags, wrap the "Tag" elements in an "And" element. * **Prefix** *(string) --* An object key name prefix that identifies the subset of objects that the rule applies to. * **Tags** *(list) --* An array of tags that contain key and value pairs. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **Status** *(string) --* Specifies whether the rule is enabled. * **SourceSelectionCriteria** *(dict) --* A container that describes additional filters for identifying the source Outposts objects that you want to replicate. You can choose to enable or disable the replication of these objects. * **SseKmsEncryptedObjects** *(dict) --* A filter that you can use to select Amazon S3 objects that are encrypted with server-side encryption by using Key Management Service (KMS) keys. If you include "SourceSelectionCriteria" in the replication configuration, this element is required. Note: This is not supported by Amazon S3 on Outposts buckets. * **Status** *(string) --* Specifies whether Amazon S3 replicates objects that are created with server-side encryption by using an KMS key stored in Key Management Service. * **ReplicaModifications** *(dict) --* A filter that you can use to specify whether replica modification sync is enabled. S3 on Outposts replica modification sync can help you keep object metadata synchronized between replicas and source objects. By default, S3 on Outposts replicates metadata from the source objects to the replicas only. When replica modification sync is enabled, S3 on Outposts replicates metadata changes made to the replica copies back to the source object, making the replication bidirectional. To replicate object metadata modifications on replicas, you can specify this element and set the "Status" of this element to "Enabled". Note: You must enable replica modification sync on the source and destination buckets to replicate replica metadata changes between the source and the replicas. * **Status** *(string) --* Specifies whether S3 on Outposts replicates modifications to object metadata on replicas. * **ExistingObjectReplication** *(dict) --* An optional configuration to replicate existing source bucket objects. Note: This is not supported by Amazon S3 on Outposts buckets. * **Status** *(string) --* Specifies whether Amazon S3 replicates existing source bucket objects. * **Destination** *(dict) --* A container for information about the replication destination and its configurations. * **Account** *(string) --* The destination bucket owner's account ID. * **Bucket** *(string) --* The Amazon Resource Name (ARN) of the access point for the destination bucket where you want S3 on Outposts to store the replication results. * **ReplicationTime** *(dict) --* A container that specifies S3 Replication Time Control (S3 RTC) settings, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated. Must be specified together with a "Metrics" block. Note: This is not supported by Amazon S3 on Outposts buckets. * **Status** *(string) --* Specifies whether S3 Replication Time Control (S3 RTC) is enabled. * **Time** *(dict) --* A container that specifies the time by which replication should be complete for all objects and operations on objects. * **Minutes** *(integer) --* Contains an integer that specifies the time period in minutes. Valid value: 15 * **AccessControlTranslation** *(dict) --* Specify this property only in a cross-account scenario (where the source and destination bucket owners are not the same), and you want to change replica ownership to the Amazon Web Services account that owns the destination bucket. If this property is not specified in the replication configuration, the replicas are owned by same Amazon Web Services account that owns the source object. Note: This is not supported by Amazon S3 on Outposts buckets. * **Owner** *(string) --* Specifies the replica ownership. * **EncryptionConfiguration** *(dict) --* A container that provides information about encryption. If "SourceSelectionCriteria" is specified, you must specify this element. Note: This is not supported by Amazon S3 on Outposts buckets. * **ReplicaKmsKeyID** *(string) --* Specifies the ID of the customer managed KMS key that's stored in Key Management Service (KMS) for the destination bucket. This ID is either the Amazon Resource Name (ARN) for the KMS key or the alias ARN for the KMS key. Amazon S3 uses this KMS key to encrypt replica objects. Amazon S3 supports only symmetric encryption KMS keys. For more information, see Symmetric encryption KMS keys in the *Amazon Web Services Key Management Service Developer Guide*. * **Metrics** *(dict) --* A container that specifies replication metrics- related settings. * **Status** *(string) --* Specifies whether replication metrics are enabled. * **EventThreshold** *(dict) --* A container that specifies the time threshold for emitting the "s3:Replication:OperationMissedThreshold" event. Note: This is not supported by Amazon S3 on Outposts buckets. * **Minutes** *(integer) --* Contains an integer that specifies the time period in minutes. Valid value: 15 * **StorageClass** *(string) --* The storage class to use when replicating objects. All objects stored on S3 on Outposts are stored in the "OUTPOSTS" storage class. S3 on Outposts uses the "OUTPOSTS" storage class to create the object replicas. Note: Values other than "OUTPOSTS" aren't supported by Amazon S3 on Outposts. * **DeleteMarkerReplication** *(dict) --* Specifies whether S3 on Outposts replicates delete markers. If you specify a "Filter" element in your replication configuration, you must also include a "DeleteMarkerReplication" element. If your "Filter" includes a "Tag" element, the "DeleteMarkerReplication" element's "Status" child element must be set to "Disabled", because S3 on Outposts doesn't support replicating delete markers for tag-based rules. For more information about delete marker replication, see How delete operations affect replication in the *Amazon S3 User Guide*. * **Status** *(string) --* Indicates whether to replicate delete markers. * **Bucket** *(string) --* The Amazon Resource Name (ARN) of the access point for the source Outposts bucket that you want S3 on Outposts to replicate the objects from. S3Control / Client / get_bucket get_bucket ********** S3Control.Client.get_bucket(**kwargs) Gets an Amazon S3 on Outposts bucket. For more information, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. If you are using an identity other than the root user of the Amazon Web Services account that owns the Outposts bucket, the calling identity must have the "s3-outposts:GetBucket" permissions on the specified Outposts bucket and belong to the Outposts bucket owner's account in order to use this action. Only users from Outposts bucket owner account with the right permissions can perform actions on an Outposts bucket. If you don't have "s3-outposts:GetBucket" permissions or you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "403 Access Denied" error. The following actions are related to "GetBucket" for Amazon S3 on Outposts: All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. * PutObject * CreateBucket * DeleteBucket See also: AWS API Documentation **Request Syntax** response = client.get_bucket( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'Bucket': 'string', 'PublicAccessBlockEnabled': True|False, 'CreationDate': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **Bucket** *(string) --* The Outposts bucket requested. * **PublicAccessBlockEnabled** *(boolean) --* * **CreationDate** *(datetime) --* The creation date of the Outposts bucket. S3Control / Client / put_bucket_versioning put_bucket_versioning ********************* S3Control.Client.put_bucket_versioning(**kwargs) Note: This operation sets the versioning state for S3 on Outposts buckets only. To set the versioning state for an S3 bucket, see PutBucketVersioning in the *Amazon S3 API Reference*. Sets the versioning state for an S3 on Outposts bucket. With S3 Versioning, you can save multiple distinct copies of your objects and recover from unintended user actions and application failures. You can set the versioning state to one of the following: * **Enabled** - Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID. * **Suspended** - Suspends versioning for the objects in the bucket. All objects added to the bucket receive the version ID "null". If you've never set versioning on your bucket, it has no versioning state. In that case, a GetBucketVersioning request does not return a versioning state value. When you enable S3 Versioning, for each object in your bucket, you have a current version and zero or more noncurrent versions. You can configure your bucket S3 Lifecycle rules to expire noncurrent versions after a specified time period. For more information, see Creating and managing a lifecycle configuration for your S3 on Outposts bucket in the *Amazon S3 User Guide*. If you have an object expiration lifecycle configuration in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle configuration will manage the deletes of the noncurrent object versions in the version-enabled bucket. For more information, see Versioning in the *Amazon S3 User Guide*. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following operations are related to "PutBucketVersioning" for S3 on Outposts. * GetBucketVersioning * PutBucketLifecycleConfiguration * GetBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.put_bucket_versioning( AccountId='string', Bucket='string', MFA='string', VersioningConfiguration={ 'MFADelete': 'Enabled'|'Disabled', 'Status': 'Enabled'|'Suspended' } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 on Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** The S3 on Outposts bucket to set the versioning state for. * **MFA** (*string*) -- The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. * **VersioningConfiguration** (*dict*) -- **[REQUIRED]** The root-level tag for the "VersioningConfiguration" parameters. * **MFADelete** *(string) --* Specifies whether MFA delete is enabled or disabled in the bucket versioning configuration for the S3 on Outposts bucket. * **Status** *(string) --* Sets the versioning state of the S3 on Outposts bucket. Returns: None S3Control / Client / get_access_grant get_access_grant **************** S3Control.Client.get_access_grant(**kwargs) Get the details of an access grant from your S3 Access Grants instance. Permissions You must have the "s3:GetAccessGrant" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_access_grant( AccountId='string', AccessGrantId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **AccessGrantId** (*string*) -- **[REQUIRED]** The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. Return type: dict Returns: **Response Syntax** { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantId': 'string', 'AccessGrantArn': 'string', 'Grantee': { 'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM', 'GranteeIdentifier': 'string' }, 'Permission': 'READ'|'WRITE'|'READWRITE', 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationConfiguration': { 'S3SubPrefix': 'string' }, 'GrantScope': 'string', 'ApplicationArn': 'string' } **Response Structure** * *(dict) --* * **CreatedAt** *(datetime) --* The date and time when you created the access grant. * **AccessGrantId** *(string) --* The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. * **AccessGrantArn** *(string) --* The Amazon Resource Name (ARN) of the access grant. * **Grantee** *(dict) --* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added a corporate directory to Amazon Web Services IAM Identity Center and associated this Identity Center instance with the S3 Access Grants instance, the grantee can also be a corporate directory user or group. * **GranteeType** *(string) --* The type of the grantee to which access has been granted. It can be one of the following values: * "IAM" - An IAM user or role. * "DIRECTORY_USER" - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * "DIRECTORY_GROUP" - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * **GranteeIdentifier** *(string) --* The unique identifier of the "Grantee". If the grantee type is "IAM", the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". You can obtain this UUID from your Amazon Web Services IAM Identity Center instance. * **Permission** *(string) --* The type of permission that was granted in the access grant. Can be one of the following values: * "READ" – Grant read-only access to the S3 data. * "WRITE" – Grant write-only access to the S3 data. * "READWRITE" – Grant both read and write access to the S3 data. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationConfiguration** *(dict) --* The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access. * **S3SubPrefix** *(string) --* The "S3SubPrefix" is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location "s3://" because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location "s3://", the "S3SubPrefx" can be a />>*<<, so the full grant scope path would be "s3:///*". Or the "S3SubPrefx" can be "/*", so the full grant scope path would be or "s3:///*". If the "S3SubPrefix" includes a prefix, append the wildcard character "*" after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix. * **GrantScope** *(string) --* The S3 path of the data to which you are granting access. It is the result of appending the "Subprefix" to the location scope. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. S3Control / Client / list_access_grants_instances list_access_grants_instances **************************** S3Control.Client.list_access_grants_instances(**kwargs) Returns a list of S3 Access Grants instances. An S3 Access Grants instance serves as a logical grouping for your individual access grants. You can only have one S3 Access Grants instance per Region per account. Permissions You must have the "s3:ListAccessGrantsInstances" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_access_grants_instances( AccountId='string', NextToken='string', MaxResults=123 ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **NextToken** (*string*) -- A pagination token to request the next page of results. Pass this value into a subsequent "List Access Grants Instances" request in order to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of access grants that you would like returned in the "List Access Grants" response. If the results include the pagination token "NextToken", make another call using the "NextToken" to determine if there are more results. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'AccessGrantsInstancesList': [ { 'AccessGrantsInstanceId': 'string', 'AccessGrantsInstanceArn': 'string', 'CreatedAt': datetime(2015, 1, 1), 'IdentityCenterArn': 'string', 'IdentityCenterInstanceArn': 'string', 'IdentityCenterApplicationArn': 'string' }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A pagination token to request the next page of results. Pass this value into a subsequent "List Access Grants Instances" request in order to retrieve the next page of results. * **AccessGrantsInstancesList** *(list) --* A container for a list of S3 Access Grants instances. * *(dict) --* Information about the S3 Access Grants instance. * **AccessGrantsInstanceId** *(string) --* The ID of the S3 Access Grants instance. The ID is "default". You can have one S3 Access Grants instance per Region per account. * **AccessGrantsInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the S3 Access Grants instance. * **CreatedAt** *(datetime) --* The date and time when you created the S3 Access Grants instance. * **IdentityCenterArn** *(string) --* If you associated your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) of the IAM Identity Center instance application; a subresource of the original Identity Center instance. S3 Access Grants creates this Identity Center application for the specific S3 Access Grants instance. * **IdentityCenterInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the ListInstances API operation to retrieve a list of your Identity Center instances and their ARNs. * **IdentityCenterApplicationArn** *(string) --* If you associated your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) of the IAM Identity Center instance application; a subresource of the original Identity Center instance. S3 Access Grants creates this Identity Center application for the specific S3 Access Grants instance. S3Control / Client / create_multi_region_access_point create_multi_region_access_point ******************************** S3Control.Client.create_multi_region_access_point(**kwargs) Note: This operation is not supported by directory buckets. Creates a Multi-Region Access Point and associates it with the specified buckets. For more information about creating Multi-Region Access Points, see Creating Multi-Region Access Points in the *Amazon S3 User Guide*. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. This request is asynchronous, meaning that you might receive a response before the command has completed. When this request provides a response, it provides a token that you can use to monitor the status of the request with "DescribeMultiRegionAccessPointOperation". The following actions are related to "CreateMultiRegionAccessPoint": * DeleteMultiRegionAccessPoint * DescribeMultiRegionAccessPointOperation * GetMultiRegionAccessPoint * ListMultiRegionAccessPoints See also: AWS API Documentation **Request Syntax** response = client.create_multi_region_access_point( AccountId='string', ClientToken='string', Details={ 'Name': 'string', 'PublicAccessBlock': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, 'Regions': [ { 'Bucket': 'string', 'BucketAccountId': 'string' }, ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. The owner of the Multi-Region Access Point also must own the underlying buckets. * **ClientToken** (*string*) -- **[REQUIRED]** An idempotency token used to identify the request and guarantee that requests are unique. This field is autopopulated if not provided. * **Details** (*dict*) -- **[REQUIRED]** A container element containing details about the Multi-Region Access Point. * **Name** *(string) --* **[REQUIRED]** The name of the Multi-Region Access Point associated with this request. * **PublicAccessBlock** *(dict) --* The "PublicAccessBlock" configuration that you want to apply to this Amazon S3 account. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the *Amazon S3 User Guide*. This data type is not supported for Amazon S3 on Outposts. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **Regions** *(list) --* **[REQUIRED]** The buckets in different Regions that are associated with the Multi-Region Access Point. * *(dict) --* A Region that supports a Multi-Region Access Point as well as the associated bucket for the Region. * **Bucket** *(string) --* **[REQUIRED]** The name of the associated bucket for the Region. * **BucketAccountId** *(string) --* The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point. Return type: dict Returns: **Response Syntax** { 'RequestTokenARN': 'string' } **Response Structure** * *(dict) --* * **RequestTokenARN** *(string) --* The request token associated with the request. You can use this token with DescribeMultiRegionAccessPointOperation to determine the status of asynchronous requests. S3Control / Client / put_storage_lens_configuration put_storage_lens_configuration ****************************** S3Control.Client.put_storage_lens_configuration(**kwargs) Note: This operation is not supported by directory buckets. Puts an Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see Working with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. For a complete list of S3 Storage Lens metrics, see S3 Storage Lens metrics glossary in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:PutStorageLensConfiguration" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.put_storage_lens_configuration( ConfigId='string', AccountId='string', StorageLensConfiguration={ 'Id': 'string', 'AccountLevel': { 'ActivityMetrics': { 'IsEnabled': True|False }, 'BucketLevel': { 'ActivityMetrics': { 'IsEnabled': True|False }, 'PrefixLevel': { 'StorageMetrics': { 'IsEnabled': True|False, 'SelectionCriteria': { 'Delimiter': 'string', 'MaxDepth': 123, 'MinStorageBytesPercentage': 123.0 } } }, 'AdvancedCostOptimizationMetrics': { 'IsEnabled': True|False }, 'AdvancedDataProtectionMetrics': { 'IsEnabled': True|False }, 'DetailedStatusCodesMetrics': { 'IsEnabled': True|False } }, 'AdvancedCostOptimizationMetrics': { 'IsEnabled': True|False }, 'AdvancedDataProtectionMetrics': { 'IsEnabled': True|False }, 'DetailedStatusCodesMetrics': { 'IsEnabled': True|False }, 'StorageLensGroupLevel': { 'SelectionCriteria': { 'Include': [ 'string', ], 'Exclude': [ 'string', ] } } }, 'Include': { 'Buckets': [ 'string', ], 'Regions': [ 'string', ] }, 'Exclude': { 'Buckets': [ 'string', ], 'Regions': [ 'string', ] }, 'DataExport': { 'S3BucketDestination': { 'Format': 'CSV'|'Parquet', 'OutputSchemaVersion': 'V_1', 'AccountId': 'string', 'Arn': 'string', 'Prefix': 'string', 'Encryption': { 'SSES3': {} , 'SSEKMS': { 'KeyId': 'string' } } }, 'CloudWatchMetrics': { 'IsEnabled': True|False } }, 'IsEnabled': True|False, 'AwsOrg': { 'Arn': 'string' }, 'StorageLensArn': 'string' }, Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **ConfigId** (*string*) -- **[REQUIRED]** The ID of the S3 Storage Lens configuration. * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. * **StorageLensConfiguration** (*dict*) -- **[REQUIRED]** The S3 Storage Lens configuration. * **Id** *(string) --* **[REQUIRED]** A container for the Amazon S3 Storage Lens configuration ID. * **AccountLevel** *(dict) --* **[REQUIRED]** A container for all the account-level configurations of your S3 Storage Lens configuration. * **ActivityMetrics** *(dict) --* A container element for S3 Storage Lens activity metrics. * **IsEnabled** *(boolean) --* A container that indicates whether activity metrics are enabled. * **BucketLevel** *(dict) --* **[REQUIRED]** A container element for the S3 Storage Lens bucket-level configuration. * **ActivityMetrics** *(dict) --* A container for the bucket-level activity metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether activity metrics are enabled. * **PrefixLevel** *(dict) --* A container for the prefix-level metrics for S3 Storage Lens. * **StorageMetrics** *(dict) --* **[REQUIRED]** A container for the prefix-level storage metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container for whether prefix-level storage metrics are enabled. * **SelectionCriteria** *(dict) --* * **Delimiter** *(string) --* A container for the delimiter of the selection criteria being used. * **MaxDepth** *(integer) --* The max depth of the selection criteria * **MinStorageBytesPercentage** *(float) --* The minimum number of storage bytes percentage whose metrics will be selected. Note: You must choose a value greater than or equal to "1.0". * **AdvancedCostOptimizationMetrics** *(dict) --* A container for bucket-level advanced cost-optimization metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether advanced cost- optimization metrics are enabled. * **AdvancedDataProtectionMetrics** *(dict) --* A container for bucket-level advanced data-protection metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether advanced data- protection metrics are enabled. * **DetailedStatusCodesMetrics** *(dict) --* A container for bucket-level detailed status code metrics for S3 Storage Lens. * **IsEnabled** *(boolean) --* A container that indicates whether detailed status code metrics are enabled. * **AdvancedCostOptimizationMetrics** *(dict) --* A container element for S3 Storage Lens advanced cost- optimization metrics. * **IsEnabled** *(boolean) --* A container that indicates whether advanced cost- optimization metrics are enabled. * **AdvancedDataProtectionMetrics** *(dict) --* A container element for S3 Storage Lens advanced data- protection metrics. * **IsEnabled** *(boolean) --* A container that indicates whether advanced data- protection metrics are enabled. * **DetailedStatusCodesMetrics** *(dict) --* A container element for detailed status code metrics. * **IsEnabled** *(boolean) --* A container that indicates whether detailed status code metrics are enabled. * **StorageLensGroupLevel** *(dict) --* A container element for S3 Storage Lens groups metrics. * **SelectionCriteria** *(dict) --* Indicates which Storage Lens group ARNs to include or exclude in the Storage Lens group aggregation. If this value is left null, then all Storage Lens groups are selected. * **Include** *(list) --* Indicates which Storage Lens group ARNs to include in the Storage Lens group aggregation. * *(string) --* * **Exclude** *(list) --* Indicates which Storage Lens group ARNs to exclude from the Storage Lens group aggregation. * *(string) --* * **Include** *(dict) --* A container for what is included in this configuration. This container can only be valid if there is no "Exclude" container submitted, and it's not empty. * **Buckets** *(list) --* A container for the S3 Storage Lens bucket includes. * *(string) --* * **Regions** *(list) --* A container for the S3 Storage Lens Region includes. * *(string) --* * **Exclude** *(dict) --* A container for what is excluded in this configuration. This container can only be valid if there is no "Include" container submitted, and it's not empty. * **Buckets** *(list) --* A container for the S3 Storage Lens bucket excludes. * *(string) --* * **Regions** *(list) --* A container for the S3 Storage Lens Region excludes. * *(string) --* * **DataExport** *(dict) --* A container to specify the properties of your S3 Storage Lens metrics export including, the destination, schema and format. * **S3BucketDestination** *(dict) --* A container for the bucket where the S3 Storage Lens metrics export will be located. Note: This bucket must be located in the same Region as the storage lens configuration. * **Format** *(string) --* **[REQUIRED]** * **OutputSchemaVersion** *(string) --* **[REQUIRED]** The schema version of the export file. * **AccountId** *(string) --* **[REQUIRED]** The account ID of the owner of the S3 Storage Lens metrics export bucket. * **Arn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the bucket. This property is read-only and follows the following format: "arn:aws:s3:us-east-1:example-account-id:bucket/your- destination-bucket-name" * **Prefix** *(string) --* The prefix of the destination bucket where the metrics export will be delivered. * **Encryption** *(dict) --* The container for the type encryption of the metrics exports in this bucket. * **SSES3** *(dict) --* * **SSEKMS** *(dict) --* * **KeyId** *(string) --* **[REQUIRED]** A container for the ARN of the SSE-KMS encryption. This property is read-only and follows the following format: "arn:aws:kms:us-east-1:example-account- id:key/example-9a73-4afc-8d29-8f5900cef44e" * **CloudWatchMetrics** *(dict) --* A container for enabling Amazon CloudWatch publishing for S3 Storage Lens metrics. * **IsEnabled** *(boolean) --* **[REQUIRED]** A container that indicates whether CloudWatch publishing for S3 Storage Lens metrics is enabled. A value of "true" indicates that CloudWatch publishing for S3 Storage Lens metrics is enabled. * **IsEnabled** *(boolean) --* **[REQUIRED]** A container for whether the S3 Storage Lens configuration is enabled. * **AwsOrg** *(dict) --* A container for the Amazon Web Services organization for this S3 Storage Lens configuration. * **Arn** *(string) --* **[REQUIRED]** A container for the Amazon Resource Name (ARN) of the Amazon Web Services organization. This property is read- only and follows the following format: "arn:aws:organizations:us-east-1:example-account- id:organization/o-ex2l495dck" * **StorageLensArn** *(string) --* The Amazon Resource Name (ARN) of the S3 Storage Lens configuration. This property is read-only and follows the following format: "arn:aws:s3:us-east-1:example-account-id :storage-lens/your-dashboard-name" * **Tags** (*list*) -- The tag set of the S3 Storage Lens configuration. Note: You can set up to a maximum of 50 tags. * *(dict) --* * **Key** *(string) --* **[REQUIRED]** * **Value** *(string) --* **[REQUIRED]** Returns: None S3Control / Client / get_access_grants_instance_resource_policy get_access_grants_instance_resource_policy ****************************************** S3Control.Client.get_access_grants_instance_resource_policy(**kwargs) Returns the resource policy of the S3 Access Grants instance. Permissions You must have the "s3:GetAccessGrantsInstanceResourcePolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_access_grants_instance_resource_policy( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. Return type: dict Returns: **Response Syntax** { 'Policy': 'string', 'Organization': 'string', 'CreatedAt': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **Policy** *(string) --* The resource policy of the S3 Access Grants instance. * **Organization** *(string) --* The Organization of the resource policy of the S3 Access Grants instance. * **CreatedAt** *(datetime) --* The date and time when you created the S3 Access Grants instance resource policy. S3Control / Client / delete_storage_lens_group delete_storage_lens_group ************************* S3Control.Client.delete_storage_lens_group(**kwargs) Deletes an existing S3 Storage Lens group. To use this operation, you must have the permission to perform the "s3:DeleteStorageLensGroup" action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. For information about Storage Lens groups errors, see List of Amazon S3 Storage Lens error codes. See also: AWS API Documentation **Request Syntax** response = client.delete_storage_lens_group( Name='string', AccountId='string' ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the Storage Lens group that you're trying to delete. * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID used to create the Storage Lens group that you're trying to delete. Returns: None S3Control / Client / update_access_grants_location update_access_grants_location ***************************** S3Control.Client.update_access_grants_location(**kwargs) Updates the IAM role of a registered location in your S3 Access Grants instance. Permissions You must have the "s3:UpdateAccessGrantsLocation" permission to use this operation. Additional Permissions You must also have the following permission: "iam:PassRole" See also: AWS API Documentation **Request Syntax** response = client.update_access_grants_location( AccountId='string', AccessGrantsLocationId='string', IAMRoleArn='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **AccessGrantsLocationId** (*string*) -- **[REQUIRED]** The ID of the registered location that you are updating. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. The ID of the registered location to which you are granting access. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. If you are passing the "default" location, you cannot create an access grant for the entire default location. You must also specify a bucket or a bucket and prefix in the "Subprefix" field. * **IAMRoleArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location. Return type: dict Returns: **Response Syntax** { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationArn': 'string', 'LocationScope': 'string', 'IAMRoleArn': 'string' } **Response Structure** * *(dict) --* * **CreatedAt** *(datetime) --* The date and time when you registered the location. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationArn** *(string) --* The Amazon Resource Name (ARN) of the registered location that you are updating. * **LocationScope** *(string) --* The S3 URI path of the location that you are updating. You cannot update the scope of the registered location. The location scope can be the default S3 location "s3://", the S3 path to a bucket "s3://", or the S3 path to a bucket and prefix "s3:///". * **IAMRoleArn** *(string) --* The Amazon Resource Name (ARN) of the IAM role of the registered location. S3 Access Grants assumes this role to manage access to the registered location. S3Control / Client / put_multi_region_access_point_policy put_multi_region_access_point_policy ************************************ S3Control.Client.put_multi_region_access_point_policy(**kwargs) Note: This operation is not supported by directory buckets. Associates an access control policy with the specified Multi-Region Access Point. Each Multi-Region Access Point can have only one policy, so a request made to this action replaces any existing policy that is associated with the specified Multi-Region Access Point. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. The following actions are related to "PutMultiRegionAccessPointPolicy": * GetMultiRegionAccessPointPolicy * GetMultiRegionAccessPointPolicyStatus See also: AWS API Documentation **Request Syntax** response = client.put_multi_region_access_point_policy( AccountId='string', ClientToken='string', Details={ 'Name': 'string', 'Policy': 'string' } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **ClientToken** (*string*) -- **[REQUIRED]** An idempotency token used to identify the request and guarantee that requests are unique. This field is autopopulated if not provided. * **Details** (*dict*) -- **[REQUIRED]** A container element containing the details of the policy for the Multi-Region Access Point. * **Name** *(string) --* **[REQUIRED]** The name of the Multi-Region Access Point associated with the request. * **Policy** *(string) --* **[REQUIRED]** The policy details for the "PutMultiRegionAccessPoint" request. Return type: dict Returns: **Response Syntax** { 'RequestTokenARN': 'string' } **Response Structure** * *(dict) --* * **RequestTokenARN** *(string) --* The request token associated with the request. You can use this token with DescribeMultiRegionAccessPointOperation to determine the status of asynchronous requests. S3Control / Client / list_storage_lens_configurations list_storage_lens_configurations ******************************** S3Control.Client.list_storage_lens_configurations(**kwargs) Note: This operation is not supported by directory buckets. Gets a list of Amazon S3 Storage Lens configurations. For more information about S3 Storage Lens, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:ListStorageLensConfigurations" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.list_storage_lens_configurations( AccountId='string', NextToken='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. * **NextToken** (*string*) -- A pagination token to request the next page of results. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'StorageLensConfigurationList': [ { 'Id': 'string', 'StorageLensArn': 'string', 'HomeRegion': 'string', 'IsEnabled': True|False }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* If the request produced more than the maximum number of S3 Storage Lens configuration results, you can pass this value into a subsequent request to retrieve the next page of results. * **StorageLensConfigurationList** *(list) --* A list of S3 Storage Lens configurations. * *(dict) --* Part of "ListStorageLensConfigurationResult". Each entry includes the description of the S3 Storage Lens configuration, its home Region, whether it is enabled, its Amazon Resource Name (ARN), and config ID. * **Id** *(string) --* A container for the S3 Storage Lens configuration ID. * **StorageLensArn** *(string) --* The ARN of the S3 Storage Lens configuration. This property is read-only. * **HomeRegion** *(string) --* A container for the S3 Storage Lens home Region. Your metrics data is stored and retained in your designated S3 Storage Lens home Region. * **IsEnabled** *(boolean) --* A container for whether the S3 Storage Lens configuration is enabled. This property is required. S3Control / Client / get_multi_region_access_point_routes get_multi_region_access_point_routes ************************************ S3Control.Client.get_multi_region_access_point_routes(**kwargs) Note: This operation is not supported by directory buckets. Returns the routing configuration for a Multi-Region Access Point, indicating which Regions are active or passive. To obtain routing control changes and failover requests, use the Amazon S3 failover control infrastructure endpoints in these five Amazon Web Services Regions: * "us-east-1" * "us-west-2" * "ap-southeast-2" * "ap-northeast-1" * "eu-west-1" See also: AWS API Documentation **Request Syntax** response = client.get_multi_region_access_point_routes( AccountId='string', Mrap='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **Mrap** (*string*) -- **[REQUIRED]** The Multi-Region Access Point ARN. Return type: dict Returns: **Response Syntax** { 'Mrap': 'string', 'Routes': [ { 'Bucket': 'string', 'Region': 'string', 'TrafficDialPercentage': 123 }, ] } **Response Structure** * *(dict) --* * **Mrap** *(string) --* The Multi-Region Access Point ARN. * **Routes** *(list) --* The different routes that make up the route configuration. Active routes return a value of "100", and passive routes return a value of "0". * *(dict) --* A structure for a Multi-Region Access Point that indicates where Amazon S3 traffic can be routed. Routes can be either active or passive. Active routes can process Amazon S3 requests through the Multi-Region Access Point, but passive routes are not eligible to process Amazon S3 requests. Each route contains the Amazon S3 bucket name and the Amazon Web Services Region that the bucket is located in. The route also includes the "TrafficDialPercentage" value, which shows whether the bucket and Region are active (indicated by a value of "100") or passive (indicated by a value of "0"). * **Bucket** *(string) --* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the "Bucket" or the "Region" value must be provided. If both are provided, the bucket must be in the specified Region. * **Region** *(string) --* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the "Bucket" or the "Region" value must be provided. If both are provided, the bucket must be in the specified Region. * **TrafficDialPercentage** *(integer) --* The traffic state for the specified bucket or Amazon Web Services Region. A value of "0" indicates a passive state, which means that no new traffic will be routed to the Region. A value of "100" indicates an active state, which means that traffic will be routed to the specified Region. When the routing configuration for a Region is changed from active to passive, any in-progress operations (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final success or failure status is reached. If all Regions in the routing configuration are designated as passive, you'll receive an "InvalidRequest" error. S3Control / Client / list_access_points_for_object_lambda list_access_points_for_object_lambda ************************************ S3Control.Client.list_access_points_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Returns some or all (up to 1,000) access points associated with the Object Lambda Access Point per call. If there are more access points than what can be returned in one call, the response will include a continuation token that you can use to list the additional access points. The following actions are related to "ListAccessPointsForObjectLambda": * CreateAccessPointForObjectLambda * DeleteAccessPointForObjectLambda * GetAccessPointForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.list_access_points_for_object_lambda( AccountId='string', NextToken='string', MaxResults=123 ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **NextToken** (*string*) -- If the list has more access points than can be returned in one call to this API, this field contains a continuation token that you can provide in subsequent calls to this API to retrieve additional access points. * **MaxResults** (*integer*) -- The maximum number of access points that you want to include in the list. The response may contain fewer access points but will never contain more. If there are more than this number of access points, then the response will include a continuation token in the "NextToken" field that you can use to retrieve the next page of access points. Return type: dict Returns: **Response Syntax** { 'ObjectLambdaAccessPointList': [ { 'Name': 'string', 'ObjectLambdaAccessPointArn': 'string', 'Alias': { 'Value': 'string', 'Status': 'PROVISIONING'|'READY' } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **ObjectLambdaAccessPointList** *(list) --* Returns list of Object Lambda Access Points. * *(dict) --* An access point with an attached Lambda function used to access transformed data from an Amazon S3 bucket. * **Name** *(string) --* The name of the Object Lambda Access Point. * **ObjectLambdaAccessPointArn** *(string) --* Specifies the ARN for the Object Lambda Access Point. * **Alias** *(dict) --* The alias of the Object Lambda Access Point. * **Value** *(string) --* The alias value of the Object Lambda Access Point. * **Status** *(string) --* The status of the Object Lambda Access Point alias. If the status is "PROVISIONING", the Object Lambda Access Point is provisioning the alias and the alias is not ready for use yet. If the status is "READY", the Object Lambda Access Point alias is successfully provisioned and ready for use. * **NextToken** *(string) --* If the list has more access points than can be returned in one call to this API, this field contains a continuation token that you can provide in subsequent calls to this API to retrieve additional access points. S3Control / Client / list_tags_for_resource list_tags_for_resource ********************** S3Control.Client.list_tags_for_resource(**kwargs) This operation allows you to list all of the tags for a specified resource. Each tag is a label consisting of a key and value. Tags can help you organize, track costs for, and control access to resources. Note: This operation is only supported for the following Amazon S3 resources: * Directory buckets * Storage Lens groups * S3 Access Grants instances, registered locations, and grants. Permissions For Storage Lens groups and S3 Access Grants, you must have the "s3:ListTagsForResource" permission to use this operation. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. Directory bucket permissions For directory buckets, you must have the "s3express:ListTagsForResource" permission to use this operation. For more information about directory buckets policies and permissions, see Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". For information about S3 Tagging errors, see List of Amazon S3 Tagging error codes. See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( AccountId='string', ResourceArn='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the resource owner. * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the S3 resource that you want to list tags for. The tagged resource can be a directory bucket, S3 Storage Lens group or S3 Access Grants instance, registered location, or grant. Return type: dict Returns: **Response Syntax** { 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **Tags** *(list) --* The Amazon Web Services resource tags that are associated with the resource. * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. S3Control / Client / get_bucket_versioning get_bucket_versioning ********************* S3Control.Client.get_bucket_versioning(**kwargs) Note: This operation returns the versioning state for S3 on Outposts buckets only. To return the versioning state for an S3 bucket, see GetBucketVersioning in the *Amazon S3 API Reference*. Returns the versioning state for an S3 on Outposts bucket. With S3 Versioning, you can save multiple distinct copies of your objects and recover from unintended user actions and application failures. If you've never set versioning on your bucket, it has no versioning state. In that case, the "GetBucketVersioning" request does not return a versioning state value. For more information about versioning, see Versioning in the *Amazon S3 User Guide*. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following operations are related to "GetBucketVersioning" for S3 on Outposts. * PutBucketVersioning * PutBucketLifecycleConfiguration * GetBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_versioning( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 on Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** The S3 on Outposts bucket to return the versioning state for. Return type: dict Returns: **Response Syntax** { 'Status': 'Enabled'|'Suspended', 'MFADelete': 'Enabled'|'Disabled' } **Response Structure** * *(dict) --* * **Status** *(string) --* The versioning state of the S3 on Outposts bucket. * **MFADelete** *(string) --* Specifies whether MFA delete is enabled in the bucket versioning configuration. This element is returned only if the bucket has been configured with MFA delete. If MFA delete has never been configured for the bucket, this element is not returned. S3Control / Client / get_multi_region_access_point_policy_status get_multi_region_access_point_policy_status ******************************************* S3Control.Client.get_multi_region_access_point_policy_status(**kwargs) Note: This operation is not supported by directory buckets. Indicates whether the specified Multi-Region Access Point has an access control policy that allows public access. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. The following actions are related to "GetMultiRegionAccessPointPolicyStatus": * GetMultiRegionAccessPointPolicy * PutMultiRegionAccessPointPolicy See also: AWS API Documentation **Request Syntax** response = client.get_multi_region_access_point_policy_status( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **Name** (*string*) -- **[REQUIRED]** Specifies the Multi-Region Access Point. The name of the Multi-Region Access Point is different from the alias. For more information about the distinction between the name and the alias of an Multi-Region Access Point, see Rules for naming Amazon S3 Multi-Region Access Points in the *Amazon S3 User Guide*. Return type: dict Returns: **Response Syntax** { 'Established': { 'IsPublic': True|False } } **Response Structure** * *(dict) --* * **Established** *(dict) --* Indicates whether this access point policy is public. For more information about how Amazon S3 evaluates policies to determine whether they are public, see The Meaning of "Public" in the *Amazon S3 User Guide*. * **IsPublic** *(boolean) --* S3Control / Client / delete_job_tagging delete_job_tagging ****************** S3Control.Client.delete_job_tagging(**kwargs) Removes the entire tag set from the specified S3 Batch Operations job. Permissions To use the "DeleteJobTagging" operation, you must have permission to perform the "s3:DeleteJobTagging" action. For more information, see Controlling access and labeling jobs using tags in the *Amazon S3 User Guide*. Related actions include: * CreateJob * GetJobTagging * PutJobTagging See also: AWS API Documentation **Request Syntax** response = client.delete_job_tagging( AccountId='string', JobId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobId** (*string*) -- **[REQUIRED]** The ID for the S3 Batch Operations job whose tags you want to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Control.Client.exceptions.InternalServiceException" * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.NotFoundException" S3Control / Client / untag_resource untag_resource ************** S3Control.Client.untag_resource(**kwargs) This operation removes the specified user-defined tags from an S3 resource. You can pass one or more tag keys. Note: This operation is only supported for the following Amazon S3 resources: * Directory buckets * Storage Lens groups * S3 Access Grants instances, registered locations, and grants. Permissions For Storage Lens groups and S3 Access Grants, you must have the "s3:UntagResource" permission to use this operation. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. Directory bucket permissions For directory buckets, you must have the "s3express:UntagResource" permission to use this operation. For more information about directory buckets policies and permissions, see Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". For information about S3 Tagging errors, see List of Amazon S3 Tagging error codes. See also: AWS API Documentation **Request Syntax** response = client.untag_resource( AccountId='string', ResourceArn='string', TagKeys=[ 'string', ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the resource that you're trying to remove the tags from. * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the S3 resource that you're removing tags from. The tagged resource can be a directory bucket, S3 Storage Lens group or S3 Access Grants instance, registered location, or grant. * **TagKeys** (*list*) -- **[REQUIRED]** The array of tag key-value pairs that you're trying to remove from of the S3 resource. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* S3Control / Client / get_access_point_configuration_for_object_lambda get_access_point_configuration_for_object_lambda ************************************************ S3Control.Client.get_access_point_configuration_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Returns configuration for an Object Lambda Access Point. The following actions are related to "GetAccessPointConfigurationForObjectLambda": * PutAccessPointConfigurationForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.get_access_point_configuration_for_object_lambda( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point you want to return the configuration for. Return type: dict Returns: **Response Syntax** { 'Configuration': { 'SupportingAccessPoint': 'string', 'CloudWatchMetricsEnabled': True|False, 'AllowedFeatures': [ 'GetObject-Range'|'GetObject-PartNumber'|'HeadObject-Range'|'HeadObject-PartNumber', ], 'TransformationConfigurations': [ { 'Actions': [ 'GetObject'|'HeadObject'|'ListObjects'|'ListObjectsV2', ], 'ContentTransformation': { 'AwsLambda': { 'FunctionArn': 'string', 'FunctionPayload': 'string' } } }, ] } } **Response Structure** * *(dict) --* * **Configuration** *(dict) --* Object Lambda Access Point configuration document. * **SupportingAccessPoint** *(string) --* Standard access point associated with the Object Lambda Access Point. * **CloudWatchMetricsEnabled** *(boolean) --* A container for whether the CloudWatch metrics configuration is enabled. * **AllowedFeatures** *(list) --* A container for allowed features. Valid inputs are "GetObject-Range", "GetObject-PartNumber", "HeadObject- Range", and "HeadObject-PartNumber". * *(string) --* * **TransformationConfigurations** *(list) --* A container for transformation configurations for an Object Lambda Access Point. * *(dict) --* A configuration used when creating an Object Lambda Access Point transformation. * **Actions** *(list) --* A container for the action of an Object Lambda Access Point configuration. Valid inputs are "GetObject", "ListObjects", "HeadObject", and "ListObjectsV2". * *(string) --* * **ContentTransformation** *(dict) --* A container for the content transformation of an Object Lambda Access Point configuration. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "AwsLambda". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **AwsLambda** *(dict) --* A container for an Lambda function. * **FunctionArn** *(string) --* The Amazon Resource Name (ARN) of the Lambda function. * **FunctionPayload** *(string) --* Additional JSON that provides supplemental data to the Lambda function used to transform objects. S3Control / Client / list_storage_lens_groups list_storage_lens_groups ************************ S3Control.Client.list_storage_lens_groups(**kwargs) Lists all the Storage Lens groups in the specified home Region. To use this operation, you must have the permission to perform the "s3:ListStorageLensGroups" action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. For information about Storage Lens groups errors, see List of Amazon S3 Storage Lens error codes. See also: AWS API Documentation **Request Syntax** response = client.list_storage_lens_groups( AccountId='string', NextToken='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the Storage Lens groups. * **NextToken** (*string*) -- The token for the next set of results, or "null" if there are no more results. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'StorageLensGroupList': [ { 'Name': 'string', 'StorageLensGroupArn': 'string', 'HomeRegion': 'string' }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* If "NextToken" is returned, there are more Storage Lens groups results available. The value of "NextToken" is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. * **StorageLensGroupList** *(list) --* The list of Storage Lens groups that exist in the specified home Region. * *(dict) --* Each entry contains a Storage Lens group that exists in the specified home Region. * **Name** *(string) --* Contains the name of the Storage Lens group that exists in the specified home Region. * **StorageLensGroupArn** *(string) --* Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only. * **HomeRegion** *(string) --* Contains the Amazon Web Services Region where the Storage Lens group was created. S3Control / Client / get_access_point get_access_point **************** S3Control.Client.get_access_point(**kwargs) Returns configuration information about the specified access point. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "GetAccessPoint": * CreateAccessPoint * DeleteAccessPoint * ListAccessPoints See also: AWS API Documentation **Request Syntax** response = client.get_access_point( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the account that owns the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point whose configuration information you want to retrieve. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format "arn:aws:s3-outposts:::outpost//accesspoint/". For example, to access the access point "reports-ap" through Outpost "my-outpost" owned by account "123456789012" in Region "us-west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/accesspoint/reports- ap". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'Name': 'string', 'Bucket': 'string', 'NetworkOrigin': 'Internet'|'VPC', 'VpcConfiguration': { 'VpcId': 'string' }, 'PublicAccessBlockConfiguration': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, 'CreationDate': datetime(2015, 1, 1), 'Alias': 'string', 'AccessPointArn': 'string', 'Endpoints': { 'string': 'string' }, 'BucketAccountId': 'string', 'DataSourceId': 'string', 'DataSourceType': 'string' } **Response Structure** * *(dict) --* * **Name** *(string) --* The name of the specified access point. * **Bucket** *(string) --* The name of the bucket associated with the specified access point. * **NetworkOrigin** *(string) --* Indicates whether this access point allows access from the public internet. If "VpcConfiguration" is specified for this access point, then "NetworkOrigin" is "VPC", and the access point doesn't allow access from the public internet. Otherwise, "NetworkOrigin" is "Internet", and the access point allows access from the public internet, subject to the access point and bucket access policies. This will always be true for an Amazon S3 on Outposts access point * **VpcConfiguration** *(dict) --* Contains the virtual private cloud (VPC) configuration for the specified access point. Note: This element is empty if this access point is an Amazon S3 on Outposts access point that is used by other Amazon Web Services services. * **VpcId** *(string) --* If this field is specified, this access point will only allow connections from the specified VPC ID. * **PublicAccessBlockConfiguration** *(dict) --* The "PublicAccessBlock" configuration that you want to apply to this Amazon S3 account. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the *Amazon S3 User Guide*. This data type is not supported for Amazon S3 on Outposts. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **CreationDate** *(datetime) --* The date and time when the specified access point was created. * **Alias** *(string) --* The name or alias of the access point. * **AccessPointArn** *(string) --* The ARN of the access point. * **Endpoints** *(dict) --* The VPC endpoint for the access point. * *(string) --* * *(string) --* * **BucketAccountId** *(string) --* The Amazon Web Services account ID associated with the S3 bucket associated with this access point. * **DataSourceId** *(string) --* The unique identifier for the data source of the access point. * **DataSourceType** *(string) --* The type of the data source that the access point is attached to. S3Control / Client / delete_access_point_scope delete_access_point_scope ************************* S3Control.Client.delete_access_point_scope(**kwargs) Deletes an existing access point scope for a directory bucket. Note: When you delete the scope of an access point, all prefixes and permissions are deleted. To use this operation, you must have the permission to perform the "s3express:DeleteAccessPointScope" action. For information about REST API errors, see REST error responses. See also: AWS API Documentation **Request Syntax** response = client.delete_access_point_scope( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the access point with the scope that you want to delete. * **Name** (*string*) -- **[REQUIRED]** The name of the access point with the scope that you want to delete. Returns: None S3Control / Client / update_storage_lens_group update_storage_lens_group ************************* S3Control.Client.update_storage_lens_group(**kwargs) Updates the existing Storage Lens group. To use this operation, you must have the permission to perform the "s3:UpdateStorageLensGroup" action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. For information about Storage Lens groups errors, see List of Amazon S3 Storage Lens error codes. See also: AWS API Documentation **Request Syntax** response = client.update_storage_lens_group( Name='string', AccountId='string', StorageLensGroup={ 'Name': 'string', 'Filter': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 }, 'And': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 } }, 'Or': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 } } }, 'StorageLensGroupArn': 'string' } ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the Storage Lens group that you want to update. * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Storage Lens group owner. * **StorageLensGroup** (*dict*) -- **[REQUIRED]** The JSON file that contains the Storage Lens group configuration. * **Name** *(string) --* **[REQUIRED]** Contains the name of the Storage Lens group. * **Filter** *(dict) --* **[REQUIRED]** Sets the criteria for the Storage Lens group data that is displayed. For multiple filter conditions, the "AND" or "OR" logical operator is used. * **MatchAnyPrefix** *(list) --* Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed. * *(string) --* * **MatchAnySuffix** *(list) --* Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed. * *(string) --* * **MatchAnyTag** *(list) --* Contains the list of S3 object tags. At least one object tag must be specified. Up to 10 object tags are allowed. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **MatchObjectAge** *(dict) --* Contains "DaysGreaterThan" and "DaysLessThan" to define the object age range (minimum and maximum number of days). * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Contains "BytesGreaterThan" and "BytesLessThan" to define the object size range (minimum and maximum number of Bytes). * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **And** *(dict) --* A logical operator that allows multiple filter conditions to be joined for more complex comparisons of Storage Lens group data. Objects must match all of the listed filter conditions that are joined by the "And" logical operator. Only one of each filter condition is allowed. * **MatchAnyPrefix** *(list) --* Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed. * *(string) --* * **MatchAnySuffix** *(list) --* Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed. * *(string) --* * **MatchAnyTag** *(list) --* Contains the list of object tags. At least one object tag must be specified. Up to 10 object tags are allowed. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **MatchObjectAge** *(dict) --* Contains "DaysGreaterThan" and "DaysLessThan" to define the object age range (minimum and maximum number of days). * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Contains "BytesGreaterThan" and "BytesLessThan" to define the object size range (minimum and maximum number of Bytes). * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **Or** *(dict) --* A single logical operator that allows multiple filter conditions to be joined. Objects can match any of the listed filter conditions, which are joined by the "Or" logical operator. Only one of each filter condition is allowed. * **MatchAnyPrefix** *(list) --* Filters objects that match any of the specified prefixes. * *(string) --* * **MatchAnySuffix** *(list) --* Filters objects that match any of the specified suffixes. * *(string) --* * **MatchAnyTag** *(list) --* Filters objects that match any of the specified S3 object tags. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **MatchObjectAge** *(dict) --* Filters objects that match the specified object age range. * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Filters objects that match the specified object size range. * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **StorageLensGroupArn** *(string) --* Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only. Returns: None S3Control / Client / get_waiter get_waiter ********** S3Control.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" S3Control / Client / get_bucket_policy get_bucket_policy ***************** S3Control.Client.get_bucket_policy(**kwargs) Note: This action gets a bucket policy for an Amazon S3 on Outposts bucket. To get a policy for an S3 bucket, see GetBucketPolicy in the *Amazon S3 API Reference*. Returns the policy of a specified Outposts bucket. For more information, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must have the "GetBucketPolicy" permissions on the specified bucket and belong to the bucket owner's account in order to use this action. Only users from Outposts bucket owner account with the right permissions can perform actions on an Outposts bucket. If you don't have "s3-outposts:GetBucketPolicy" permissions or you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "403 Access Denied" error. Warning: As a security precaution, the root user of the Amazon Web Services account that owns a bucket can always use this action, even if the policy explicitly denies the root user the ability to perform this action. For more information about bucket policies, see Using Bucket Policies and User Policies. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "GetBucketPolicy": * GetObject * PutBucketPolicy * DeleteBucketPolicy See also: AWS API Documentation **Request Syntax** response = client.get_bucket_policy( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'Policy': 'string' } **Response Structure** * *(dict) --* * **Policy** *(string) --* The policy of the Outposts bucket. S3Control / Client / describe_job describe_job ************ S3Control.Client.describe_job(**kwargs) Retrieves the configuration parameters and status for a Batch Operations job. For more information, see S3 Batch Operations in the *Amazon S3 User Guide*. Permissions To use the "DescribeJob" operation, you must have permission to perform the "s3:DescribeJob" action. Related actions include: * CreateJob * ListJobs * UpdateJobPriority * UpdateJobStatus See also: AWS API Documentation **Request Syntax** response = client.describe_job( AccountId='string', JobId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobId** (*string*) -- **[REQUIRED]** The ID for the job whose information you want to retrieve. Return type: dict Returns: **Response Syntax** { 'Job': { 'JobId': 'string', 'ConfirmationRequired': True|False, 'Description': 'string', 'JobArn': 'string', 'Status': 'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended', 'Manifest': { 'Spec': { 'Format': 'S3BatchOperations_CSV_20180820'|'S3InventoryReport_CSV_20161130', 'Fields': [ 'Ignore'|'Bucket'|'Key'|'VersionId', ] }, 'Location': { 'ObjectArn': 'string', 'ObjectVersionId': 'string', 'ETag': 'string' } }, 'Operation': { 'LambdaInvoke': { 'FunctionArn': 'string', 'InvocationSchemaVersion': 'string', 'UserArguments': { 'string': 'string' } }, 'S3PutObjectCopy': { 'TargetResource': 'string', 'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control', 'AccessControlGrants': [ { 'Grantee': { 'TypeIdentifier': 'id'|'emailAddress'|'uri', 'Identifier': 'string', 'DisplayName': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP' }, ], 'MetadataDirective': 'COPY'|'REPLACE', 'ModifiedSinceConstraint': datetime(2015, 1, 1), 'NewObjectMetadata': { 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'UserMetadata': { 'string': 'string' }, 'ContentLength': 123, 'ContentMD5': 'string', 'ContentType': 'string', 'HttpExpiresDate': datetime(2015, 1, 1), 'RequesterCharged': True|False, 'SSEAlgorithm': 'AES256'|'KMS' }, 'NewObjectTagging': [ { 'Key': 'string', 'Value': 'string' }, ], 'RedirectLocation': 'string', 'RequesterPays': True|False, 'StorageClass': 'STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'GLACIER'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'UnModifiedSinceConstraint': datetime(2015, 1, 1), 'SSEAwsKmsKeyId': 'string', 'TargetKeyPrefix': 'string', 'ObjectLockLegalHoldStatus': 'OFF'|'ON', 'ObjectLockMode': 'COMPLIANCE'|'GOVERNANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'BucketKeyEnabled': True|False, 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' }, 'S3PutObjectAcl': { 'AccessControlPolicy': { 'AccessControlList': { 'Owner': { 'ID': 'string', 'DisplayName': 'string' }, 'Grants': [ { 'Grantee': { 'TypeIdentifier': 'id'|'emailAddress'|'uri', 'Identifier': 'string', 'DisplayName': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP' }, ] }, 'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control' } }, 'S3PutObjectTagging': { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, 'S3DeleteObjectTagging': {}, 'S3InitiateRestoreObject': { 'ExpirationInDays': 123, 'GlacierJobTier': 'BULK'|'STANDARD' }, 'S3PutObjectLegalHold': { 'LegalHold': { 'Status': 'OFF'|'ON' } }, 'S3PutObjectRetention': { 'BypassGovernanceRetention': True|False, 'Retention': { 'RetainUntilDate': datetime(2015, 1, 1), 'Mode': 'COMPLIANCE'|'GOVERNANCE' } }, 'S3ReplicateObject': {} }, 'Priority': 123, 'ProgressSummary': { 'TotalNumberOfTasks': 123, 'NumberOfTasksSucceeded': 123, 'NumberOfTasksFailed': 123, 'Timers': { 'ElapsedTimeInActiveSeconds': 123 } }, 'StatusUpdateReason': 'string', 'FailureReasons': [ { 'FailureCode': 'string', 'FailureReason': 'string' }, ], 'Report': { 'Bucket': 'string', 'Format': 'Report_CSV_20180820', 'Enabled': True|False, 'Prefix': 'string', 'ReportScope': 'AllTasks'|'FailedTasksOnly' }, 'CreationTime': datetime(2015, 1, 1), 'TerminationDate': datetime(2015, 1, 1), 'RoleArn': 'string', 'SuspendedDate': datetime(2015, 1, 1), 'SuspendedCause': 'string', 'ManifestGenerator': { 'S3JobManifestGenerator': { 'ExpectedBucketOwner': 'string', 'SourceBucket': 'string', 'ManifestOutputLocation': { 'ExpectedManifestBucketOwner': 'string', 'Bucket': 'string', 'ManifestPrefix': 'string', 'ManifestEncryption': { 'SSES3': {}, 'SSEKMS': { 'KeyId': 'string' } }, 'ManifestFormat': 'S3InventoryReport_CSV_20211130' }, 'Filter': { 'EligibleForReplication': True|False, 'CreatedAfter': datetime(2015, 1, 1), 'CreatedBefore': datetime(2015, 1, 1), 'ObjectReplicationStatuses': [ 'COMPLETED'|'FAILED'|'REPLICA'|'NONE', ], 'KeyNameConstraint': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnySubstring': [ 'string', ] }, 'ObjectSizeGreaterThanBytes': 123, 'ObjectSizeLessThanBytes': 123, 'MatchAnyStorageClass': [ 'STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'GLACIER'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', ] }, 'EnableManifestOutput': True|False } }, 'GeneratedManifestDescriptor': { 'Format': 'S3InventoryReport_CSV_20211130', 'Location': { 'ObjectArn': 'string', 'ObjectVersionId': 'string', 'ETag': 'string' } } } } **Response Structure** * *(dict) --* * **Job** *(dict) --* Contains the configuration parameters and status for the job specified in the "Describe Job" request. * **JobId** *(string) --* The ID for the specified job. * **ConfirmationRequired** *(boolean) --* Indicates whether confirmation is required before Amazon S3 begins running the specified job. Confirmation is required only for jobs created through the Amazon S3 console. * **Description** *(string) --* The description for this job, if one was provided in this job's "Create Job" request. * **JobArn** *(string) --* The Amazon Resource Name (ARN) for this job. * **Status** *(string) --* The current status of the specified job. * **Manifest** *(dict) --* The configuration information for the specified job's manifest object. * **Spec** *(dict) --* Describes the format of the specified job's manifest. If the manifest is in CSV format, also describes the columns contained within the manifest. * **Format** *(string) --* Indicates which of the available formats the specified manifest uses. * **Fields** *(list) --* If the specified manifest object is in the "S3BatchOperations_CSV_20180820" format, this element describes which columns contain the required data. * *(string) --* * **Location** *(dict) --* Contains the information required to locate the specified job's manifest. Manifests can't be imported from directory buckets. For more information, see Directory buckets. * **ObjectArn** *(string) --* The Amazon Resource Name (ARN) for a manifest object. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **ObjectVersionId** *(string) --* The optional version ID to identify a specific version of the manifest object. * **ETag** *(string) --* The ETag for the specified manifest object. * **Operation** *(dict) --* The operation that the specified job is configured to run on the objects listed in the manifest. * **LambdaInvoke** *(dict) --* Directs the specified job to invoke an Lambda function on every object in the manifest. * **FunctionArn** *(string) --* The Amazon Resource Name (ARN) for the Lambda function that the specified job will invoke on every object in the manifest. * **InvocationSchemaVersion** *(string) --* Specifies the schema version for the payload that Batch Operations sends when invoking an Lambda function. Version "1.0" is the default. Version "2.0" is required when you use Batch Operations to invoke Lambda functions that act on directory buckets, or if you need to specify "UserArguments". For more information, see Automate object processing in Amazon S3 directory buckets with S3 Batch Operations and Lambda in the *Amazon Web Services Storage Blog*. Warning: Ensure that your Lambda function code expects "InvocationSchemaVersion" **2.0** and uses bucket name rather than bucket ARN. If the "InvocationSchemaVersion" does not match what your Lambda function expects, your function might not work as expected. Note: **Directory buckets** - To initiate Amazon Web Services Lambda function to perform custom actions on objects in directory buckets, you must specify "2.0". * **UserArguments** *(dict) --* Key-value pairs that are passed in the payload that Batch Operations sends when invoking an Lambda function. You must specify "InvocationSchemaVersion" **2.0** for "LambdaInvoke" operations that include "UserArguments". For more information, see Automate object processing in Amazon S3 directory buckets with S3 Batch Operations and Lambda in the *Amazon Web Services Storage Blog*. * *(string) --* * *(string) --* * **S3PutObjectCopy** *(dict) --* Directs the specified job to run a PUT Copy object call on every object in the manifest. * **TargetResource** *(string) --* Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation. * **General purpose buckets** - For example, to copy objects to a general purpose bucket named "destinationBucket", set the "TargetResource" property to "arn:aws:s3:::destinationBucket". * **Directory buckets** - For example, to copy objects to a directory bucket named "destinationBucket" in the Availability Zone identified by the AZ ID "usw2-az1", set the "TargetResource" property to "a rn:aws:s3express:region:account_id:/bucket/destinat ion_bucket_base_name--usw2-az1--x-s3". A directory bucket as a destination bucket can be in Availability Zone or Local Zone. Note: Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP "400 Bad Request" error with the error code "InvalidRequest". * **CannedAccessControlList** *(string) --* Note: This functionality is not supported by directory buckets. * **AccessControlGrants** *(list) --* Note: This functionality is not supported by directory buckets. * *(dict) --* * **Grantee** *(dict) --* * **TypeIdentifier** *(string) --* * **Identifier** *(string) --* * **DisplayName** *(string) --* * **Permission** *(string) --* * **MetadataDirective** *(string) --* * **ModifiedSinceConstraint** *(datetime) --* * **NewObjectMetadata** *(dict) --* If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects. * **CacheControl** *(string) --* * **ContentDisposition** *(string) --* * **ContentEncoding** *(string) --* * **ContentLanguage** *(string) --* * **UserMetadata** *(dict) --* * *(string) --* * *(string) --* * **ContentLength** *(integer) --* *This member has been deprecated.* * **ContentMD5** *(string) --* *This member has been deprecated.* * **ContentType** *(string) --* * **HttpExpiresDate** *(datetime) --* * **RequesterCharged** *(boolean) --* *This member has been deprecated.* * **SSEAlgorithm** *(string) --* The server-side encryption algorithm used when storing objects in Amazon S3. **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "KMS"). For more information, see Protecting data with server- side encryption in the *Amazon S3 User Guide*. For the Copy operation in Batch Operations, see S3CopyObjectOperation. * **NewObjectTagging** *(list) --* Specifies a list of tags to add to the destination objects after they are copied. If "NewObjectTagging" is not specified, the tags of the source objects are copied to destination objects by default. Note: **Directory buckets** - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the "NewObjectTagging" field to prevent copying the source object tags to the directory bucket. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **RedirectLocation** *(string) --* If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, "x-amz-website-redirect-location". Allows webpage redirects if the object copy is accessed through a website endpoint. Note: This functionality is not supported by directory buckets. * **RequesterPays** *(boolean) --* Note: This functionality is not supported by directory buckets. * **StorageClass** *(string) --* Specify the storage class for the destination objects in a "Copy" operation. Note: **Directory buckets** - This functionality is not supported by directory buckets. * **UnModifiedSinceConstraint** *(datetime) --* * **SSEAwsKmsKeyId** *(string) --* Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. Note: **Directory buckets** - If you specify "SSEAlgorithm" with "KMS", you must specify the "SSEAwsKmsKeyId" parameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP "400 Bad Request" error. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key ( "aws/s3") isn't supported. Your SSE- KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration. * **TargetKeyPrefix** *(string) --* Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named "Folder1" in the destination bucket, set the "TargetKeyPrefix" property to "Folder1". * **ObjectLockLegalHoldStatus** *(string) --* The legal hold status to be applied to all objects in the Batch Operations job. Note: This functionality is not supported by directory buckets. * **ObjectLockMode** *(string) --* The retention mode to be applied to all objects in the Batch Operations job. Note: This functionality is not supported by directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date when the applied object retention configuration expires on all objects in the Batch Operations job. Note: This functionality is not supported by directory buckets. * **BucketKeyEnabled** *(boolean) --* Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with an *Copy* action doesn’t affect *bucket-level* settings for S3 Bucket Key. Note: **Directory buckets** - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **ChecksumAlgorithm** *(string) --* Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **S3PutObjectAcl** *(dict) --* Directs the specified job to run a "PutObjectAcl" call on every object in the manifest. Note: This functionality is not supported by directory buckets. * **AccessControlPolicy** *(dict) --* * **AccessControlList** *(dict) --* * **Owner** *(dict) --* * **ID** *(string) --* * **DisplayName** *(string) --* * **Grants** *(list) --* * *(dict) --* * **Grantee** *(dict) --* * **TypeIdentifier** *(string) --* * **Identifier** *(string) --* * **DisplayName** *(string) --* * **Permission** *(string) --* * **CannedAccessControlList** *(string) --* * **S3PutObjectTagging** *(dict) --* Directs the specified job to run a PUT Object tagging call on every object in the manifest. Note: This functionality is not supported by directory buckets. * **TagSet** *(list) --* * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **S3DeleteObjectTagging** *(dict) --* Directs the specified job to execute a DELETE Object tagging call on every object in the manifest. Note: This functionality is not supported by directory buckets. * **S3InitiateRestoreObject** *(dict) --* Directs the specified job to initiate restore requests for every archived object in the manifest. Note: This functionality is not supported by directory buckets. * **ExpirationInDays** *(integer) --* This argument specifies how long the S3 Glacier or S3 Glacier Deep Archive object remains available in Amazon S3. S3 Initiate Restore Object jobs that target S3 Glacier and S3 Glacier Deep Archive objects require "ExpirationInDays" set to 1 or greater. Conversely, do *not* set "ExpirationInDays" when creating S3 Initiate Restore Object jobs that target S3 Intelligent-Tiering Archive Access and Deep Archive Access tier objects. Objects in S3 Intelligent-Tiering archive access tiers are not subject to restore expiry, so specifying "ExpirationInDays" results in restore request failure. S3 Batch Operations jobs can operate either on S3 Glacier and S3 Glacier Deep Archive storage class objects or on S3 Intelligent-Tiering Archive Access and Deep Archive Access storage tier objects, but not both types in the same job. If you need to restore objects of both types you *must* create separate Batch Operations jobs. * **GlacierJobTier** *(string) --* S3 Batch Operations supports "STANDARD" and "BULK" retrieval tiers, but not the "EXPEDITED" retrieval tier. * **S3PutObjectLegalHold** *(dict) --* Contains the configuration for an S3 Object Lock legal hold operation that an S3 Batch Operations job passes to every object to the underlying "PutObjectLegalHold" API operation. For more information, see Using S3 Object Lock legal hold with S3 Batch Operations in the *Amazon S3 User Guide*. Note: This functionality is not supported by directory buckets. * **LegalHold** *(dict) --* Contains the Object Lock legal hold status to be applied to all objects in the Batch Operations job. * **Status** *(string) --* The Object Lock legal hold status to be applied to all objects in the Batch Operations job. * **S3PutObjectRetention** *(dict) --* Contains the configuration parameters for the Object Lock retention action for an S3 Batch Operations job. Batch Operations passes every object to the underlying "PutObjectRetention" API operation. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the *Amazon S3 User Guide*. Note: This functionality is not supported by directory buckets. * **BypassGovernanceRetention** *(boolean) --* Indicates if the action should be applied to objects in the Batch Operations job even if they have Object Lock "GOVERNANCE" type in place. * **Retention** *(dict) --* Contains the Object Lock retention mode to be applied to all objects in the Batch Operations job. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the *Amazon S3 User Guide*. * **RetainUntilDate** *(datetime) --* The date when the applied Object Lock retention will expire on all objects set by the Batch Operations job. * **Mode** *(string) --* The Object Lock retention mode to be applied to all objects in the Batch Operations job. * **S3ReplicateObject** *(dict) --* Directs the specified job to invoke "ReplicateObject" on every object in the job's manifest. Note: This functionality is not supported by directory buckets. * **Priority** *(integer) --* The priority of the specified job. * **ProgressSummary** *(dict) --* Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and the number of tasks that failed. * **TotalNumberOfTasks** *(integer) --* * **NumberOfTasksSucceeded** *(integer) --* * **NumberOfTasksFailed** *(integer) --* * **Timers** *(dict) --* The JobTimers attribute of a job's progress summary. * **ElapsedTimeInActiveSeconds** *(integer) --* Indicates the elapsed time in seconds the job has been in the Active job state. * **StatusUpdateReason** *(string) --* The reason for updating the job. * **FailureReasons** *(list) --* If the specified job failed, this field contains information describing the failure. * *(dict) --* If this job failed, this element indicates why the job failed. * **FailureCode** *(string) --* The failure code, if any, for the specified job. * **FailureReason** *(string) --* The failure reason, if any, for the specified job. * **Report** *(dict) --* Contains the configuration information for the job- completion report if you requested one in the "Create Job" request. * **Bucket** *(string) --* The Amazon Resource Name (ARN) for the bucket where specified job-completion report will be stored. Note: **Directory buckets** - Directory buckets aren't supported as a location for Batch Operations to store job completion reports. * **Format** *(string) --* The format of the specified job-completion report. * **Enabled** *(boolean) --* Indicates whether the specified job will generate a job- completion report. * **Prefix** *(string) --* An optional prefix to describe where in the specified bucket the job-completion report will be stored. Amazon S3 stores the job-completion report at "/job -/report.json". * **ReportScope** *(string) --* Indicates whether the job-completion report will include details of all tasks or only failed tasks. * **CreationTime** *(datetime) --* A timestamp indicating when this job was created. * **TerminationDate** *(datetime) --* A timestamp indicating when this job terminated. A job's termination date is the date and time when it succeeded, failed, or was canceled. * **RoleArn** *(string) --* The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role assigned to run the tasks for this job. * **SuspendedDate** *(datetime) --* The timestamp when this job was suspended, if it has been suspended. * **SuspendedCause** *(string) --* The reason why the specified job was suspended. A job is only suspended if you create it through the Amazon S3 console. When you create the job, it enters the "Suspended" state to await confirmation before running. After you confirm the job, it automatically exits the "Suspended" state. * **ManifestGenerator** *(dict) --* The manifest generator that was used to generate a job manifest for this job. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "S3JobManifestGenerator". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **S3JobManifestGenerator** *(dict) --* The S3 job ManifestGenerator's configuration details. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that owns the bucket the generated manifest is written to. If provided the generated manifest bucket's owner Amazon Web Services account ID must match this value, else the job fails. * **SourceBucket** *(string) --* The ARN of the source bucket used by the ManifestGenerator. Note: **Directory buckets** - Directory buckets aren't supported as the source buckets used by "S3JobManifestGenerator" to generate the job manifest. * **ManifestOutputLocation** *(dict) --* Specifies the location the generated manifest will be written to. Manifests can't be written to directory buckets. For more information, see Directory buckets. * **ExpectedManifestBucketOwner** *(string) --* The Account ID that owns the bucket the generated manifest is written to. * **Bucket** *(string) --* The bucket ARN the generated manifest should be written to. Note: **Directory buckets** - Directory buckets aren't supported as the buckets to store the generated manifest. * **ManifestPrefix** *(string) --* Prefix identifying one or more objects to which the manifest applies. * **ManifestEncryption** *(dict) --* Specifies what encryption should be used when the generated manifest objects are written. * **SSES3** *(dict) --* Specifies the use of SSE-S3 to encrypt generated manifest objects. * **SSEKMS** *(dict) --* Configuration details on how SSE-KMS is used to encrypt generated manifest objects. * **KeyId** *(string) --* Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric encryption customer managed key to use for encrypting generated manifest objects. * **ManifestFormat** *(string) --* The format of the generated manifest. * **Filter** *(dict) --* Specifies rules the S3JobManifestGenerator should use to decide whether an object in the source bucket should or should not be included in the generated job manifest. * **EligibleForReplication** *(boolean) --* Include objects in the generated manifest only if they are eligible for replication according to the Replication configuration on the source bucket. * **CreatedAfter** *(datetime) --* If provided, the generated manifest includes only source bucket objects that were created after this time. * **CreatedBefore** *(datetime) --* If provided, the generated manifest includes only source bucket objects that were created before this time. * **ObjectReplicationStatuses** *(list) --* If provided, the generated manifest includes only source bucket objects that have one of the specified Replication statuses. * *(string) --* * **KeyNameConstraint** *(dict) --* If provided, the generated manifest includes only source bucket objects whose object keys match the string constraints specified for "MatchAnyPrefix", "MatchAnySuffix", and "MatchAnySubstring". * **MatchAnyPrefix** *(list) --* If provided, the generated manifest includes objects where the specified string appears at the start of the object key string. Each KeyNameConstraint filter accepts an array of strings with a length of 1 string. * *(string) --* * **MatchAnySuffix** *(list) --* If provided, the generated manifest includes objects where the specified string appears at the end of the object key string. Each KeyNameConstraint filter accepts an array of strings with a length of 1 string. * *(string) --* * **MatchAnySubstring** *(list) --* If provided, the generated manifest includes objects where the specified string appears anywhere within the object key string. Each KeyNameConstraint filter accepts an array of strings with a length of 1 string. * *(string) --* * **ObjectSizeGreaterThanBytes** *(integer) --* If provided, the generated manifest includes only source bucket objects whose file size is greater than the specified number of bytes. * **ObjectSizeLessThanBytes** *(integer) --* If provided, the generated manifest includes only source bucket objects whose file size is less than the specified number of bytes. * **MatchAnyStorageClass** *(list) --* If provided, the generated manifest includes only source bucket objects that are stored with the specified storage class. * *(string) --* * **EnableManifestOutput** *(boolean) --* Determines whether or not to write the job's generated manifest to a bucket. * **GeneratedManifestDescriptor** *(dict) --* The attribute of the JobDescriptor containing details about the job's generated manifest. * **Format** *(string) --* The format of the generated manifest. * **Location** *(dict) --* Contains the information required to locate a manifest object. Manifests can't be imported from directory buckets. For more information, see Directory buckets. * **ObjectArn** *(string) --* The Amazon Resource Name (ARN) for a manifest object. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **ObjectVersionId** *(string) --* The optional version ID to identify a specific version of the manifest object. * **ETag** *(string) --* The ETag for the specified manifest object. **Exceptions** * "S3Control.Client.exceptions.BadRequestException" * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.NotFoundException" * "S3Control.Client.exceptions.InternalServiceException" S3Control / Client / create_access_point create_access_point ******************* S3Control.Client.create_access_point(**kwargs) Creates an access point and associates it to a specified bucket. For more information, see Managing access to shared datasets with access points or Managing access to shared datasets in directory buckets with access points in the *Amazon S3 User Guide*. To create an access point and attach it to a volume on an Amazon FSx file system, see CreateAndAttachS3AccessPoint in the *Amazon FSx API Reference*. Note: S3 on Outposts only supports VPC-style access points.For more information, see Accessing Amazon S3 on Outposts using virtual private cloud (VPC) only access points in the *Amazon S3 User Guide*. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "CreateAccessPoint": * GetAccessPoint * DeleteAccessPoint * ListAccessPoints * ListAccessPointsForDirectoryBuckets See also: AWS API Documentation **Request Syntax** response = client.create_access_point( AccountId='string', Name='string', Bucket='string', VpcConfiguration={ 'VpcId': 'string' }, PublicAccessBlockConfiguration={ 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, BucketAccountId='string', Scope={ 'Prefixes': [ 'string', ], 'Permissions': [ 'GetObject'|'GetObjectAttributes'|'ListMultipartUploadParts'|'ListBucket'|'ListBucketMultipartUploads'|'PutObject'|'DeleteObject'|'AbortMultipartUpload', ] }, Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the account that owns the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name you want to assign to this access point. For directory buckets, the access point name must consist of a base name that you provide and suffix that includes the "ZoneID" (Amazon Web Services Availability Zone or Local Zone) of your bucket location, followed by "--xa-s3". For more information, see Managing access to shared datasets in directory buckets with access points in the *Amazon S3 User Guide*. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket that you want to associate this access point with. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. * **VpcConfiguration** (*dict*) -- If you include this field, Amazon S3 restricts access to this access point to requests from the specified virtual private cloud (VPC). Note: This is required for creating an access point for Amazon S3 on Outposts buckets. * **VpcId** *(string) --* **[REQUIRED]** If this field is specified, this access point will only allow connections from the specified VPC ID. * **PublicAccessBlockConfiguration** (*dict*) -- The "PublicAccessBlock" configuration that you want to apply to the access point. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non-public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **BucketAccountId** (*string*) -- The Amazon Web Services account ID associated with the S3 bucket associated with this access point. For same account access point when your bucket and access point belong to the same account owner, the "BucketAccountId" is not required. For cross-account access point when your bucket and access point are not in the same account, the "BucketAccountId" is required. * **Scope** (*dict*) -- For directory buckets, you can filter access control to specific prefixes, API operations, or a combination of both. For more information, see Managing access to shared datasets in directory buckets with access points in the *Amazon S3 User Guide*. Note: Scope is only supported for access points attached to directory buckets. * **Prefixes** *(list) --* You can specify any amount of prefixes, but the total length of characters of all prefixes must be less than 256 bytes in size. * *(string) --* * **Permissions** *(list) --* You can include one or more API operations as permissions. * *(string) --* * **Tags** (*list*) -- An array of tags that you can apply to an access point. Tags are key-value pairs of metadata used to control access to your access points. For more information about tags, see Using tags with Amazon S3. For information about tagging access points, see Using tags for attribute-based access control (ABAC). * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* **[REQUIRED]** The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* **[REQUIRED]** The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. Return type: dict Returns: **Response Syntax** { 'AccessPointArn': 'string', 'Alias': 'string' } **Response Structure** * *(dict) --* * **AccessPointArn** *(string) --* The ARN of the access point. Note: This is only supported by Amazon S3 on Outposts. * **Alias** *(string) --* The name or alias of the access point. S3Control / Client / get_job_tagging get_job_tagging *************** S3Control.Client.get_job_tagging(**kwargs) Returns the tags on an S3 Batch Operations job. Permissions To use the "GetJobTagging" operation, you must have permission to perform the "s3:GetJobTagging" action. For more information, see Controlling access and labeling jobs using tags in the *Amazon S3 User Guide*. Related actions include: * CreateJob * PutJobTagging * DeleteJobTagging See also: AWS API Documentation **Request Syntax** response = client.get_job_tagging( AccountId='string', JobId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobId** (*string*) -- **[REQUIRED]** The ID for the S3 Batch Operations job whose tags you want to retrieve. Return type: dict Returns: **Response Syntax** { 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **Tags** *(list) --* The set of tags associated with the S3 Batch Operations job. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag **Exceptions** * "S3Control.Client.exceptions.InternalServiceException" * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.NotFoundException" S3Control / Client / create_bucket create_bucket ************* S3Control.Client.create_bucket(**kwargs) Note: This action creates an Amazon S3 on Outposts bucket. To create an S3 bucket, see Create Bucket in the *Amazon S3 API Reference*. Creates a new Outposts bucket. By creating the bucket, you become the bucket owner. To create an Outposts bucket, you must have S3 on Outposts. For more information, see Using Amazon S3 on Outposts in *Amazon S3 User Guide*. Not every string is an acceptable bucket name. For information on bucket naming restrictions, see Working with Amazon S3 Buckets. S3 on Outposts buckets support: * Tags * LifecycleConfigurations for deleting expired objects For a complete list of restrictions and Amazon S3 feature limitations on S3 on Outposts, see Amazon S3 on Outposts Restrictions and Limitations. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and "x-amz- outpost-id" in your API request, see the Examples section. The following actions are related to "CreateBucket" for Amazon S3 on Outposts: * PutObject * GetBucket * DeleteBucket * CreateAccessPoint * PutAccessPointPolicy See also: AWS API Documentation **Request Syntax** response = client.create_bucket( ACL='private'|'public-read'|'public-read-write'|'authenticated-read', Bucket='string', CreateBucketConfiguration={ 'LocationConstraint': 'EU'|'eu-west-1'|'us-west-1'|'us-west-2'|'ap-south-1'|'ap-southeast-1'|'ap-southeast-2'|'ap-northeast-1'|'sa-east-1'|'cn-north-1'|'eu-central-1' }, GrantFullControl='string', GrantRead='string', GrantReadACP='string', GrantWrite='string', GrantWriteACP='string', ObjectLockEnabledForBucket=True|False, OutpostId='string' ) Parameters: * **ACL** (*string*) -- The canned ACL to apply to the bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **Bucket** (*string*) -- **[REQUIRED]** The name of the bucket. * **CreateBucketConfiguration** (*dict*) -- The configuration information for the bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **LocationConstraint** *(string) --* Specifies the Region where the bucket will be created. If you are creating a bucket on the US East (N. Virginia) Region (us-east-1), you do not need to specify the location. Note: This is not supported by Amazon S3 on Outposts buckets. * **GrantFullControl** (*string*) -- Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **GrantRead** (*string*) -- Allows grantee to list the objects in the bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **GrantReadACP** (*string*) -- Allows grantee to read the bucket ACL. Note: This is not supported by Amazon S3 on Outposts buckets. * **GrantWrite** (*string*) -- Allows grantee to create, overwrite, and delete any object in the bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **GrantWriteACP** (*string*) -- Allows grantee to write the ACL for the applicable bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **ObjectLockEnabledForBucket** (*boolean*) -- Specifies whether you want S3 Object Lock to be enabled for the new bucket. Note: This is not supported by Amazon S3 on Outposts buckets. * **OutpostId** (*string*) -- The ID of the Outposts where the bucket is being created. Note: This ID is required by Amazon S3 on Outposts buckets. Return type: dict Returns: **Response Syntax** { 'Location': 'string', 'BucketArn': 'string' } **Response Structure** * *(dict) --* * **Location** *(string) --* The location of the bucket. * **BucketArn** *(string) --* The Amazon Resource Name (ARN) of the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us-west-2", use the URL encoding of "arn:aws:s3-outposts:us-west-2:123456789012:outpost/my- outpost/bucket/reports". The value must be URL encoded. **Exceptions** * "S3Control.Client.exceptions.BucketAlreadyExists" * "S3Control.Client.exceptions.BucketAlreadyOwnedByYou" S3Control / Client / put_access_grants_instance_resource_policy put_access_grants_instance_resource_policy ****************************************** S3Control.Client.put_access_grants_instance_resource_policy(**kwargs) Updates the resource policy of the S3 Access Grants instance. Permissions You must have the "s3:PutAccessGrantsInstanceResourcePolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_access_grants_instance_resource_policy( AccountId='string', Policy='string', Organization='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **Policy** (*string*) -- **[REQUIRED]** The resource policy of the S3 Access Grants instance that you are updating. * **Organization** (*string*) -- The Organization of the resource policy of the S3 Access Grants instance. Return type: dict Returns: **Response Syntax** { 'Policy': 'string', 'Organization': 'string', 'CreatedAt': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **Policy** *(string) --* The updated resource policy of the S3 Access Grants instance. * **Organization** *(string) --* The Organization of the resource policy of the S3 Access Grants instance. * **CreatedAt** *(datetime) --* The date and time when you created the S3 Access Grants instance resource policy. S3Control / Client / delete_bucket delete_bucket ************* S3Control.Client.delete_bucket(**kwargs) Note: This action deletes an Amazon S3 on Outposts bucket. To delete an S3 bucket, see DeleteBucket in the *Amazon S3 API Reference*. Deletes the Amazon S3 on Outposts bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted. For more information, see Using Amazon S3 on Outposts in *Amazon S3 User Guide*. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. **Related Resources** * CreateBucket * GetBucket * DeleteObject See also: AWS API Documentation **Request Syntax** response = client.delete_bucket( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID that owns the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket being deleted. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Returns: None S3Control / Client / create_job create_job ********** S3Control.Client.create_job(**kwargs) This operation creates an S3 Batch Operations job. You can use S3 Batch Operations to perform large-scale batch actions on Amazon S3 objects. Batch Operations can run a single action on lists of Amazon S3 objects that you specify. For more information, see S3 Batch Operations in the *Amazon S3 User Guide*. Permissions For information about permissions required to use the Batch Operations, see Granting permissions for S3 Batch Operations in the *Amazon S3 User Guide*. Related actions include: * DescribeJob * ListJobs * UpdateJobPriority * UpdateJobStatus * JobOperation See also: AWS API Documentation **Request Syntax** response = client.create_job( AccountId='string', ConfirmationRequired=True|False, Operation={ 'LambdaInvoke': { 'FunctionArn': 'string', 'InvocationSchemaVersion': 'string', 'UserArguments': { 'string': 'string' } }, 'S3PutObjectCopy': { 'TargetResource': 'string', 'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control', 'AccessControlGrants': [ { 'Grantee': { 'TypeIdentifier': 'id'|'emailAddress'|'uri', 'Identifier': 'string', 'DisplayName': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP' }, ], 'MetadataDirective': 'COPY'|'REPLACE', 'ModifiedSinceConstraint': datetime(2015, 1, 1), 'NewObjectMetadata': { 'CacheControl': 'string', 'ContentDisposition': 'string', 'ContentEncoding': 'string', 'ContentLanguage': 'string', 'UserMetadata': { 'string': 'string' }, 'ContentLength': 123, 'ContentMD5': 'string', 'ContentType': 'string', 'HttpExpiresDate': datetime(2015, 1, 1), 'RequesterCharged': True|False, 'SSEAlgorithm': 'AES256'|'KMS' }, 'NewObjectTagging': [ { 'Key': 'string', 'Value': 'string' }, ], 'RedirectLocation': 'string', 'RequesterPays': True|False, 'StorageClass': 'STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'GLACIER'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', 'UnModifiedSinceConstraint': datetime(2015, 1, 1), 'SSEAwsKmsKeyId': 'string', 'TargetKeyPrefix': 'string', 'ObjectLockLegalHoldStatus': 'OFF'|'ON', 'ObjectLockMode': 'COMPLIANCE'|'GOVERNANCE', 'ObjectLockRetainUntilDate': datetime(2015, 1, 1), 'BucketKeyEnabled': True|False, 'ChecksumAlgorithm': 'CRC32'|'CRC32C'|'SHA1'|'SHA256'|'CRC64NVME' }, 'S3PutObjectAcl': { 'AccessControlPolicy': { 'AccessControlList': { 'Owner': { 'ID': 'string', 'DisplayName': 'string' }, 'Grants': [ { 'Grantee': { 'TypeIdentifier': 'id'|'emailAddress'|'uri', 'Identifier': 'string', 'DisplayName': 'string' }, 'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP' }, ] }, 'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control' } }, 'S3PutObjectTagging': { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] }, 'S3DeleteObjectTagging': {} , 'S3InitiateRestoreObject': { 'ExpirationInDays': 123, 'GlacierJobTier': 'BULK'|'STANDARD' }, 'S3PutObjectLegalHold': { 'LegalHold': { 'Status': 'OFF'|'ON' } }, 'S3PutObjectRetention': { 'BypassGovernanceRetention': True|False, 'Retention': { 'RetainUntilDate': datetime(2015, 1, 1), 'Mode': 'COMPLIANCE'|'GOVERNANCE' } }, 'S3ReplicateObject': {} }, Report={ 'Bucket': 'string', 'Format': 'Report_CSV_20180820', 'Enabled': True|False, 'Prefix': 'string', 'ReportScope': 'AllTasks'|'FailedTasksOnly' }, ClientRequestToken='string', Manifest={ 'Spec': { 'Format': 'S3BatchOperations_CSV_20180820'|'S3InventoryReport_CSV_20161130', 'Fields': [ 'Ignore'|'Bucket'|'Key'|'VersionId', ] }, 'Location': { 'ObjectArn': 'string', 'ObjectVersionId': 'string', 'ETag': 'string' } }, Description='string', Priority=123, RoleArn='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ], ManifestGenerator={ 'S3JobManifestGenerator': { 'ExpectedBucketOwner': 'string', 'SourceBucket': 'string', 'ManifestOutputLocation': { 'ExpectedManifestBucketOwner': 'string', 'Bucket': 'string', 'ManifestPrefix': 'string', 'ManifestEncryption': { 'SSES3': {} , 'SSEKMS': { 'KeyId': 'string' } }, 'ManifestFormat': 'S3InventoryReport_CSV_20211130' }, 'Filter': { 'EligibleForReplication': True|False, 'CreatedAfter': datetime(2015, 1, 1), 'CreatedBefore': datetime(2015, 1, 1), 'ObjectReplicationStatuses': [ 'COMPLETED'|'FAILED'|'REPLICA'|'NONE', ], 'KeyNameConstraint': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnySubstring': [ 'string', ] }, 'ObjectSizeGreaterThanBytes': 123, 'ObjectSizeLessThanBytes': 123, 'MatchAnyStorageClass': [ 'STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'GLACIER'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR', ] }, 'EnableManifestOutput': True|False } } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that creates the job. * **ConfirmationRequired** (*boolean*) -- Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console. * **Operation** (*dict*) -- **[REQUIRED]** The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see Operations in the *Amazon S3 User Guide*. * **LambdaInvoke** *(dict) --* Directs the specified job to invoke an Lambda function on every object in the manifest. * **FunctionArn** *(string) --* The Amazon Resource Name (ARN) for the Lambda function that the specified job will invoke on every object in the manifest. * **InvocationSchemaVersion** *(string) --* Specifies the schema version for the payload that Batch Operations sends when invoking an Lambda function. Version "1.0" is the default. Version "2.0" is required when you use Batch Operations to invoke Lambda functions that act on directory buckets, or if you need to specify "UserArguments". For more information, see Automate object processing in Amazon S3 directory buckets with S3 Batch Operations and Lambda in the *Amazon Web Services Storage Blog*. Warning: Ensure that your Lambda function code expects "InvocationSchemaVersion" **2.0** and uses bucket name rather than bucket ARN. If the "InvocationSchemaVersion" does not match what your Lambda function expects, your function might not work as expected. Note: **Directory buckets** - To initiate Amazon Web Services Lambda function to perform custom actions on objects in directory buckets, you must specify "2.0". * **UserArguments** *(dict) --* Key-value pairs that are passed in the payload that Batch Operations sends when invoking an Lambda function. You must specify "InvocationSchemaVersion" **2.0** for "LambdaInvoke" operations that include "UserArguments". For more information, see Automate object processing in Amazon S3 directory buckets with S3 Batch Operations and Lambda in the *Amazon Web Services Storage Blog*. * *(string) --* * *(string) --* * **S3PutObjectCopy** *(dict) --* Directs the specified job to run a PUT Copy object call on every object in the manifest. * **TargetResource** *(string) --* Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation. * **General purpose buckets** - For example, to copy objects to a general purpose bucket named "destinationBucket", set the "TargetResource" property to "arn:aws:s3:::destinationBucket". * **Directory buckets** - For example, to copy objects to a directory bucket named "destinationBucket" in the Availability Zone identified by the AZ ID "usw2-az1", set the "TargetResource" property to "arn:aws:s3express :region:account_id:/bucket/destination_bucket_base_name --usw2-az1--x-s3". A directory bucket as a destination bucket can be in Availability Zone or Local Zone. Note: Copying objects across different Amazon Web Services Regions isn't supported when the source or destination bucket is in Amazon Web Services Local Zones. The source and destination buckets must have the same parent Amazon Web Services Region. Otherwise, you get an HTTP "400 Bad Request" error with the error code "InvalidRequest". * **CannedAccessControlList** *(string) --* Note: This functionality is not supported by directory buckets. * **AccessControlGrants** *(list) --* Note: This functionality is not supported by directory buckets. * *(dict) --* * **Grantee** *(dict) --* * **TypeIdentifier** *(string) --* * **Identifier** *(string) --* * **DisplayName** *(string) --* * **Permission** *(string) --* * **MetadataDirective** *(string) --* * **ModifiedSinceConstraint** *(datetime) --* * **NewObjectMetadata** *(dict) --* If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects. * **CacheControl** *(string) --* * **ContentDisposition** *(string) --* * **ContentEncoding** *(string) --* * **ContentLanguage** *(string) --* * **UserMetadata** *(dict) --* * *(string) --* * *(string) --* * **ContentLength** *(integer) --* *This member has been deprecated.* * **ContentMD5** *(string) --* *This member has been deprecated.* * **ContentType** *(string) --* * **HttpExpiresDate** *(datetime) --* * **RequesterCharged** *(boolean) --* *This member has been deprecated.* * **SSEAlgorithm** *(string) --* The server-side encryption algorithm used when storing objects in Amazon S3. **Directory buckets** - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) ( "AES256") and server-side encryption with KMS keys (SSE-KMS) ( "KMS"). For more information, see Protecting data with server-side encryption in the *Amazon S3 User Guide*. For the Copy operation in Batch Operations, see S3CopyObjectOperation. * **NewObjectTagging** *(list) --* Specifies a list of tags to add to the destination objects after they are copied. If "NewObjectTagging" is not specified, the tags of the source objects are copied to destination objects by default. Note: **Directory buckets** - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the "NewObjectTagging" field to prevent copying the source object tags to the directory bucket. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **RedirectLocation** *(string) --* If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, "x-amz-website-redirect-location". Allows webpage redirects if the object copy is accessed through a website endpoint. Note: This functionality is not supported by directory buckets. * **RequesterPays** *(boolean) --* Note: This functionality is not supported by directory buckets. * **StorageClass** *(string) --* Specify the storage class for the destination objects in a "Copy" operation. Note: **Directory buckets** - This functionality is not supported by directory buckets. * **UnModifiedSinceConstraint** *(datetime) --* * **SSEAwsKmsKeyId** *(string) --* Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID. Note: **Directory buckets** - If you specify "SSEAlgorithm" with "KMS", you must specify the "SSEAwsKmsKeyId" parameter with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP "400 Bad Request" error. The key alias format of the KMS key isn't supported. To encrypt new object copies in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). The Amazon Web Services managed key ( "aws/s3") isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS as the bucket default encryption, you can't override the customer managed key for the bucket's SSE- KMS configuration. Then, when you specify server-side encryption settings for new object copies with SSE-KMS, you must make sure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration. * **TargetKeyPrefix** *(string) --* Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named "Folder1" in the destination bucket, set the "TargetKeyPrefix" property to "Folder1". * **ObjectLockLegalHoldStatus** *(string) --* The legal hold status to be applied to all objects in the Batch Operations job. Note: This functionality is not supported by directory buckets. * **ObjectLockMode** *(string) --* The retention mode to be applied to all objects in the Batch Operations job. Note: This functionality is not supported by directory buckets. * **ObjectLockRetainUntilDate** *(datetime) --* The date when the applied object retention configuration expires on all objects in the Batch Operations job. Note: This functionality is not supported by directory buckets. * **BucketKeyEnabled** *(boolean) --* Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to "true" causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with an *Copy* action doesn’t affect *bucket-level* settings for S3 Bucket Key. Note: **Directory buckets** - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through the Copy operation in Batch Operations. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object. * **ChecksumAlgorithm** *(string) --* Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the *Amazon S3 User Guide*. * **S3PutObjectAcl** *(dict) --* Directs the specified job to run a "PutObjectAcl" call on every object in the manifest. Note: This functionality is not supported by directory buckets. * **AccessControlPolicy** *(dict) --* * **AccessControlList** *(dict) --* * **Owner** *(dict) --* **[REQUIRED]** * **ID** *(string) --* * **DisplayName** *(string) --* * **Grants** *(list) --* * *(dict) --* * **Grantee** *(dict) --* * **TypeIdentifier** *(string) --* * **Identifier** *(string) --* * **DisplayName** *(string) --* * **Permission** *(string) --* * **CannedAccessControlList** *(string) --* * **S3PutObjectTagging** *(dict) --* Directs the specified job to run a PUT Object tagging call on every object in the manifest. Note: This functionality is not supported by directory buckets. * **TagSet** *(list) --* * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **S3DeleteObjectTagging** *(dict) --* Directs the specified job to execute a DELETE Object tagging call on every object in the manifest. Note: This functionality is not supported by directory buckets. * **S3InitiateRestoreObject** *(dict) --* Directs the specified job to initiate restore requests for every archived object in the manifest. Note: This functionality is not supported by directory buckets. * **ExpirationInDays** *(integer) --* This argument specifies how long the S3 Glacier or S3 Glacier Deep Archive object remains available in Amazon S3. S3 Initiate Restore Object jobs that target S3 Glacier and S3 Glacier Deep Archive objects require "ExpirationInDays" set to 1 or greater. Conversely, do *not* set "ExpirationInDays" when creating S3 Initiate Restore Object jobs that target S3 Intelligent-Tiering Archive Access and Deep Archive Access tier objects. Objects in S3 Intelligent-Tiering archive access tiers are not subject to restore expiry, so specifying "ExpirationInDays" results in restore request failure. S3 Batch Operations jobs can operate either on S3 Glacier and S3 Glacier Deep Archive storage class objects or on S3 Intelligent-Tiering Archive Access and Deep Archive Access storage tier objects, but not both types in the same job. If you need to restore objects of both types you *must* create separate Batch Operations jobs. * **GlacierJobTier** *(string) --* S3 Batch Operations supports "STANDARD" and "BULK" retrieval tiers, but not the "EXPEDITED" retrieval tier. * **S3PutObjectLegalHold** *(dict) --* Contains the configuration for an S3 Object Lock legal hold operation that an S3 Batch Operations job passes to every object to the underlying "PutObjectLegalHold" API operation. For more information, see Using S3 Object Lock legal hold with S3 Batch Operations in the *Amazon S3 User Guide*. Note: This functionality is not supported by directory buckets. * **LegalHold** *(dict) --* **[REQUIRED]** Contains the Object Lock legal hold status to be applied to all objects in the Batch Operations job. * **Status** *(string) --* **[REQUIRED]** The Object Lock legal hold status to be applied to all objects in the Batch Operations job. * **S3PutObjectRetention** *(dict) --* Contains the configuration parameters for the Object Lock retention action for an S3 Batch Operations job. Batch Operations passes every object to the underlying "PutObjectRetention" API operation. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the *Amazon S3 User Guide*. Note: This functionality is not supported by directory buckets. * **BypassGovernanceRetention** *(boolean) --* Indicates if the action should be applied to objects in the Batch Operations job even if they have Object Lock "GOVERNANCE" type in place. * **Retention** *(dict) --* **[REQUIRED]** Contains the Object Lock retention mode to be applied to all objects in the Batch Operations job. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the *Amazon S3 User Guide*. * **RetainUntilDate** *(datetime) --* The date when the applied Object Lock retention will expire on all objects set by the Batch Operations job. * **Mode** *(string) --* The Object Lock retention mode to be applied to all objects in the Batch Operations job. * **S3ReplicateObject** *(dict) --* Directs the specified job to invoke "ReplicateObject" on every object in the job's manifest. Note: This functionality is not supported by directory buckets. * **Report** (*dict*) -- **[REQUIRED]** Configuration parameters for the optional job-completion report. * **Bucket** *(string) --* The Amazon Resource Name (ARN) for the bucket where specified job-completion report will be stored. Note: **Directory buckets** - Directory buckets aren't supported as a location for Batch Operations to store job completion reports. * **Format** *(string) --* The format of the specified job-completion report. * **Enabled** *(boolean) --* **[REQUIRED]** Indicates whether the specified job will generate a job- completion report. * **Prefix** *(string) --* An optional prefix to describe where in the specified bucket the job-completion report will be stored. Amazon S3 stores the job-completion report at "/job-/report.json". * **ReportScope** *(string) --* Indicates whether the job-completion report will include details of all tasks or only failed tasks. * **ClientRequestToken** (*string*) -- **[REQUIRED]** An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length. This field is autopopulated if not provided. * **Manifest** (*dict*) -- Configuration parameters for the manifest. * **Spec** *(dict) --* **[REQUIRED]** Describes the format of the specified job's manifest. If the manifest is in CSV format, also describes the columns contained within the manifest. * **Format** *(string) --* **[REQUIRED]** Indicates which of the available formats the specified manifest uses. * **Fields** *(list) --* If the specified manifest object is in the "S3BatchOperations_CSV_20180820" format, this element describes which columns contain the required data. * *(string) --* * **Location** *(dict) --* **[REQUIRED]** Contains the information required to locate the specified job's manifest. Manifests can't be imported from directory buckets. For more information, see Directory buckets. * **ObjectArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) for a manifest object. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **ObjectVersionId** *(string) --* The optional version ID to identify a specific version of the manifest object. * **ETag** *(string) --* **[REQUIRED]** The ETag for the specified manifest object. * **Description** (*string*) -- A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs. * **Priority** (*integer*) -- **[REQUIRED]** The numerical priority for this job. Higher numbers indicate higher priority. * **RoleArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest. * **Tags** (*list*) -- A set of tags to associate with the S3 Batch Operations job. This is an optional parameter. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag * **ManifestGenerator** (*dict*) -- The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "S3JobManifestGenerator". * **S3JobManifestGenerator** *(dict) --* The S3 job ManifestGenerator's configuration details. * **ExpectedBucketOwner** *(string) --* The Amazon Web Services account ID that owns the bucket the generated manifest is written to. If provided the generated manifest bucket's owner Amazon Web Services account ID must match this value, else the job fails. * **SourceBucket** *(string) --* **[REQUIRED]** The ARN of the source bucket used by the ManifestGenerator. Note: **Directory buckets** - Directory buckets aren't supported as the source buckets used by "S3JobManifestGenerator" to generate the job manifest. * **ManifestOutputLocation** *(dict) --* Specifies the location the generated manifest will be written to. Manifests can't be written to directory buckets. For more information, see Directory buckets. * **ExpectedManifestBucketOwner** *(string) --* The Account ID that owns the bucket the generated manifest is written to. * **Bucket** *(string) --* **[REQUIRED]** The bucket ARN the generated manifest should be written to. Note: **Directory buckets** - Directory buckets aren't supported as the buckets to store the generated manifest. * **ManifestPrefix** *(string) --* Prefix identifying one or more objects to which the manifest applies. * **ManifestEncryption** *(dict) --* Specifies what encryption should be used when the generated manifest objects are written. * **SSES3** *(dict) --* Specifies the use of SSE-S3 to encrypt generated manifest objects. * **SSEKMS** *(dict) --* Configuration details on how SSE-KMS is used to encrypt generated manifest objects. * **KeyId** *(string) --* **[REQUIRED]** Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric encryption customer managed key to use for encrypting generated manifest objects. * **ManifestFormat** *(string) --* **[REQUIRED]** The format of the generated manifest. * **Filter** *(dict) --* Specifies rules the S3JobManifestGenerator should use to decide whether an object in the source bucket should or should not be included in the generated job manifest. * **EligibleForReplication** *(boolean) --* Include objects in the generated manifest only if they are eligible for replication according to the Replication configuration on the source bucket. * **CreatedAfter** *(datetime) --* If provided, the generated manifest includes only source bucket objects that were created after this time. * **CreatedBefore** *(datetime) --* If provided, the generated manifest includes only source bucket objects that were created before this time. * **ObjectReplicationStatuses** *(list) --* If provided, the generated manifest includes only source bucket objects that have one of the specified Replication statuses. * *(string) --* * **KeyNameConstraint** *(dict) --* If provided, the generated manifest includes only source bucket objects whose object keys match the string constraints specified for "MatchAnyPrefix", "MatchAnySuffix", and "MatchAnySubstring". * **MatchAnyPrefix** *(list) --* If provided, the generated manifest includes objects where the specified string appears at the start of the object key string. Each KeyNameConstraint filter accepts an array of strings with a length of 1 string. * *(string) --* * **MatchAnySuffix** *(list) --* If provided, the generated manifest includes objects where the specified string appears at the end of the object key string. Each KeyNameConstraint filter accepts an array of strings with a length of 1 string. * *(string) --* * **MatchAnySubstring** *(list) --* If provided, the generated manifest includes objects where the specified string appears anywhere within the object key string. Each KeyNameConstraint filter accepts an array of strings with a length of 1 string. * *(string) --* * **ObjectSizeGreaterThanBytes** *(integer) --* If provided, the generated manifest includes only source bucket objects whose file size is greater than the specified number of bytes. * **ObjectSizeLessThanBytes** *(integer) --* If provided, the generated manifest includes only source bucket objects whose file size is less than the specified number of bytes. * **MatchAnyStorageClass** *(list) --* If provided, the generated manifest includes only source bucket objects that are stored with the specified storage class. * *(string) --* * **EnableManifestOutput** *(boolean) --* **[REQUIRED]** Determines whether or not to write the job's generated manifest to a bucket. Return type: dict Returns: **Response Syntax** { 'JobId': 'string' } **Response Structure** * *(dict) --* * **JobId** *(string) --* The ID for this job. Amazon S3 generates this ID automatically and returns it after a successful "Create Job" request. **Exceptions** * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.BadRequestException" * "S3Control.Client.exceptions.IdempotencyException" * "S3Control.Client.exceptions.InternalServiceException" S3Control / Client / get_access_point_policy_for_object_lambda get_access_point_policy_for_object_lambda ***************************************** S3Control.Client.get_access_point_policy_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Returns the resource policy for an Object Lambda Access Point. The following actions are related to "GetAccessPointPolicyForObjectLambda": * DeleteAccessPointPolicyForObjectLambda * PutAccessPointPolicyForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.get_access_point_policy_for_object_lambda( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point. Return type: dict Returns: **Response Syntax** { 'Policy': 'string' } **Response Structure** * *(dict) --* * **Policy** *(string) --* Object Lambda Access Point resource policy document. S3Control / Client / delete_access_point_policy_for_object_lambda delete_access_point_policy_for_object_lambda ******************************************** S3Control.Client.delete_access_point_policy_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Removes the resource policy for an Object Lambda Access Point. The following actions are related to "DeleteAccessPointPolicyForObjectLambda": * GetAccessPointPolicyForObjectLambda * PutAccessPointPolicyForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.delete_access_point_policy_for_object_lambda( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point you want to delete the policy for. Returns: None S3Control / Client / delete_storage_lens_configuration_tagging delete_storage_lens_configuration_tagging ***************************************** S3Control.Client.delete_storage_lens_configuration_tagging(**kwargs) Note: This operation is not supported by directory buckets. Deletes the Amazon S3 Storage Lens configuration tags. For more information about S3 Storage Lens, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:DeleteStorageLensConfigurationTagging" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.delete_storage_lens_configuration_tagging( ConfigId='string', AccountId='string' ) Parameters: * **ConfigId** (*string*) -- **[REQUIRED]** The ID of the S3 Storage Lens configuration. * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* S3Control / Client / get_bucket_lifecycle_configuration get_bucket_lifecycle_configuration ********************************** S3Control.Client.get_bucket_lifecycle_configuration(**kwargs) Note: This action gets an Amazon S3 on Outposts bucket's lifecycle configuration. To get an S3 bucket's lifecycle configuration, see GetBucketLifecycleConfiguration in the *Amazon S3 API Reference*. Returns the lifecycle configuration information set on the Outposts bucket. For more information, see Using Amazon S3 on Outposts and for information about lifecycle configuration, see Object Lifecycle Management in *Amazon S3 User Guide*. To use this action, you must have permission to perform the "s3-outposts:GetLifecycleConfiguration" action. The Outposts bucket owner has this permission, by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. "GetBucketLifecycleConfiguration" has the following special error: * Error code: "NoSuchLifecycleConfiguration" * Description: The lifecycle configuration does not exist. * HTTP Status Code: 404 Not Found * SOAP Fault Code Prefix: Client The following actions are related to "GetBucketLifecycleConfiguration": * PutBucketLifecycleConfiguration * DeleteBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.get_bucket_lifecycle_configuration( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'Rules': [ { 'Expiration': { 'Date': datetime(2015, 1, 1), 'Days': 123, 'ExpiredObjectDeleteMarker': True|False }, 'ID': 'string', 'Filter': { 'Prefix': 'string', 'Tag': { 'Key': 'string', 'Value': 'string' }, 'And': { 'Prefix': 'string', 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ], 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 }, 'ObjectSizeGreaterThan': 123, 'ObjectSizeLessThan': 123 }, 'Status': 'Enabled'|'Disabled', 'Transitions': [ { 'Date': datetime(2015, 1, 1), 'Days': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE' }, ], 'NoncurrentVersionTransitions': [ { 'NoncurrentDays': 123, 'StorageClass': 'GLACIER'|'STANDARD_IA'|'ONEZONE_IA'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE' }, ], 'NoncurrentVersionExpiration': { 'NoncurrentDays': 123, 'NewerNoncurrentVersions': 123 }, 'AbortIncompleteMultipartUpload': { 'DaysAfterInitiation': 123 } }, ] } **Response Structure** * *(dict) --* * **Rules** *(list) --* Container for the lifecycle rule of the Outposts bucket. * *(dict) --* The container for the Outposts bucket lifecycle rule. * **Expiration** *(dict) --* Specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. * **Date** *(datetime) --* Indicates at what date the object is to be 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. * **ExpiredObjectDeleteMarker** *(boolean) --* Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired. If set to false, the policy takes no action. This cannot be specified with Days or Date in a Lifecycle Expiration Policy. To learn more about delete markers, see Working with delete markers. * **ID** *(string) --* Unique identifier for the rule. The value cannot be longer than 255 characters. * **Filter** *(dict) --* The container for the filter of lifecycle rule. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. Warning: When you're using XML requests, you must replace special characters (such as carriage returns) in object keys with their equivalent XML entity codes. For more information, see XML-related object key constraints in the *Amazon S3 User Guide*. * **Tag** *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **And** *(dict) --* The container for the "AND" condition for the lifecycle rule. * **Prefix** *(string) --* Prefix identifying one or more objects to which the rule applies. * **Tags** *(list) --* All of these tags must exist in the object's tag set in order for the rule to apply. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **ObjectSizeGreaterThan** *(integer) --* The non-inclusive minimum object size for the lifecycle rule. Setting this property to 7 means the rule applies to objects with a size that is greater than 7. * **ObjectSizeLessThan** *(integer) --* The non-inclusive maximum object size for the lifecycle rule. Setting this property to 77 means the rule applies to objects with a size that is less than 77. * **ObjectSizeGreaterThan** *(integer) --* Minimum object size to which the rule applies. * **ObjectSizeLessThan** *(integer) --* Maximum object size to which the rule applies. * **Status** *(string) --* If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is not currently being applied. * **Transitions** *(list) --* Specifies when an Amazon S3 object transitions to a specified storage class. Note: This is not supported by Amazon S3 on Outposts buckets. * *(dict) --* Specifies when an object transitions to a specified storage class. For more information about Amazon S3 Lifecycle configuration rules, see Transitioning objects using Amazon S3 Lifecycle in the *Amazon S3 User Guide*. * **Date** *(datetime) --* Indicates when objects are transitioned to the specified storage class. The date value must be in ISO 8601 format. The time is always midnight UTC. * **Days** *(integer) --* Indicates the number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. * **StorageClass** *(string) --* The storage class to which you want the object to transition. * **NoncurrentVersionTransitions** *(list) --* Specifies the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific 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 a specific storage class at a set period in the object's lifetime. Note: This is not supported by Amazon S3 on Outposts buckets. * *(dict) --* The container for the noncurrent version transition. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent in the *Amazon S3 User Guide*. * **StorageClass** *(string) --* The class of storage used to store the object. * **NoncurrentVersionExpiration** *(dict) --* The noncurrent version expiration of the lifecycle rule. * **NoncurrentDays** *(integer) --* Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. For information about the noncurrent days calculations, see How Amazon S3 Calculates When an Object Became Noncurrent in the *Amazon S3 User Guide*. * **NewerNoncurrentVersions** *(integer) --* Specifies how many noncurrent versions S3 on Outposts will retain. If there are this many more recent noncurrent versions, S3 on Outposts will take the associated action. For more information about noncurrent versions, see Lifecycle configuration elements in the *Amazon S3 User Guide*. * **AbortIncompleteMultipartUpload** *(dict) --* Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 waits before permanently removing all parts of the upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Configuration in the *Amazon S3 User Guide*. * **DaysAfterInitiation** *(integer) --* Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload to the Outposts bucket. S3Control / Client / delete_access_grants_location delete_access_grants_location ***************************** S3Control.Client.delete_access_grants_location(**kwargs) Deregisters a location from your S3 Access Grants instance. You can only delete a location registration from an S3 Access Grants instance if there are no grants associated with this location. See Delete a grant for information on how to delete grants. You need to have at least one registered location in your S3 Access Grants instance in order to create access grants. Permissions You must have the "s3:DeleteAccessGrantsLocation" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_access_grants_location( AccountId='string', AccessGrantsLocationId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **AccessGrantsLocationId** (*string*) -- **[REQUIRED]** The ID of the registered location that you are deregistering from your S3 Access Grants instance. S3 Access Grants assigned this ID when you registered the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. Returns: None S3Control / Client / delete_public_access_block delete_public_access_block ************************** S3Control.Client.delete_public_access_block(**kwargs) Note: This operation is not supported by directory buckets. Removes the "PublicAccessBlock" configuration for an Amazon Web Services account. For more information, see Using Amazon S3 block public access. Related actions include: * GetPublicAccessBlock * PutPublicAccessBlock See also: AWS API Documentation **Request Syntax** response = client.delete_public_access_block( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The account ID for the Amazon Web Services account whose "PublicAccessBlock" configuration you want to remove. Returns: None S3Control / Client / delete_multi_region_access_point delete_multi_region_access_point ******************************** S3Control.Client.delete_multi_region_access_point(**kwargs) Note: This operation is not supported by directory buckets. Deletes a Multi-Region Access Point. This action does not delete the buckets associated with the Multi-Region Access Point, only the Multi-Region Access Point itself. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. This request is asynchronous, meaning that you might receive a response before the command has completed. When this request provides a response, it provides a token that you can use to monitor the status of the request with "DescribeMultiRegionAccessPointOperation". The following actions are related to "DeleteMultiRegionAccessPoint": * CreateMultiRegionAccessPoint * DescribeMultiRegionAccessPointOperation * GetMultiRegionAccessPoint * ListMultiRegionAccessPoints See also: AWS API Documentation **Request Syntax** response = client.delete_multi_region_access_point( AccountId='string', ClientToken='string', Details={ 'Name': 'string' } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **ClientToken** (*string*) -- **[REQUIRED]** An idempotency token used to identify the request and guarantee that requests are unique. This field is autopopulated if not provided. * **Details** (*dict*) -- **[REQUIRED]** A container element containing details about the Multi-Region Access Point. * **Name** *(string) --* **[REQUIRED]** The name of the Multi-Region Access Point associated with this request. Return type: dict Returns: **Response Syntax** { 'RequestTokenARN': 'string' } **Response Structure** * *(dict) --* * **RequestTokenARN** *(string) --* The request token associated with the request. You can use this token with DescribeMultiRegionAccessPointOperation to determine the status of asynchronous requests. S3Control / Client / delete_access_point_policy delete_access_point_policy ************************** S3Control.Client.delete_access_point_policy(**kwargs) Deletes the access point policy for the specified access point. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "DeleteAccessPointPolicy": * PutAccessPointPolicy * GetAccessPointPolicy See also: AWS API Documentation **Request Syntax** response = client.delete_access_point_policy( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point whose policy you want to delete. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format "arn:aws:s3-outposts:::outpost//accesspoint/". For example, to access the access point "reports-ap" through Outpost "my-outpost" owned by account "123456789012" in Region "us-west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/accesspoint/reports- ap". The value must be URL encoded. Returns: None S3Control / Client / delete_access_point delete_access_point ******************* S3Control.Client.delete_access_point(**kwargs) Deletes the specified access point. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "DeleteAccessPoint": * CreateAccessPoint * GetAccessPoint * ListAccessPoints See also: AWS API Documentation **Request Syntax** response = client.delete_access_point( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the account that owns the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point you want to delete. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format "arn:aws:s3-outposts:::outpost//accesspoint/". For example, to access the access point "reports-ap" through Outpost "my-outpost" owned by account "123456789012" in Region "us-west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/accesspoint/reports- ap". The value must be URL encoded. Returns: None S3Control / Client / put_storage_lens_configuration_tagging put_storage_lens_configuration_tagging ************************************** S3Control.Client.put_storage_lens_configuration_tagging(**kwargs) Note: This operation is not supported by directory buckets. Put or replace tags on an existing Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:PutStorageLensConfigurationTagging" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.put_storage_lens_configuration_tagging( ConfigId='string', AccountId='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **ConfigId** (*string*) -- **[REQUIRED]** The ID of the S3 Storage Lens configuration. * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. * **Tags** (*list*) -- **[REQUIRED]** The tag set of the S3 Storage Lens configuration. Note: You can set up to a maximum of 50 tags. * *(dict) --* * **Key** *(string) --* **[REQUIRED]** * **Value** *(string) --* **[REQUIRED]** Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* S3Control / Client / associate_access_grants_identity_center associate_access_grants_identity_center *************************************** S3Control.Client.associate_access_grants_identity_center(**kwargs) Associate your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance. Use this action if you want to create access grants for users or groups from your corporate identity directory. First, you must add your corporate identity directory to Amazon Web Services IAM Identity Center. Then, you can associate this IAM Identity Center instance with your S3 Access Grants instance. Permissions You must have the "s3:AssociateAccessGrantsIdentityCenter" permission to use this operation. Additional Permissions You must also have the following permissions: "sso:CreateApplication", "sso:PutApplicationGrant", and "sso:PutApplicationAuthenticationMethod". See also: AWS API Documentation **Request Syntax** response = client.associate_access_grants_identity_center( AccountId='string', IdentityCenterArn='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **IdentityCenterArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the ListInstances API operation to retrieve a list of your Identity Center instances and their ARNs. Returns: None S3Control / Client / update_job_priority update_job_priority ******************* S3Control.Client.update_job_priority(**kwargs) Updates an existing S3 Batch Operations job's priority. For more information, see S3 Batch Operations in the *Amazon S3 User Guide*. Permissions To use the "UpdateJobPriority" operation, you must have permission to perform the "s3:UpdateJobPriority" action. Related actions include: * CreateJob * ListJobs * DescribeJob * UpdateJobStatus See also: AWS API Documentation **Request Syntax** response = client.update_job_priority( AccountId='string', JobId='string', Priority=123 ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobId** (*string*) -- **[REQUIRED]** The ID for the job whose priority you want to update. * **Priority** (*integer*) -- **[REQUIRED]** The priority you want to assign to this job. Return type: dict Returns: **Response Syntax** { 'JobId': 'string', 'Priority': 123 } **Response Structure** * *(dict) --* * **JobId** *(string) --* The ID for the job whose priority Amazon S3 updated. * **Priority** *(integer) --* The new priority assigned to the specified job. **Exceptions** * "S3Control.Client.exceptions.BadRequestException" * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.NotFoundException" * "S3Control.Client.exceptions.InternalServiceException" S3Control / Client / delete_storage_lens_configuration delete_storage_lens_configuration ********************************* S3Control.Client.delete_storage_lens_configuration(**kwargs) Note: This operation is not supported by directory buckets. Deletes the Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the *Amazon S3 User Guide*. Note: To use this action, you must have permission to perform the "s3:DeleteStorageLensConfiguration" action. For more information, see Setting permissions to use Amazon S3 Storage Lens in the *Amazon S3 User Guide*. See also: AWS API Documentation **Request Syntax** response = client.delete_storage_lens_configuration( ConfigId='string', AccountId='string' ) Parameters: * **ConfigId** (*string*) -- **[REQUIRED]** The ID of the S3 Storage Lens configuration. * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the requester. Returns: None S3Control / Client / get_access_grants_instance get_access_grants_instance ************************** S3Control.Client.get_access_grants_instance(**kwargs) Retrieves the S3 Access Grants instance for a Region in your account. Permissions You must have the "s3:GetAccessGrantsInstance" permission to use this operation. Note: "GetAccessGrantsInstance" is not supported for cross-account access. You can only call the API from the account that owns the S3 Access Grants instance. See also: AWS API Documentation **Request Syntax** response = client.get_access_grants_instance( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. Return type: dict Returns: **Response Syntax** { 'AccessGrantsInstanceArn': 'string', 'AccessGrantsInstanceId': 'string', 'IdentityCenterArn': 'string', 'IdentityCenterInstanceArn': 'string', 'IdentityCenterApplicationArn': 'string', 'CreatedAt': datetime(2015, 1, 1) } **Response Structure** * *(dict) --* * **AccessGrantsInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the S3 Access Grants instance. * **AccessGrantsInstanceId** *(string) --* The ID of the S3 Access Grants instance. The ID is "default". You can have one S3 Access Grants instance per Region per account. * **IdentityCenterArn** *(string) --* If you associated your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) of the IAM Identity Center instance application; a subresource of the original Identity Center instance. S3 Access Grants creates this Identity Center application for the specific S3 Access Grants instance. * **IdentityCenterInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the Amazon Web Services IAM Identity Center instance that you are associating with your S3 Access Grants instance. An IAM Identity Center instance is your corporate identity directory that you added to the IAM Identity Center. You can use the ListInstances API operation to retrieve a list of your Identity Center instances and their ARNs. * **IdentityCenterApplicationArn** *(string) --* If you associated your S3 Access Grants instance with an Amazon Web Services IAM Identity Center instance, this field returns the Amazon Resource Name (ARN) of the IAM Identity Center instance application; a subresource of the original Identity Center instance. S3 Access Grants creates this Identity Center application for the specific S3 Access Grants instance. * **CreatedAt** *(datetime) --* The date and time when you created the S3 Access Grants instance. S3Control / Client / get_multi_region_access_point get_multi_region_access_point ***************************** S3Control.Client.get_multi_region_access_point(**kwargs) Note: This operation is not supported by directory buckets. Returns configuration information about the specified Multi-Region Access Point. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. The following actions are related to "GetMultiRegionAccessPoint": * CreateMultiRegionAccessPoint * DeleteMultiRegionAccessPoint * DescribeMultiRegionAccessPointOperation * ListMultiRegionAccessPoints See also: AWS API Documentation **Request Syntax** response = client.get_multi_region_access_point( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Multi-Region Access Point whose configuration information you want to receive. The name of the Multi-Region Access Point is different from the alias. For more information about the distinction between the name and the alias of an Multi-Region Access Point, see Rules for naming Amazon S3 Multi-Region Access Points in the *Amazon S3 User Guide*. Return type: dict Returns: **Response Syntax** { 'AccessPoint': { 'Name': 'string', 'Alias': 'string', 'CreatedAt': datetime(2015, 1, 1), 'PublicAccessBlock': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, 'Status': 'READY'|'INCONSISTENT_ACROSS_REGIONS'|'CREATING'|'PARTIALLY_CREATED'|'PARTIALLY_DELETED'|'DELETING', 'Regions': [ { 'Bucket': 'string', 'Region': 'string', 'BucketAccountId': 'string' }, ] } } **Response Structure** * *(dict) --* * **AccessPoint** *(dict) --* A container element containing the details of the requested Multi-Region Access Point. * **Name** *(string) --* The name of the Multi-Region Access Point. * **Alias** *(string) --* The alias for the Multi-Region Access Point. For more information about the distinction between the name and the alias of an Multi-Region Access Point, see Rules for naming Amazon S3 Multi-Region Access Points. * **CreatedAt** *(datetime) --* When the Multi-Region Access Point create request was received. * **PublicAccessBlock** *(dict) --* The "PublicAccessBlock" configuration that you want to apply to this Amazon S3 account. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the *Amazon S3 User Guide*. This data type is not supported for Amazon S3 on Outposts. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **Status** *(string) --* The current status of the Multi-Region Access Point. "CREATING" and "DELETING" are temporary states that exist while the request is propagating and being completed. If a Multi-Region Access Point has a status of "PARTIALLY_CREATED", you can retry creation or send a request to delete the Multi-Region Access Point. If a Multi-Region Access Point has a status of "PARTIALLY_DELETED", you can retry a delete request to finish the deletion of the Multi-Region Access Point. * **Regions** *(list) --* A collection of the Regions and buckets associated with the Multi-Region Access Point. * *(dict) --* A combination of a bucket and Region that's part of a Multi-Region Access Point. * **Bucket** *(string) --* The name of the bucket. * **Region** *(string) --* The name of the Region. * **BucketAccountId** *(string) --* The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi- Region Access Point. S3Control / Client / create_access_grants_location create_access_grants_location ***************************** S3Control.Client.create_access_grants_location(**kwargs) The S3 data location that you would like to register in your S3 Access Grants instance. Your S3 data must be in the same Region as your S3 Access Grants instance. The location can be one of the following: * The default S3 location "s3://" * A bucket - "S3://" * A bucket and prefix - "S3:///" When you register a location, you must include the IAM role that has permission to manage the S3 location that you are registering. Give S3 Access Grants permission to assume this role using a policy. S3 Access Grants assumes this role to manage access to the location and to vend temporary credentials to grantees or client applications. Permissions You must have the "s3:CreateAccessGrantsLocation" permission to use this operation. Additional Permissions You must also have the following permission for the specified IAM role: "iam:PassRole" See also: AWS API Documentation **Request Syntax** response = client.create_access_grants_location( AccountId='string', LocationScope='string', IAMRoleArn='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **LocationScope** (*string*) -- **[REQUIRED]** The S3 path to the location that you are registering. The location scope can be the default S3 location "s3://", the S3 path to a bucket "s3://", or the S3 path to a bucket and prefix "s3:///". A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the "engineering/" prefix or object key names that start with the "marketing/campaigns/" prefix. * **IAMRoleArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location. * **Tags** (*list*) -- The Amazon Web Services resource tags that you are adding to the S3 Access Grants location. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* **[REQUIRED]** The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* **[REQUIRED]** The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. Return type: dict Returns: **Response Syntax** { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationArn': 'string', 'LocationScope': 'string', 'IAMRoleArn': 'string' } **Response Structure** * *(dict) --* * **CreatedAt** *(datetime) --* The date and time when you registered the location. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationArn** *(string) --* The Amazon Resource Name (ARN) of the location you are registering. * **LocationScope** *(string) --* The S3 URI path to the location that you are registering. The location scope can be the default S3 location "s3://", the S3 path to a bucket, or the S3 path to a bucket and prefix. A prefix in S3 is a string of characters at the beginning of an object key name used to organize the objects that you store in your S3 buckets. For example, object key names that start with the "engineering/" prefix or object key names that start with the "marketing/campaigns/" prefix. * **IAMRoleArn** *(string) --* The Amazon Resource Name (ARN) of the IAM role for the registered location. S3 Access Grants assumes this role to manage access to the registered location. S3Control / Client / get_public_access_block get_public_access_block *********************** S3Control.Client.get_public_access_block(**kwargs) Note: This operation is not supported by directory buckets. Retrieves the "PublicAccessBlock" configuration for an Amazon Web Services account. For more information, see Using Amazon S3 block public access. Related actions include: * DeletePublicAccessBlock * PutPublicAccessBlock See also: AWS API Documentation **Request Syntax** response = client.get_public_access_block( AccountId='string' ) Parameters: **AccountId** (*string*) -- **[REQUIRED]** The account ID for the Amazon Web Services account whose "PublicAccessBlock" configuration you want to retrieve. Return type: dict Returns: **Response Syntax** { 'PublicAccessBlockConfiguration': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False } } **Response Structure** * *(dict) --* * **PublicAccessBlockConfiguration** *(dict) --* The "PublicAccessBlock" configuration currently in effect for this Amazon Web Services account. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. **Exceptions** * "S3Control.Client.exceptions.NoSuchPublicAccessBlockConfiguratio n" S3Control / Client / get_access_point_policy get_access_point_policy *********************** S3Control.Client.get_access_point_policy(**kwargs) Returns the access point policy associated with the specified access point. The following actions are related to "GetAccessPointPolicy": * PutAccessPointPolicy * DeleteAccessPointPolicy See also: AWS API Documentation **Request Syntax** response = client.get_access_point_policy( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified access point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point whose policy you want to retrieve. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format "arn:aws:s3-outposts:::outpost//accesspoint/". For example, to access the access point "reports-ap" through Outpost "my-outpost" owned by account "123456789012" in Region "us-west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/accesspoint/reports- ap". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'Policy': 'string' } **Response Structure** * *(dict) --* * **Policy** *(string) --* The access point policy associated with the specified access point. S3Control / Client / delete_bucket_replication delete_bucket_replication ************************* S3Control.Client.delete_bucket_replication(**kwargs) Note: This operation deletes an Amazon S3 on Outposts bucket's replication configuration. To delete an S3 bucket's replication configuration, see DeleteBucketReplication in the *Amazon S3 API Reference*. Deletes the replication configuration from the specified S3 on Outposts bucket. To use this operation, you must have permissions to perform the "s3-outposts:PutReplicationConfiguration" action. The Outposts bucket owner has this permission by default and can grant it to others. For more information about permissions, see Setting up IAM with S3 on Outposts and Managing access to S3 on Outposts buckets in the *Amazon S3 User Guide*. Note: It can take a while to propagate "PUT" or "DELETE" requests for a replication configuration to all S3 on Outposts systems. Therefore, the replication configuration that's returned by a "GET" request soon after a "PUT" or "DELETE" request might return a more recent result than what's on the Outpost. If an Outpost is offline, the delay in updating the replication configuration on that Outpost can be significant. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. For information about S3 replication on Outposts configuration, see Replicating objects for S3 on Outposts in the *Amazon S3 User Guide*. The following operations are related to "DeleteBucketReplication": * PutBucketReplication * GetBucketReplication See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_replication( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket to delete the replication configuration for. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the S3 on Outposts bucket to delete the replication configuration for. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Returns: None S3Control / Client / close close ***** S3Control.Client.close() Closes underlying endpoint connections. S3Control / Client / delete_bucket_lifecycle_configuration delete_bucket_lifecycle_configuration ************************************* S3Control.Client.delete_bucket_lifecycle_configuration(**kwargs) Note: This action deletes an Amazon S3 on Outposts bucket's lifecycle configuration. To delete an S3 bucket's lifecycle configuration, see DeleteBucketLifecycle in the *Amazon S3 API Reference*. Deletes the lifecycle configuration from the specified Outposts bucket. Amazon S3 on Outposts removes all the lifecycle configuration rules in the lifecycle subresource associated with the bucket. Your objects never expire, and Amazon S3 on Outposts no longer automatically deletes any objects on the basis of rules contained in the deleted lifecycle configuration. For more information, see Using Amazon S3 on Outposts in *Amazon S3 User Guide*. To use this operation, you must have permission to perform the "s3-outposts:PutLifecycleConfiguration" action. By default, the bucket owner has this permission and the Outposts bucket owner can grant this permission to others. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. For more information about object expiration, see Elements to Describe Lifecycle Actions. Related actions include: * PutBucketLifecycleConfiguration * GetBucketLifecycleConfiguration See also: AWS API Documentation **Request Syntax** response = client.delete_bucket_lifecycle_configuration( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID of the lifecycle configuration to delete. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Returns: None S3Control / Client / put_job_tagging put_job_tagging *************** S3Control.Client.put_job_tagging(**kwargs) Sets the supplied tag-set on an S3 Batch Operations job. A tag is a key-value pair. You can associate S3 Batch Operations tags with any job by sending a PUT request against the tagging subresource that is associated with the job. To modify the existing tag set, you can either replace the existing tag set entirely, or make changes within the existing tag set by retrieving the existing tag set using GetJobTagging, modify that tag set, and use this operation to replace the tag set with the one you modified. For more information, see Controlling access and labeling jobs using tags in the *Amazon S3 User Guide*. Note: * If you send this request with an empty tag set, Amazon S3 deletes the existing tag set on the Batch Operations job. If you use this method, you are charged for a Tier 1 Request (PUT). For more information, see Amazon S3 pricing. * For deleting existing tags for your Batch Operations job, a DeleteJobTagging request is preferred because it achieves the same result without incurring charges. * A few things to consider about using tags: * Amazon S3 limits the maximum number of tags to 50 tags per job. * You can associate up to 50 tags with a job as long as they have unique tag keys. * A tag key can be up to 128 Unicode characters in length, and tag values can be up to 256 Unicode characters in length. * The key and values are case sensitive. * For tagging-related restrictions related to characters and encodings, see User-Defined Tag Restrictions in the *Billing and Cost Management User Guide*. Permissions To use the "PutJobTagging" operation, you must have permission to perform the "s3:PutJobTagging" action. Related actions include: * CreateJob * GetJobTagging * DeleteJobTagging See also: AWS API Documentation **Request Syntax** response = client.put_job_tagging( AccountId='string', JobId='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobId** (*string*) -- **[REQUIRED]** The ID for the S3 Batch Operations job whose tags you want to replace. * **Tags** (*list*) -- **[REQUIRED]** The set of tags to associate with the S3 Batch Operations job. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* **[REQUIRED]** Key of the tag * **Value** *(string) --* **[REQUIRED]** Value of the tag Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Control.Client.exceptions.InternalServiceException" * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.NotFoundException" * "S3Control.Client.exceptions.TooManyTagsException" S3Control / Client / put_bucket_policy put_bucket_policy ***************** S3Control.Client.put_bucket_policy(**kwargs) Note: This action puts a bucket policy to an Amazon S3 on Outposts bucket. To put a policy on an S3 bucket, see PutBucketPolicy in the *Amazon S3 API Reference*. Applies an Amazon S3 bucket policy to an Outposts bucket. For more information, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. If you are using an identity other than the root user of the Amazon Web Services account that owns the Outposts bucket, the calling identity must have the "PutBucketPolicy" permissions on the specified Outposts bucket and belong to the bucket owner's account in order to use this action. If you don't have "PutBucketPolicy" permissions, Amazon S3 returns a "403 Access Denied" error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a "405 Method Not Allowed" error. Warning: As a security precaution, the root user of the Amazon Web Services account that owns a bucket can always use this action, even if the policy explicitly denies the root user the ability to perform this action. For more information about bucket policies, see Using Bucket Policies and User Policies. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "PutBucketPolicy": * GetBucketPolicy * DeleteBucketPolicy See also: AWS API Documentation **Request Syntax** response = client.put_bucket_policy( AccountId='string', Bucket='string', ConfirmRemoveSelfBucketAccess=True|False, Policy='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. * **ConfirmRemoveSelfBucketAccess** (*boolean*) -- Set this parameter to true to confirm that you want to remove your permissions to change this bucket policy in the future. Note: This is not supported by Amazon S3 on Outposts buckets. * **Policy** (*string*) -- **[REQUIRED]** The bucket policy as a JSON document. Returns: None S3Control / Client / create_access_point_for_object_lambda create_access_point_for_object_lambda ************************************* S3Control.Client.create_access_point_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Creates an Object Lambda Access Point. For more information, see Transforming objects with Object Lambda Access Points in the *Amazon S3 User Guide*. The following actions are related to "CreateAccessPointForObjectLambda": * DeleteAccessPointForObjectLambda * GetAccessPointForObjectLambda * ListAccessPointsForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.create_access_point_for_object_lambda( AccountId='string', Name='string', Configuration={ 'SupportingAccessPoint': 'string', 'CloudWatchMetricsEnabled': True|False, 'AllowedFeatures': [ 'GetObject-Range'|'GetObject-PartNumber'|'HeadObject-Range'|'HeadObject-PartNumber', ], 'TransformationConfigurations': [ { 'Actions': [ 'GetObject'|'HeadObject'|'ListObjects'|'ListObjectsV2', ], 'ContentTransformation': { 'AwsLambda': { 'FunctionArn': 'string', 'FunctionPayload': 'string' } } }, ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for owner of the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name you want to assign to this Object Lambda Access Point. * **Configuration** (*dict*) -- **[REQUIRED]** Object Lambda Access Point configuration as a JSON document. * **SupportingAccessPoint** *(string) --* **[REQUIRED]** Standard access point associated with the Object Lambda Access Point. * **CloudWatchMetricsEnabled** *(boolean) --* A container for whether the CloudWatch metrics configuration is enabled. * **AllowedFeatures** *(list) --* A container for allowed features. Valid inputs are "GetObject-Range", "GetObject-PartNumber", "HeadObject- Range", and "HeadObject-PartNumber". * *(string) --* * **TransformationConfigurations** *(list) --* **[REQUIRED]** A container for transformation configurations for an Object Lambda Access Point. * *(dict) --* A configuration used when creating an Object Lambda Access Point transformation. * **Actions** *(list) --* **[REQUIRED]** A container for the action of an Object Lambda Access Point configuration. Valid inputs are "GetObject", "ListObjects", "HeadObject", and "ListObjectsV2". * *(string) --* * **ContentTransformation** *(dict) --* **[REQUIRED]** A container for the content transformation of an Object Lambda Access Point configuration. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "AwsLambda". * **AwsLambda** *(dict) --* A container for an Lambda function. * **FunctionArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Lambda function. * **FunctionPayload** *(string) --* Additional JSON that provides supplemental data to the Lambda function used to transform objects. Return type: dict Returns: **Response Syntax** { 'ObjectLambdaAccessPointArn': 'string', 'Alias': { 'Value': 'string', 'Status': 'PROVISIONING'|'READY' } } **Response Structure** * *(dict) --* * **ObjectLambdaAccessPointArn** *(string) --* Specifies the ARN for the Object Lambda Access Point. * **Alias** *(dict) --* The alias of the Object Lambda Access Point. * **Value** *(string) --* The alias value of the Object Lambda Access Point. * **Status** *(string) --* The status of the Object Lambda Access Point alias. If the status is "PROVISIONING", the Object Lambda Access Point is provisioning the alias and the alias is not ready for use yet. If the status is "READY", the Object Lambda Access Point alias is successfully provisioned and ready for use. S3Control / Client / get_storage_lens_group get_storage_lens_group ********************** S3Control.Client.get_storage_lens_group(**kwargs) Retrieves the Storage Lens group configuration details. To use this operation, you must have the permission to perform the "s3:GetStorageLensGroup" action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. For information about Storage Lens groups errors, see List of Amazon S3 Storage Lens error codes. See also: AWS API Documentation **Request Syntax** response = client.get_storage_lens_group( Name='string', AccountId='string' ) Parameters: * **Name** (*string*) -- **[REQUIRED]** The name of the Storage Lens group that you're trying to retrieve the configuration details for. * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the Storage Lens group that you're trying to retrieve the details for. Return type: dict Returns: **Response Syntax** { 'StorageLensGroup': { 'Name': 'string', 'Filter': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 }, 'And': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 } }, 'Or': { 'MatchAnyPrefix': [ 'string', ], 'MatchAnySuffix': [ 'string', ], 'MatchAnyTag': [ { 'Key': 'string', 'Value': 'string' }, ], 'MatchObjectAge': { 'DaysGreaterThan': 123, 'DaysLessThan': 123 }, 'MatchObjectSize': { 'BytesGreaterThan': 123, 'BytesLessThan': 123 } } }, 'StorageLensGroupArn': 'string' } } **Response Structure** * *(dict) --* * **StorageLensGroup** *(dict) --* The name of the Storage Lens group that you're trying to retrieve the configuration details for. * **Name** *(string) --* Contains the name of the Storage Lens group. * **Filter** *(dict) --* Sets the criteria for the Storage Lens group data that is displayed. For multiple filter conditions, the "AND" or "OR" logical operator is used. * **MatchAnyPrefix** *(list) --* Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed. * *(string) --* * **MatchAnySuffix** *(list) --* Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed. * *(string) --* * **MatchAnyTag** *(list) --* Contains the list of S3 object tags. At least one object tag must be specified. Up to 10 object tags are allowed. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **MatchObjectAge** *(dict) --* Contains "DaysGreaterThan" and "DaysLessThan" to define the object age range (minimum and maximum number of days). * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Contains "BytesGreaterThan" and "BytesLessThan" to define the object size range (minimum and maximum number of Bytes). * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **And** *(dict) --* A logical operator that allows multiple filter conditions to be joined for more complex comparisons of Storage Lens group data. Objects must match all of the listed filter conditions that are joined by the "And" logical operator. Only one of each filter condition is allowed. * **MatchAnyPrefix** *(list) --* Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed. * *(string) --* * **MatchAnySuffix** *(list) --* Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed. * *(string) --* * **MatchAnyTag** *(list) --* Contains the list of object tags. At least one object tag must be specified. Up to 10 object tags are allowed. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **MatchObjectAge** *(dict) --* Contains "DaysGreaterThan" and "DaysLessThan" to define the object age range (minimum and maximum number of days). * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Contains "BytesGreaterThan" and "BytesLessThan" to define the object size range (minimum and maximum number of Bytes). * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **Or** *(dict) --* A single logical operator that allows multiple filter conditions to be joined. Objects can match any of the listed filter conditions, which are joined by the "Or" logical operator. Only one of each filter condition is allowed. * **MatchAnyPrefix** *(list) --* Filters objects that match any of the specified prefixes. * *(string) --* * **MatchAnySuffix** *(list) --* Filters objects that match any of the specified suffixes. * *(string) --* * **MatchAnyTag** *(list) --* Filters objects that match any of the specified S3 object tags. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag * **MatchObjectAge** *(dict) --* Filters objects that match the specified object age range. * **DaysGreaterThan** *(integer) --* Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647. * **DaysLessThan** *(integer) --* Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647. * **MatchObjectSize** *(dict) --* Filters objects that match the specified object size range. * **BytesGreaterThan** *(integer) --* Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB. * **BytesLessThan** *(integer) --* Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB. * **StorageLensGroupArn** *(string) --* Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only. S3Control / Client / get_multi_region_access_point_policy get_multi_region_access_point_policy ************************************ S3Control.Client.get_multi_region_access_point_policy(**kwargs) Note: This operation is not supported by directory buckets. Returns the access control policy of the specified Multi-Region Access Point. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. The following actions are related to "GetMultiRegionAccessPointPolicy": * GetMultiRegionAccessPointPolicyStatus * PutMultiRegionAccessPointPolicy See also: AWS API Documentation **Request Syntax** response = client.get_multi_region_access_point_policy( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **Name** (*string*) -- **[REQUIRED]** Specifies the Multi-Region Access Point. The name of the Multi-Region Access Point is different from the alias. For more information about the distinction between the name and the alias of an Multi-Region Access Point, see Rules for naming Amazon S3 Multi-Region Access Points in the *Amazon S3 User Guide*. Return type: dict Returns: **Response Syntax** { 'Policy': { 'Established': { 'Policy': 'string' }, 'Proposed': { 'Policy': 'string' } } } **Response Structure** * *(dict) --* * **Policy** *(dict) --* The policy associated with the specified Multi-Region Access Point. * **Established** *(dict) --* The last established policy for the Multi-Region Access Point. * **Policy** *(string) --* The details of the last established policy. * **Proposed** *(dict) --* The proposed policy for the Multi-Region Access Point. * **Policy** *(string) --* The details of the proposed policy. S3Control / Client / list_regional_buckets list_regional_buckets ********************* S3Control.Client.list_regional_buckets(**kwargs) Note: This operation is not supported by directory buckets. Returns a list of all Outposts buckets in an Outpost that are owned by the authenticated sender of the request. For more information, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and "x-amz- outpost-id" in your request, see the Examples section. See also: AWS API Documentation **Request Syntax** response = client.list_regional_buckets( AccountId='string', NextToken='string', MaxResults=123, OutpostId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **NextToken** (*string*) * **MaxResults** (*integer*) * **OutpostId** (*string*) -- The ID of the Outposts resource. Note: This ID is required by Amazon S3 on Outposts buckets. Return type: dict Returns: **Response Syntax** { 'RegionalBucketList': [ { 'Bucket': 'string', 'BucketArn': 'string', 'PublicAccessBlockEnabled': True|False, 'CreationDate': datetime(2015, 1, 1), 'OutpostId': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **RegionalBucketList** *(list) --* * *(dict) --* The container for the regional bucket. * **Bucket** *(string) --* * **BucketArn** *(string) --* The Amazon Resource Name (ARN) for the regional bucket. * **PublicAccessBlockEnabled** *(boolean) --* * **CreationDate** *(datetime) --* The creation date of the regional bucket * **OutpostId** *(string) --* The Outposts ID of the regional bucket. * **NextToken** *(string) --* "NextToken" is sent when "isTruncated" is true, which means there are more buckets that can be listed. The next list requests to Amazon S3 can be continued with this "NextToken". "NextToken" is obfuscated and is not a real key. S3Control / Client / get_data_access get_data_access *************** S3Control.Client.get_data_access(**kwargs) Returns a temporary access credential from S3 Access Grants to the grantee or client application. The temporary credential is an Amazon Web Services STS token that grants them access to the S3 data. Permissions You must have the "s3:GetDataAccess" permission to use this operation. Additional Permissions The IAM role that S3 Access Grants assumes must have the following permissions specified in the trust policy when registering the location: "sts:AssumeRole", for directory users or groups "sts:SetContext", and for IAM users or roles "sts:SetSourceIdentity". See also: AWS API Documentation **Request Syntax** response = client.get_data_access( AccountId='string', Target='string', Permission='READ'|'WRITE'|'READWRITE', DurationSeconds=123, Privilege='Minimal'|'Default', TargetType='Object' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **Target** (*string*) -- **[REQUIRED]** The S3 URI path of the data to which you are requesting temporary access credentials. If the requesting account has an access grant for this data, S3 Access Grants vends temporary access credentials in the response. * **Permission** (*string*) -- **[REQUIRED]** The type of permission granted to your S3 data, which can be set to one of the following values: * "READ" – Grant read-only access to the S3 data. * "WRITE" – Grant write-only access to the S3 data. * "READWRITE" – Grant both read and write access to the S3 data. * **DurationSeconds** (*integer*) -- The session duration, in seconds, of the temporary access credential that S3 Access Grants vends to the grantee or client application. The default value is 1 hour, but the grantee can specify a range from 900 seconds (15 minutes) up to 43200 seconds (12 hours). If the grantee requests a value higher than this maximum, the operation fails. * **Privilege** (*string*) -- The scope of the temporary access credential that S3 Access Grants vends to the grantee or client application. * "Default" – The scope of the returned temporary access token is the scope of the grant that is closest to the target scope. * "Minimal" – The scope of the returned temporary access token is the same as the requested target scope as long as the requested scope is the same as or a subset of the grant scope. * **TargetType** (*string*) -- The type of "Target". The only possible value is "Object". Pass this value if the target data that you would like to access is a path to an object. Do not pass this value if the target data is a bucket or a bucket and a prefix. Return type: dict Returns: **Response Syntax** { 'Credentials': { 'AccessKeyId': 'string', 'SecretAccessKey': 'string', 'SessionToken': 'string', 'Expiration': datetime(2015, 1, 1) }, 'MatchedGrantTarget': 'string', 'Grantee': { 'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM', 'GranteeIdentifier': 'string' } } **Response Structure** * *(dict) --* * **Credentials** *(dict) --* The temporary credential token that S3 Access Grants vends. * **AccessKeyId** *(string) --* The unique access key ID of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications. * **SecretAccessKey** *(string) --* The secret access key of the Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications. * **SessionToken** *(string) --* The Amazon Web Services STS temporary credential that S3 Access Grants vends to grantees and client applications. * **Expiration** *(datetime) --* The expiration date and time of the temporary credential that S3 Access Grants vends to grantees and client applications. * **MatchedGrantTarget** *(string) --* The S3 URI path of the data to which you are being granted temporary access credentials. * **Grantee** *(dict) --* The user, group, or role that was granted access to the S3 location scope. For directory identities, this API also returns the grants of the IAM role used for the identity- aware request. For more information on identity-aware sessions, see Granting permissions to use identity-aware console sessions. * **GranteeType** *(string) --* The type of the grantee to which access has been granted. It can be one of the following values: * "IAM" - An IAM user or role. * "DIRECTORY_USER" - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * "DIRECTORY_GROUP" - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * **GranteeIdentifier** *(string) --* The unique identifier of the "Grantee". If the grantee type is "IAM", the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". You can obtain this UUID from your Amazon Web Services IAM Identity Center instance. S3Control / Client / put_access_point_scope put_access_point_scope ********************** S3Control.Client.put_access_point_scope(**kwargs) Creates or replaces the access point scope for a directory bucket. You can use the access point scope to restrict access to specific prefixes, API operations, or a combination of both. Note: You can specify any amount of prefixes, but the total length of characters of all prefixes must be less than 256 bytes in size. To use this operation, you must have the permission to perform the "s3express:PutAccessPointScope" action. For information about REST API errors, see REST error responses. See also: AWS API Documentation **Request Syntax** response = client.put_access_point_scope( AccountId='string', Name='string', Scope={ 'Prefixes': [ 'string', ], 'Permissions': [ 'GetObject'|'GetObjectAttributes'|'ListMultipartUploadParts'|'ListBucket'|'ListBucketMultipartUploads'|'PutObject'|'DeleteObject'|'AbortMultipartUpload', ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the access point with scope that you want to create or replace. * **Name** (*string*) -- **[REQUIRED]** The name of the access point with the scope that you want to create or replace. * **Scope** (*dict*) -- **[REQUIRED]** Object prefixes, API operations, or a combination of both. * **Prefixes** *(list) --* You can specify any amount of prefixes, but the total length of characters of all prefixes must be less than 256 bytes in size. * *(string) --* * **Permissions** *(list) --* You can include one or more API operations as permissions. * *(string) --* Returns: None S3Control / Client / delete_access_point_for_object_lambda delete_access_point_for_object_lambda ************************************* S3Control.Client.delete_access_point_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Deletes the specified Object Lambda Access Point. The following actions are related to "DeleteAccessPointForObjectLambda": * CreateAccessPointForObjectLambda * GetAccessPointForObjectLambda * ListAccessPointsForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.delete_access_point_for_object_lambda( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the access point you want to delete. Returns: None S3Control / Client / list_access_grants list_access_grants ****************** S3Control.Client.list_access_grants(**kwargs) Returns the list of access grants in your S3 Access Grants instance. Permissions You must have the "s3:ListAccessGrants" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_access_grants( AccountId='string', NextToken='string', MaxResults=123, GranteeType='DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM', GranteeIdentifier='string', Permission='READ'|'WRITE'|'READWRITE', GrantScope='string', ApplicationArn='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **NextToken** (*string*) -- A pagination token to request the next page of results. Pass this value into a subsequent "List Access Grants" request in order to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of access grants that you would like returned in the "List Access Grants" response. If the results include the pagination token "NextToken", make another call using the "NextToken" to determine if there are more results. * **GranteeType** (*string*) -- The type of the grantee to which access has been granted. It can be one of the following values: * "IAM" - An IAM user or role. * "DIRECTORY_USER" - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * "DIRECTORY_GROUP" - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * **GranteeIdentifier** (*string*) -- The unique identifer of the "Grantee". If the grantee type is "IAM", the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". You can obtain this UUID from your Amazon Web Services IAM Identity Center instance. * **Permission** (*string*) -- The type of permission granted to your S3 data, which can be set to one of the following values: * "READ" – Grant read-only access to the S3 data. * "WRITE" – Grant write-only access to the S3 data. * "READWRITE" – Grant both read and write access to the S3 data. * **GrantScope** (*string*) -- The S3 path of the data to which you are granting access. It is the result of appending the "Subprefix" to the location scope. * **ApplicationArn** (*string*) -- The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'AccessGrantsList': [ { 'CreatedAt': datetime(2015, 1, 1), 'AccessGrantId': 'string', 'AccessGrantArn': 'string', 'Grantee': { 'GranteeType': 'DIRECTORY_USER'|'DIRECTORY_GROUP'|'IAM', 'GranteeIdentifier': 'string' }, 'Permission': 'READ'|'WRITE'|'READWRITE', 'AccessGrantsLocationId': 'string', 'AccessGrantsLocationConfiguration': { 'S3SubPrefix': 'string' }, 'GrantScope': 'string', 'ApplicationArn': 'string' }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A pagination token to request the next page of results. Pass this value into a subsequent "List Access Grants" request in order to retrieve the next page of results. * **AccessGrantsList** *(list) --* A container for a list of grants in an S3 Access Grants instance. * *(dict) --* Information about the access grant. * **CreatedAt** *(datetime) --* The date and time when you created the S3 Access Grants instance. * **AccessGrantId** *(string) --* The ID of the access grant. S3 Access Grants auto- generates this ID when you create the access grant. * **AccessGrantArn** *(string) --* The Amazon Resource Name (ARN) of the access grant. * **Grantee** *(dict) --* The user, group, or role to which you are granting access. You can grant access to an IAM user or role. If you have added your corporate directory to Amazon Web Services IAM Identity Center and associated your Identity Center instance with your S3 Access Grants instance, the grantee can also be a corporate directory user or group. * **GranteeType** *(string) --* The type of the grantee to which access has been granted. It can be one of the following values: * "IAM" - An IAM user or role. * "DIRECTORY_USER" - Your corporate directory user. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * "DIRECTORY_GROUP" - Your corporate directory group. You can use this option if you have added your corporate identity directory to IAM Identity Center and associated the IAM Identity Center instance with your S3 Access Grants instance. * **GranteeIdentifier** *(string) --* The unique identifier of the "Grantee". If the grantee type is "IAM", the identifier is the IAM Amazon Resource Name (ARN) of the user or role. If the grantee type is a directory user or group, the identifier is 128-bit universally unique identifier (UUID) in the format "a1b2c3d4-5678-90ab-cdef- EXAMPLE11111". You can obtain this UUID from your Amazon Web Services IAM Identity Center instance. * **Permission** *(string) --* The type of access granted to your S3 data, which can be set to one of the following values: * "READ" – Grant read-only access to the S3 data. * "WRITE" – Grant write-only access to the S3 data. * "READWRITE" – Grant both read and write access to the S3 data. * **AccessGrantsLocationId** *(string) --* The ID of the registered location to which you are granting access. S3 Access Grants assigns this ID when you register the location. S3 Access Grants assigns the ID "default" to the default location "s3://" and assigns an auto-generated ID to other locations that you register. * **AccessGrantsLocationConfiguration** *(dict) --* The configuration options of the grant location. The grant location is the S3 path to the data to which you are granting access. * **S3SubPrefix** *(string) --* The "S3SubPrefix" is appended to the location scope creating the grant scope. Use this field to narrow the scope of the grant to a subset of the location scope. This field is required if the location scope is the default location "s3://" because you cannot create a grant for all of your S3 data in the Region and must narrow the scope. For example, if the location scope is the default location "s3://", the "S3SubPrefx" can be a />>*<<, so the full grant scope path would be "s3:///*". Or the "S3SubPrefx" can be "/*", so the full grant scope path would be or "s3:///*". If the "S3SubPrefix" includes a prefix, append the wildcard character "*" after the prefix to indicate that you want to include all object key names in the bucket that start with that prefix. * **GrantScope** *(string) --* The S3 path of the data to which you are granting access. It is the result of appending the "Subprefix" to the location scope. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. S3Control / Client / list_multi_region_access_points list_multi_region_access_points ******************************* S3Control.Client.list_multi_region_access_points(**kwargs) Note: This operation is not supported by directory buckets. Returns a list of the Multi-Region Access Points currently associated with the specified Amazon Web Services account. Each call can return up to 100 Multi-Region Access Points, the maximum number of Multi-Region Access Points that can be associated with a single account. This action will always be routed to the US West (Oregon) Region. For more information about the restrictions around working with Multi-Region Access Points, see Multi-Region Access Point restrictions and limitations in the *Amazon S3 User Guide*. The following actions are related to "ListMultiRegionAccessPoint": * CreateMultiRegionAccessPoint * DeleteMultiRegionAccessPoint * DescribeMultiRegionAccessPointOperation * GetMultiRegionAccessPoint See also: AWS API Documentation **Request Syntax** response = client.list_multi_region_access_points( AccountId='string', NextToken='string', MaxResults=123 ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **NextToken** (*string*) -- Not currently used. Do not use this parameter. * **MaxResults** (*integer*) -- Not currently used. Do not use this parameter. Return type: dict Returns: **Response Syntax** { 'AccessPoints': [ { 'Name': 'string', 'Alias': 'string', 'CreatedAt': datetime(2015, 1, 1), 'PublicAccessBlock': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, 'Status': 'READY'|'INCONSISTENT_ACROSS_REGIONS'|'CREATING'|'PARTIALLY_CREATED'|'PARTIALLY_DELETED'|'DELETING', 'Regions': [ { 'Bucket': 'string', 'Region': 'string', 'BucketAccountId': 'string' }, ] }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AccessPoints** *(list) --* The list of Multi-Region Access Points associated with the user. * *(dict) --* A collection of statuses for a Multi-Region Access Point in the various Regions it supports. * **Name** *(string) --* The name of the Multi-Region Access Point. * **Alias** *(string) --* The alias for the Multi-Region Access Point. For more information about the distinction between the name and the alias of an Multi-Region Access Point, see Rules for naming Amazon S3 Multi-Region Access Points. * **CreatedAt** *(datetime) --* When the Multi-Region Access Point create request was received. * **PublicAccessBlock** *(dict) --* The "PublicAccessBlock" configuration that you want to apply to this Amazon S3 account. You can enable the configuration options in any combination. For more information about when Amazon S3 considers a bucket or object public, see The Meaning of "Public" in the *Amazon S3 User Guide*. This data type is not supported for Amazon S3 on Outposts. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **Status** *(string) --* The current status of the Multi-Region Access Point. "CREATING" and "DELETING" are temporary states that exist while the request is propagating and being completed. If a Multi-Region Access Point has a status of "PARTIALLY_CREATED", you can retry creation or send a request to delete the Multi-Region Access Point. If a Multi-Region Access Point has a status of "PARTIALLY_DELETED", you can retry a delete request to finish the deletion of the Multi-Region Access Point. * **Regions** *(list) --* A collection of the Regions and buckets associated with the Multi-Region Access Point. * *(dict) --* A combination of a bucket and Region that's part of a Multi-Region Access Point. * **Bucket** *(string) --* The name of the bucket. * **Region** *(string) --* The name of the Region. * **BucketAccountId** *(string) --* The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi- Region Access Point. * **NextToken** *(string) --* If the specified bucket has more Multi-Region Access Points than can be returned in one call to this action, this field contains a continuation token. You can use this token tin subsequent calls to this action to retrieve additional Multi-Region Access Points. S3Control / Client / tag_resource tag_resource ************ S3Control.Client.tag_resource(**kwargs) Creates a new user-defined tag or updates an existing tag. Each tag is a label consisting of a key and value that is applied to your resource. Tags can help you organize, track costs for, and control access to your resources. You can add up to 50 Amazon Web Services resource tags for each S3 resource. Note: This operation is only supported for the following Amazon S3 resource: * Directory buckets * S3 Storage Lens groups * S3 Access Grants instances, registered locations, or grants. Permissions For Storage Lens groups and S3 Access Grants, you must have the "s3:TagResource" permission to use this operation. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups. Directory bucket permissions For directory buckets, you must have the "s3express:TagResource" permission to use this operation. For more information about directory buckets policies and permissions, see Identity and Access Management (IAM) for S3 Express One Zone in the *Amazon S3 User Guide*. HTTP Host header syntax **Directory buckets** - The HTTP Host header syntax is "s3express- control.region.amazonaws.com". For information about S3 Tagging errors, see List of Amazon S3 Tagging error codes. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( AccountId='string', ResourceArn='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that created the S3 resource that you're trying to add tags to or the requester's account ID. * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the S3 resource that you're applying tags to. The tagged resource can be a directory bucket, S3 Storage Lens group or S3 Access Grants instance, registered location, or grant. * **Tags** (*list*) -- **[REQUIRED]** The Amazon Web Services resource tags that you want to add to the specified S3 resource. * *(dict) --* A key-value pair that you use to label your resources. You can add tags to new resources when you create them, or you can add tags to existing resources. Tags can help you organize, track costs for, and control access to resources. * **Key** *(string) --* **[REQUIRED]** The key of the key-value pair of a tag added to your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with "aws:" aren’t supported. * **Value** *(string) --* **[REQUIRED]** The value of the key-value pair of a tag added to your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* S3Control / Client / get_bucket_tagging get_bucket_tagging ****************** S3Control.Client.get_bucket_tagging(**kwargs) Note: This action gets an Amazon S3 on Outposts bucket's tags. To get an S3 bucket tags, see GetBucketTagging in the *Amazon S3 API Reference*. Returns the tag set associated with the Outposts bucket. For more information, see Using Amazon S3 on Outposts in the *Amazon S3 User Guide*. To use this action, you must have permission to perform the "GetBucketTagging" action. By default, the bucket owner has this permission and can grant this permission to others. "GetBucketTagging" has the following special error: * Error code: "NoSuchTagSetError" * Description: There is no tag set associated with the bucket. All Amazon S3 on Outposts REST API requests for this action require an additional parameter of "x-amz-outpost-id" to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of "s3-control". For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the "x-amz-outpost-id" derived by using the access point ARN, see the Examples section. The following actions are related to "GetBucketTagging": * PutBucketTagging * DeleteBucketTagging See also: AWS API Documentation **Request Syntax** response = client.get_bucket_tagging( AccountId='string', Bucket='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the Outposts bucket. * **Bucket** (*string*) -- **[REQUIRED]** Specifies the bucket. For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well. For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format "arn:aws:s3-outposts:::outpost//bucket/". For example, to access the bucket "reports" through Outpost "my-outpost" owned by account "123456789012" in Region "us- west-2", use the URL encoding of "arn:aws:s3-outposts:us- west-2:123456789012:outpost/my-outpost/bucket/reports". The value must be URL encoded. Return type: dict Returns: **Response Syntax** { 'TagSet': [ { 'Key': 'string', 'Value': 'string' }, ] } **Response Structure** * *(dict) --* * **TagSet** *(list) --* The tags set of the Outposts bucket. * *(dict) --* A container for a key-value name pair. * **Key** *(string) --* Key of the tag * **Value** *(string) --* Value of the tag S3Control / Client / get_access_point_scope get_access_point_scope ********************** S3Control.Client.get_access_point_scope(**kwargs) Returns the access point scope for a directory bucket. To use this operation, you must have the permission to perform the "s3express:GetAccessPointScope" action. For information about REST API errors, see REST error responses. See also: AWS API Documentation **Request Syntax** response = client.get_access_point_scope( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID that owns the access point with the scope that you want to retrieve. * **Name** (*string*) -- **[REQUIRED]** The name of the access point with the scope you want to retrieve. Return type: dict Returns: **Response Syntax** { 'Scope': { 'Prefixes': [ 'string', ], 'Permissions': [ 'GetObject'|'GetObjectAttributes'|'ListMultipartUploadParts'|'ListBucket'|'ListBucketMultipartUploads'|'PutObject'|'DeleteObject'|'AbortMultipartUpload', ] } } **Response Structure** * *(dict) --* * **Scope** *(dict) --* The contents of the access point scope. * **Prefixes** *(list) --* You can specify any amount of prefixes, but the total length of characters of all prefixes must be less than 256 bytes in size. * *(string) --* * **Permissions** *(list) --* You can include one or more API operations as permissions. * *(string) --* S3Control / Client / get_access_grants_instance_for_prefix get_access_grants_instance_for_prefix ************************************* S3Control.Client.get_access_grants_instance_for_prefix(**kwargs) Retrieve the S3 Access Grants instance that contains a particular prefix. Permissions You must have the "s3:GetAccessGrantsInstanceForPrefix" permission for the caller account to use this operation. Additional Permissions The prefix owner account must grant you the following permissions to their S3 Access Grants instance: "s3:GetAccessGrantsInstanceForPrefix". See also: AWS API Documentation **Request Syntax** response = client.get_access_grants_instance_for_prefix( AccountId='string', S3Prefix='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The ID of the Amazon Web Services account that is making this request. * **S3Prefix** (*string*) -- **[REQUIRED]** The S3 prefix of the access grants that you would like to retrieve. Return type: dict Returns: **Response Syntax** { 'AccessGrantsInstanceArn': 'string', 'AccessGrantsInstanceId': 'string' } **Response Structure** * *(dict) --* * **AccessGrantsInstanceArn** *(string) --* The Amazon Resource Name (ARN) of the S3 Access Grants instance. * **AccessGrantsInstanceId** *(string) --* The ID of the S3 Access Grants instance. The ID is "default". You can have one S3 Access Grants instance per Region per account. S3Control / Client / put_access_point_configuration_for_object_lambda put_access_point_configuration_for_object_lambda ************************************************ S3Control.Client.put_access_point_configuration_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Replaces configuration for an Object Lambda Access Point. The following actions are related to "PutAccessPointConfigurationForObjectLambda": * GetAccessPointConfigurationForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.put_access_point_configuration_for_object_lambda( AccountId='string', Name='string', Configuration={ 'SupportingAccessPoint': 'string', 'CloudWatchMetricsEnabled': True|False, 'AllowedFeatures': [ 'GetObject-Range'|'GetObject-PartNumber'|'HeadObject-Range'|'HeadObject-PartNumber', ], 'TransformationConfigurations': [ { 'Actions': [ 'GetObject'|'HeadObject'|'ListObjects'|'ListObjectsV2', ], 'ContentTransformation': { 'AwsLambda': { 'FunctionArn': 'string', 'FunctionPayload': 'string' } } }, ] } ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point. * **Configuration** (*dict*) -- **[REQUIRED]** Object Lambda Access Point configuration document. * **SupportingAccessPoint** *(string) --* **[REQUIRED]** Standard access point associated with the Object Lambda Access Point. * **CloudWatchMetricsEnabled** *(boolean) --* A container for whether the CloudWatch metrics configuration is enabled. * **AllowedFeatures** *(list) --* A container for allowed features. Valid inputs are "GetObject-Range", "GetObject-PartNumber", "HeadObject- Range", and "HeadObject-PartNumber". * *(string) --* * **TransformationConfigurations** *(list) --* **[REQUIRED]** A container for transformation configurations for an Object Lambda Access Point. * *(dict) --* A configuration used when creating an Object Lambda Access Point transformation. * **Actions** *(list) --* **[REQUIRED]** A container for the action of an Object Lambda Access Point configuration. Valid inputs are "GetObject", "ListObjects", "HeadObject", and "ListObjectsV2". * *(string) --* * **ContentTransformation** *(dict) --* **[REQUIRED]** A container for the content transformation of an Object Lambda Access Point configuration. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "AwsLambda". * **AwsLambda** *(dict) --* A container for an Lambda function. * **FunctionArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the Lambda function. * **FunctionPayload** *(string) --* Additional JSON that provides supplemental data to the Lambda function used to transform objects. Returns: None S3Control / Client / update_job_status update_job_status ***************** S3Control.Client.update_job_status(**kwargs) Updates the status for the specified job. Use this operation to confirm that you want to run a job or to cancel an existing job. For more information, see S3 Batch Operations in the *Amazon S3 User Guide*. Permissions To use the "UpdateJobStatus" operation, you must have permission to perform the "s3:UpdateJobStatus" action. Related actions include: * CreateJob * ListJobs * DescribeJob * UpdateJobStatus See also: AWS API Documentation **Request Syntax** response = client.update_job_status( AccountId='string', JobId='string', RequestedJobStatus='Cancelled'|'Ready', StatusUpdateReason='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID associated with the S3 Batch Operations job. * **JobId** (*string*) -- **[REQUIRED]** The ID of the job whose status you want to update. * **RequestedJobStatus** (*string*) -- **[REQUIRED]** The status that you want to move the specified job to. * **StatusUpdateReason** (*string*) -- A description of the reason why you want to change the specified job's status. This field can be any string up to the maximum length. Return type: dict Returns: **Response Syntax** { 'JobId': 'string', 'Status': 'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended', 'StatusUpdateReason': 'string' } **Response Structure** * *(dict) --* * **JobId** *(string) --* The ID for the job whose status was updated. * **Status** *(string) --* The current status for the specified job. * **StatusUpdateReason** *(string) --* The reason that the specified job's status was updated. **Exceptions** * "S3Control.Client.exceptions.BadRequestException" * "S3Control.Client.exceptions.TooManyRequestsException" * "S3Control.Client.exceptions.NotFoundException" * "S3Control.Client.exceptions.JobStatusException" * "S3Control.Client.exceptions.InternalServiceException" S3Control / Client / list_caller_access_grants list_caller_access_grants ************************* S3Control.Client.list_caller_access_grants(**kwargs) Use this API to list the access grants that grant the caller access to Amazon S3 data through S3 Access Grants. The caller (grantee) can be an Identity and Access Management (IAM) identity or Amazon Web Services Identity Center corporate directory identity. You must pass the Amazon Web Services account of the S3 data owner (grantor) in the request. You can, optionally, narrow the results by "GrantScope", using a fragment of the data's S3 path, and S3 Access Grants will return only the grants with a path that contains the path fragment. You can also pass the "AllowedByApplication" filter in the request, which returns only the grants authorized for applications, whether the application is the caller's Identity Center application or any other application ( "ALL"). For more information, see List the caller's access grants in the *Amazon S3 User Guide*. Permissions You must have the "s3:ListCallerAccessGrants" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_caller_access_grants( AccountId='string', GrantScope='string', NextToken='string', MaxResults=123, AllowedByApplication=True|False ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **GrantScope** (*string*) -- The S3 path of the data that you would like to access. Must start with "s3://". You can optionally pass only the beginning characters of a path, and S3 Access Grants will search for all applicable grants for the path fragment. * **NextToken** (*string*) -- A pagination token to request the next page of results. Pass this value into a subsequent "List Caller Access Grants" request in order to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of access grants that you would like returned in the "List Caller Access Grants" response. If the results include the pagination token "NextToken", make another call using the "NextToken" to determine if there are more results. * **AllowedByApplication** (*boolean*) -- If this optional parameter is passed in the request, a filter is applied to the results. The results will include only the access grants for the caller's Identity Center application or for any other applications ( "ALL"). Return type: dict Returns: **Response Syntax** { 'NextToken': 'string', 'CallerAccessGrantsList': [ { 'Permission': 'READ'|'WRITE'|'READWRITE', 'GrantScope': 'string', 'ApplicationArn': 'string' }, ] } **Response Structure** * *(dict) --* * **NextToken** *(string) --* A pagination token that you can use to request the next page of results. Pass this value into a subsequent "List Caller Access Grants" request in order to retrieve the next page of results. * **CallerAccessGrantsList** *(list) --* A list of the caller's access grants that were created using S3 Access Grants and that grant the caller access to the S3 data of the Amazon Web Services account ID that was specified in the request. * *(dict) --* Part of "ListCallerAccessGrantsResult". Each entry includes the permission level (READ, WRITE, or READWRITE) and the grant scope of the access grant. If the grant also includes an application ARN, the grantee can only access the S3 data through this application. * **Permission** *(string) --* The type of permission granted, which can be one of the following values: * "READ" - Grants read-only access to the S3 data. * "WRITE" - Grants write-only access to the S3 data. * "READWRITE" - Grants both read and write access to the S3 data. * **GrantScope** *(string) --* The S3 path of the data to which you have been granted access. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Web Services IAM Identity Center application associated with your Identity Center instance. If the grant includes an application ARN, the grantee can only access the S3 data through this application. S3Control / Client / delete_access_grant delete_access_grant ******************* S3Control.Client.delete_access_grant(**kwargs) Deletes the access grant from the S3 Access Grants instance. You cannot undo an access grant deletion and the grantee will no longer have access to the S3 data. Permissions You must have the "s3:DeleteAccessGrant" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_access_grant( AccountId='string', AccessGrantId='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID of the S3 Access Grants instance. * **AccessGrantId** (*string*) -- **[REQUIRED]** The ID of the access grant. S3 Access Grants auto-generates this ID when you create the access grant. Returns: None S3Control / Client / get_access_point_for_object_lambda get_access_point_for_object_lambda ********************************** S3Control.Client.get_access_point_for_object_lambda(**kwargs) Note: This operation is not supported by directory buckets. Returns configuration information about the specified Object Lambda Access Point The following actions are related to "GetAccessPointForObjectLambda": * CreateAccessPointForObjectLambda * DeleteAccessPointForObjectLambda * ListAccessPointsForObjectLambda See also: AWS API Documentation **Request Syntax** response = client.get_access_point_for_object_lambda( AccountId='string', Name='string' ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The account ID for the account that owns the specified Object Lambda Access Point. * **Name** (*string*) -- **[REQUIRED]** The name of the Object Lambda Access Point. Return type: dict Returns: **Response Syntax** { 'Name': 'string', 'PublicAccessBlockConfiguration': { 'BlockPublicAcls': True|False, 'IgnorePublicAcls': True|False, 'BlockPublicPolicy': True|False, 'RestrictPublicBuckets': True|False }, 'CreationDate': datetime(2015, 1, 1), 'Alias': { 'Value': 'string', 'Status': 'PROVISIONING'|'READY' } } **Response Structure** * *(dict) --* * **Name** *(string) --* The name of the Object Lambda Access Point. * **PublicAccessBlockConfiguration** *(dict) --* Configuration to block all public access. This setting is turned on and can not be edited. * **BlockPublicAcls** *(boolean) --* Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. Setting this element to "TRUE" causes the following behavior: * "PutBucketAcl" and "PutObjectAcl" calls fail if the specified ACL is public. * PUT Object calls fail if the request includes a public ACL. * PUT Bucket calls fail if the request includes a public ACL. Enabling this setting doesn't affect existing policies or ACLs. This property is not supported for Amazon S3 on Outposts. * **IgnorePublicAcls** *(boolean) --* Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to ignore all public ACLs on buckets in this account and any objects that they contain. Enabling this setting doesn't affect the persistence of any existing ACLs and doesn't prevent new public ACLs from being set. This property is not supported for Amazon S3 on Outposts. * **BlockPublicPolicy** *(boolean) --* Specifies whether Amazon S3 should block public bucket policies for buckets in this account. Setting this element to "TRUE" causes Amazon S3 to reject calls to PUT Bucket policy if the specified bucket policy allows public access. Enabling this setting doesn't affect existing bucket policies. This property is not supported for Amazon S3 on Outposts. * **RestrictPublicBuckets** *(boolean) --* Specifies whether Amazon S3 should restrict public bucket policies for buckets in this account. Setting this element to "TRUE" restricts access to buckets with public policies to only Amazon Web Services service principals and authorized users within this account. Enabling this setting doesn't affect previously stored bucket policies, except that public and cross-account access within any public bucket policy, including non- public delegation to specific accounts, is blocked. This property is not supported for Amazon S3 on Outposts. * **CreationDate** *(datetime) --* The date and time when the specified Object Lambda Access Point was created. * **Alias** *(dict) --* The alias of the Object Lambda Access Point. * **Value** *(string) --* The alias value of the Object Lambda Access Point. * **Status** *(string) --* The status of the Object Lambda Access Point alias. If the status is "PROVISIONING", the Object Lambda Access Point is provisioning the alias and the alias is not ready for use yet. If the status is "READY", the Object Lambda Access Point alias is successfully provisioned and ready for use. S3Control / Client / submit_multi_region_access_point_routes submit_multi_region_access_point_routes *************************************** S3Control.Client.submit_multi_region_access_point_routes(**kwargs) Note: This operation is not supported by directory buckets. Submits an updated route configuration for a Multi-Region Access Point. This API operation updates the routing status for the specified Regions from active to passive, or from passive to active. A value of "0" indicates a passive status, which means that traffic won't be routed to the specified Region. A value of "100" indicates an active status, which means that traffic will be routed to the specified Region. At least one Region must be active at all times. When the routing configuration is changed, any in-progress operations (uploads, copies, deletes, and so on) to formerly active Regions will continue to run to their final completion state (success or failure). The routing configurations of any Regions that aren’t specified remain unchanged. Note: Updated routing configurations might not be immediately applied. It can take up to 2 minutes for your changes to take effect. To submit routing control changes and failover requests, use the Amazon S3 failover control infrastructure endpoints in these five Amazon Web Services Regions: * "us-east-1" * "us-west-2" * "ap-southeast-2" * "ap-northeast-1" * "eu-west-1" See also: AWS API Documentation **Request Syntax** response = client.submit_multi_region_access_point_routes( AccountId='string', Mrap='string', RouteUpdates=[ { 'Bucket': 'string', 'Region': 'string', 'TrafficDialPercentage': 123 }, ] ) Parameters: * **AccountId** (*string*) -- **[REQUIRED]** The Amazon Web Services account ID for the owner of the Multi- Region Access Point. * **Mrap** (*string*) -- **[REQUIRED]** The Multi-Region Access Point ARN. * **RouteUpdates** (*list*) -- **[REQUIRED]** The different routes that make up the new route configuration. Active routes return a value of "100", and passive routes return a value of "0". * *(dict) --* A structure for a Multi-Region Access Point that indicates where Amazon S3 traffic can be routed. Routes can be either active or passive. Active routes can process Amazon S3 requests through the Multi-Region Access Point, but passive routes are not eligible to process Amazon S3 requests. Each route contains the Amazon S3 bucket name and the Amazon Web Services Region that the bucket is located in. The route also includes the "TrafficDialPercentage" value, which shows whether the bucket and Region are active (indicated by a value of "100") or passive (indicated by a value of "0"). * **Bucket** *(string) --* The name of the Amazon S3 bucket for which you'll submit a routing configuration change. Either the "Bucket" or the "Region" value must be provided. If both are provided, the bucket must be in the specified Region. * **Region** *(string) --* The Amazon Web Services Region to which you'll be submitting a routing configuration change. Either the "Bucket" or the "Region" value must be provided. If both are provided, the bucket must be in the specified Region. * **TrafficDialPercentage** *(integer) --* **[REQUIRED]** The traffic state for the specified bucket or Amazon Web Services Region. A value of "0" indicates a passive state, which means that no new traffic will be routed to the Region. A value of "100" indicates an active state, which means that traffic will be routed to the specified Region. When the routing configuration for a Region is changed from active to passive, any in-progress operations (uploads, copies, deletes, and so on) to the formerly active Region will continue to run to until a final success or failure status is reached. If all Regions in the routing configuration are designated as passive, you'll receive an "InvalidRequest" error. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* S3Outposts ********** Client ====== class S3Outposts.Client A low-level client representing Amazon S3 on Outposts (S3 Outposts) Amazon S3 on Outposts provides access to S3 on Outposts operations. import boto3 client = boto3.client('s3outposts') These are the available methods: * can_paginate * close * create_endpoint * delete_endpoint * get_paginator * get_waiter * list_endpoints * list_outposts_with_s3 * list_shared_endpoints Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListEndpoints * ListOutpostsWithS3 * ListSharedEndpoints S3Outposts / Paginator / ListOutpostsWithS3 ListOutpostsWithS3 ****************** class S3Outposts.Paginator.ListOutpostsWithS3 paginator = client.get_paginator('list_outposts_with_s3') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Outposts.Client.list_outposts_with_s3()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max- items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Outposts': [ { 'OutpostArn': 'string', 'S3OutpostArn': 'string', 'OutpostId': 'string', 'OwnerId': 'string', 'CapacityInBytes': 123 }, ], } **Response Structure** * *(dict) --* * **Outposts** *(list) --* Returns the list of Outposts that have the following characteristics: * outposts that have S3 provisioned * outposts that are "Active" (not pending any provisioning nor decommissioned) * outposts to which the the calling Amazon Web Services account has access * *(dict) --* Contains the details for the Outpost object. * **OutpostArn** *(string) --* Specifies the unique Amazon Resource Name (ARN) for the outpost. * **S3OutpostArn** *(string) --* Specifies the unique S3 on Outposts ARN for use with Resource Access Manager (RAM). * **OutpostId** *(string) --* Specifies the unique identifier for the outpost. * **OwnerId** *(string) --* Returns the Amazon Web Services account ID of the outpost owner. Useful for comparing owned versus shared outposts. * **CapacityInBytes** *(integer) --* The Amazon S3 capacity of the outpost in bytes. S3Outposts / Paginator / ListSharedEndpoints ListSharedEndpoints ******************* class S3Outposts.Paginator.ListSharedEndpoints paginator = client.get_paginator('list_shared_endpoints') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Outposts.Client.list_shared_endpoints()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( OutpostId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **OutpostId** (*string*) -- **[REQUIRED]** The ID of the Amazon Web Services Outpost. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Endpoints': [ { 'EndpointArn': 'string', 'OutpostsId': 'string', 'CidrBlock': 'string', 'Status': 'Pending'|'Available'|'Deleting'|'Create_Failed'|'Delete_Failed', 'CreationTime': datetime(2015, 1, 1), 'NetworkInterfaces': [ { 'NetworkInterfaceId': 'string' }, ], 'VpcId': 'string', 'SubnetId': 'string', 'SecurityGroupId': 'string', 'AccessType': 'Private'|'CustomerOwnedIp', 'CustomerOwnedIpv4Pool': 'string', 'FailedReason': { 'ErrorCode': 'string', 'Message': 'string' } }, ], } **Response Structure** * *(dict) --* * **Endpoints** *(list) --* The list of endpoints associated with the specified Outpost that have been shared by Amazon Web Services Resource Access Manager (RAM). * *(dict) --* Amazon S3 on Outposts Access Points simplify managing data access at scale for shared datasets in S3 on Outposts. S3 on Outposts uses endpoints to connect to Outposts buckets so that you can perform actions within your virtual private cloud (VPC). For more information, see Accessing S3 on Outposts using VPC-only access points in the *Amazon Simple Storage Service User Guide*. * **EndpointArn** *(string) --* The Amazon Resource Name (ARN) of the endpoint. * **OutpostsId** *(string) --* The ID of the Outposts. * **CidrBlock** *(string) --* The VPC CIDR committed by this endpoint. * **Status** *(string) --* The status of the endpoint. * **CreationTime** *(datetime) --* The time the endpoint was created. * **NetworkInterfaces** *(list) --* The network interface of the endpoint. * *(dict) --* The container for the network interface. * **NetworkInterfaceId** *(string) --* The ID for the network interface. * **VpcId** *(string) --* The ID of the VPC used for the endpoint. * **SubnetId** *(string) --* The ID of the subnet used for the endpoint. * **SecurityGroupId** *(string) --* The ID of the security group used for the endpoint. * **AccessType** *(string) --* The type of connectivity used to access the Amazon S3 on Outposts endpoint. * **CustomerOwnedIpv4Pool** *(string) --* The ID of the customer-owned IPv4 address pool used for the endpoint. * **FailedReason** *(dict) --* The failure reason, if any, for a create or delete endpoint operation. * **ErrorCode** *(string) --* The failure code, if any, for a create or delete endpoint operation. * **Message** *(string) --* Additional error details describing the endpoint failure and recommended action. S3Outposts / Paginator / ListEndpoints ListEndpoints ************* class S3Outposts.Paginator.ListEndpoints paginator = client.get_paginator('list_endpoints') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Outposts.Client.list_endpoints()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max- items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Endpoints': [ { 'EndpointArn': 'string', 'OutpostsId': 'string', 'CidrBlock': 'string', 'Status': 'Pending'|'Available'|'Deleting'|'Create_Failed'|'Delete_Failed', 'CreationTime': datetime(2015, 1, 1), 'NetworkInterfaces': [ { 'NetworkInterfaceId': 'string' }, ], 'VpcId': 'string', 'SubnetId': 'string', 'SecurityGroupId': 'string', 'AccessType': 'Private'|'CustomerOwnedIp', 'CustomerOwnedIpv4Pool': 'string', 'FailedReason': { 'ErrorCode': 'string', 'Message': 'string' } }, ], } **Response Structure** * *(dict) --* * **Endpoints** *(list) --* The list of endpoints associated with the specified Outpost. * *(dict) --* Amazon S3 on Outposts Access Points simplify managing data access at scale for shared datasets in S3 on Outposts. S3 on Outposts uses endpoints to connect to Outposts buckets so that you can perform actions within your virtual private cloud (VPC). For more information, see Accessing S3 on Outposts using VPC-only access points in the *Amazon Simple Storage Service User Guide*. * **EndpointArn** *(string) --* The Amazon Resource Name (ARN) of the endpoint. * **OutpostsId** *(string) --* The ID of the Outposts. * **CidrBlock** *(string) --* The VPC CIDR committed by this endpoint. * **Status** *(string) --* The status of the endpoint. * **CreationTime** *(datetime) --* The time the endpoint was created. * **NetworkInterfaces** *(list) --* The network interface of the endpoint. * *(dict) --* The container for the network interface. * **NetworkInterfaceId** *(string) --* The ID for the network interface. * **VpcId** *(string) --* The ID of the VPC used for the endpoint. * **SubnetId** *(string) --* The ID of the subnet used for the endpoint. * **SecurityGroupId** *(string) --* The ID of the security group used for the endpoint. * **AccessType** *(string) --* The type of connectivity used to access the Amazon S3 on Outposts endpoint. * **CustomerOwnedIpv4Pool** *(string) --* The ID of the customer-owned IPv4 address pool used for the endpoint. * **FailedReason** *(dict) --* The failure reason, if any, for a create or delete endpoint operation. * **ErrorCode** *(string) --* The failure code, if any, for a create or delete endpoint operation. * **Message** *(string) --* Additional error details describing the endpoint failure and recommended action. S3Outposts / Client / list_shared_endpoints list_shared_endpoints ********************* S3Outposts.Client.list_shared_endpoints(**kwargs) Lists all endpoints associated with an Outpost that has been shared by Amazon Web Services Resource Access Manager (RAM). Related actions include: * CreateEndpoint * DeleteEndpoint See also: AWS API Documentation **Request Syntax** response = client.list_shared_endpoints( NextToken='string', MaxResults=123, OutpostId='string' ) Parameters: * **NextToken** (*string*) -- If a previous response from this operation included a "NextToken" value, you can provide that value here to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of endpoints that will be returned in the response. * **OutpostId** (*string*) -- **[REQUIRED]** The ID of the Amazon Web Services Outpost. Return type: dict Returns: **Response Syntax** { 'Endpoints': [ { 'EndpointArn': 'string', 'OutpostsId': 'string', 'CidrBlock': 'string', 'Status': 'Pending'|'Available'|'Deleting'|'Create_Failed'|'Delete_Failed', 'CreationTime': datetime(2015, 1, 1), 'NetworkInterfaces': [ { 'NetworkInterfaceId': 'string' }, ], 'VpcId': 'string', 'SubnetId': 'string', 'SecurityGroupId': 'string', 'AccessType': 'Private'|'CustomerOwnedIp', 'CustomerOwnedIpv4Pool': 'string', 'FailedReason': { 'ErrorCode': 'string', 'Message': 'string' } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Endpoints** *(list) --* The list of endpoints associated with the specified Outpost that have been shared by Amazon Web Services Resource Access Manager (RAM). * *(dict) --* Amazon S3 on Outposts Access Points simplify managing data access at scale for shared datasets in S3 on Outposts. S3 on Outposts uses endpoints to connect to Outposts buckets so that you can perform actions within your virtual private cloud (VPC). For more information, see Accessing S3 on Outposts using VPC-only access points in the *Amazon Simple Storage Service User Guide*. * **EndpointArn** *(string) --* The Amazon Resource Name (ARN) of the endpoint. * **OutpostsId** *(string) --* The ID of the Outposts. * **CidrBlock** *(string) --* The VPC CIDR committed by this endpoint. * **Status** *(string) --* The status of the endpoint. * **CreationTime** *(datetime) --* The time the endpoint was created. * **NetworkInterfaces** *(list) --* The network interface of the endpoint. * *(dict) --* The container for the network interface. * **NetworkInterfaceId** *(string) --* The ID for the network interface. * **VpcId** *(string) --* The ID of the VPC used for the endpoint. * **SubnetId** *(string) --* The ID of the subnet used for the endpoint. * **SecurityGroupId** *(string) --* The ID of the security group used for the endpoint. * **AccessType** *(string) --* The type of connectivity used to access the Amazon S3 on Outposts endpoint. * **CustomerOwnedIpv4Pool** *(string) --* The ID of the customer-owned IPv4 address pool used for the endpoint. * **FailedReason** *(dict) --* The failure reason, if any, for a create or delete endpoint operation. * **ErrorCode** *(string) --* The failure code, if any, for a create or delete endpoint operation. * **Message** *(string) --* Additional error details describing the endpoint failure and recommended action. * **NextToken** *(string) --* If the number of endpoints associated with the specified Outpost exceeds "MaxResults", you can include this value in subsequent calls to this operation to retrieve more results. **Exceptions** * "S3Outposts.Client.exceptions.InternalServerException" * "S3Outposts.Client.exceptions.ResourceNotFoundException" * "S3Outposts.Client.exceptions.AccessDeniedException" * "S3Outposts.Client.exceptions.ValidationException" * "S3Outposts.Client.exceptions.ThrottlingException" S3Outposts / Client / list_outposts_with_s3 list_outposts_with_s3 ********************* S3Outposts.Client.list_outposts_with_s3(**kwargs) Lists the Outposts with S3 on Outposts capacity for your Amazon Web Services account. Includes S3 on Outposts that you have access to as the Outposts owner, or as a shared user from Resource Access Manager (RAM). See also: AWS API Documentation **Request Syntax** response = client.list_outposts_with_s3( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*string*) -- When you can get additional results from the "ListOutpostsWithS3" call, a "NextToken" parameter is returned in the output. You can then pass in a subsequent command to the "NextToken" parameter to continue listing additional Outposts. * **MaxResults** (*integer*) -- The maximum number of Outposts to return. The limit is 100. Return type: dict Returns: **Response Syntax** { 'Outposts': [ { 'OutpostArn': 'string', 'S3OutpostArn': 'string', 'OutpostId': 'string', 'OwnerId': 'string', 'CapacityInBytes': 123 }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Outposts** *(list) --* Returns the list of Outposts that have the following characteristics: * outposts that have S3 provisioned * outposts that are "Active" (not pending any provisioning nor decommissioned) * outposts to which the the calling Amazon Web Services account has access * *(dict) --* Contains the details for the Outpost object. * **OutpostArn** *(string) --* Specifies the unique Amazon Resource Name (ARN) for the outpost. * **S3OutpostArn** *(string) --* Specifies the unique S3 on Outposts ARN for use with Resource Access Manager (RAM). * **OutpostId** *(string) --* Specifies the unique identifier for the outpost. * **OwnerId** *(string) --* Returns the Amazon Web Services account ID of the outpost owner. Useful for comparing owned versus shared outposts. * **CapacityInBytes** *(integer) --* The Amazon S3 capacity of the outpost in bytes. * **NextToken** *(string) --* Returns a token that you can use to call "ListOutpostsWithS3" again and receive additional results, if there are any. **Exceptions** * "S3Outposts.Client.exceptions.InternalServerException" * "S3Outposts.Client.exceptions.AccessDeniedException" * "S3Outposts.Client.exceptions.ValidationException" * "S3Outposts.Client.exceptions.ThrottlingException" S3Outposts / Client / get_paginator get_paginator ************* S3Outposts.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. S3Outposts / Client / can_paginate can_paginate ************ S3Outposts.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. S3Outposts / Client / delete_endpoint delete_endpoint *************** S3Outposts.Client.delete_endpoint(**kwargs) Deletes an endpoint. Note: It can take up to 5 minutes for this action to finish. Related actions include: * CreateEndpoint * ListEndpoints See also: AWS API Documentation **Request Syntax** response = client.delete_endpoint( EndpointId='string', OutpostId='string' ) Parameters: * **EndpointId** (*string*) -- **[REQUIRED]** The ID of the endpoint. * **OutpostId** (*string*) -- **[REQUIRED]** The ID of the Outposts. Returns: None **Exceptions** * "S3Outposts.Client.exceptions.InternalServerException" * "S3Outposts.Client.exceptions.AccessDeniedException" * "S3Outposts.Client.exceptions.ResourceNotFoundException" * "S3Outposts.Client.exceptions.ValidationException" * "S3Outposts.Client.exceptions.ThrottlingException" * "S3Outposts.Client.exceptions.OutpostOfflineException" S3Outposts / Client / get_waiter get_waiter ********** S3Outposts.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" S3Outposts / Client / list_endpoints list_endpoints ************** S3Outposts.Client.list_endpoints(**kwargs) Lists endpoints associated with the specified Outpost. Related actions include: * CreateEndpoint * DeleteEndpoint See also: AWS API Documentation **Request Syntax** response = client.list_endpoints( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*string*) -- If a previous response from this operation included a "NextToken" value, provide that value here to retrieve the next page of results. * **MaxResults** (*integer*) -- The maximum number of endpoints that will be returned in the response. Return type: dict Returns: **Response Syntax** { 'Endpoints': [ { 'EndpointArn': 'string', 'OutpostsId': 'string', 'CidrBlock': 'string', 'Status': 'Pending'|'Available'|'Deleting'|'Create_Failed'|'Delete_Failed', 'CreationTime': datetime(2015, 1, 1), 'NetworkInterfaces': [ { 'NetworkInterfaceId': 'string' }, ], 'VpcId': 'string', 'SubnetId': 'string', 'SecurityGroupId': 'string', 'AccessType': 'Private'|'CustomerOwnedIp', 'CustomerOwnedIpv4Pool': 'string', 'FailedReason': { 'ErrorCode': 'string', 'Message': 'string' } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Endpoints** *(list) --* The list of endpoints associated with the specified Outpost. * *(dict) --* Amazon S3 on Outposts Access Points simplify managing data access at scale for shared datasets in S3 on Outposts. S3 on Outposts uses endpoints to connect to Outposts buckets so that you can perform actions within your virtual private cloud (VPC). For more information, see Accessing S3 on Outposts using VPC-only access points in the *Amazon Simple Storage Service User Guide*. * **EndpointArn** *(string) --* The Amazon Resource Name (ARN) of the endpoint. * **OutpostsId** *(string) --* The ID of the Outposts. * **CidrBlock** *(string) --* The VPC CIDR committed by this endpoint. * **Status** *(string) --* The status of the endpoint. * **CreationTime** *(datetime) --* The time the endpoint was created. * **NetworkInterfaces** *(list) --* The network interface of the endpoint. * *(dict) --* The container for the network interface. * **NetworkInterfaceId** *(string) --* The ID for the network interface. * **VpcId** *(string) --* The ID of the VPC used for the endpoint. * **SubnetId** *(string) --* The ID of the subnet used for the endpoint. * **SecurityGroupId** *(string) --* The ID of the security group used for the endpoint. * **AccessType** *(string) --* The type of connectivity used to access the Amazon S3 on Outposts endpoint. * **CustomerOwnedIpv4Pool** *(string) --* The ID of the customer-owned IPv4 address pool used for the endpoint. * **FailedReason** *(dict) --* The failure reason, if any, for a create or delete endpoint operation. * **ErrorCode** *(string) --* The failure code, if any, for a create or delete endpoint operation. * **Message** *(string) --* Additional error details describing the endpoint failure and recommended action. * **NextToken** *(string) --* If the number of endpoints associated with the specified Outpost exceeds "MaxResults", you can include this value in subsequent calls to this operation to retrieve more results. **Exceptions** * "S3Outposts.Client.exceptions.InternalServerException" * "S3Outposts.Client.exceptions.ResourceNotFoundException" * "S3Outposts.Client.exceptions.AccessDeniedException" * "S3Outposts.Client.exceptions.ValidationException" * "S3Outposts.Client.exceptions.ThrottlingException" S3Outposts / Client / close close ***** S3Outposts.Client.close() Closes underlying endpoint connections. S3Outposts / Client / create_endpoint create_endpoint *************** S3Outposts.Client.create_endpoint(**kwargs) Creates an endpoint and associates it with the specified Outpost. Note: It can take up to 5 minutes for this action to finish. Related actions include: * DeleteEndpoint * ListEndpoints See also: AWS API Documentation **Request Syntax** response = client.create_endpoint( OutpostId='string', SubnetId='string', SecurityGroupId='string', AccessType='Private'|'CustomerOwnedIp', CustomerOwnedIpv4Pool='string' ) Parameters: * **OutpostId** (*string*) -- **[REQUIRED]** The ID of the Outposts. * **SubnetId** (*string*) -- **[REQUIRED]** The ID of the subnet in the selected VPC. The endpoint subnet must belong to the Outpost that has Amazon S3 on Outposts provisioned. * **SecurityGroupId** (*string*) -- **[REQUIRED]** The ID of the security group to use with the endpoint. * **AccessType** (*string*) -- The type of access for the network connectivity for the Amazon S3 on Outposts endpoint. To use the Amazon Web Services VPC, choose "Private". To use the endpoint with an on-premises network, choose "CustomerOwnedIp". If you choose "CustomerOwnedIp", you must also provide the customer-owned IP address pool (CoIP pool). Note: "Private" is the default access type value. * **CustomerOwnedIpv4Pool** (*string*) -- The ID of the customer-owned IPv4 address pool (CoIP pool) for the endpoint. IP addresses are allocated from this pool for the endpoint. Return type: dict Returns: **Response Syntax** { 'EndpointArn': 'string' } **Response Structure** * *(dict) --* * **EndpointArn** *(string) --* The Amazon Resource Name (ARN) of the endpoint. **Exceptions** * "S3Outposts.Client.exceptions.InternalServerException" * "S3Outposts.Client.exceptions.ValidationException" * "S3Outposts.Client.exceptions.AccessDeniedException" * "S3Outposts.Client.exceptions.ResourceNotFoundException" * "S3Outposts.Client.exceptions.ConflictException" * "S3Outposts.Client.exceptions.ThrottlingException" * "S3Outposts.Client.exceptions.OutpostOfflineException" S3Tables ******** Client ====== class S3Tables.Client A low-level client representing Amazon S3 Tables An Amazon S3 table represents a structured dataset consisting of tabular data in Apache Parquet format and related metadata. This data is stored inside an S3 table as a subresource. All tables in a table bucket are stored in the Apache Iceberg table format. Through integration with the Amazon Web Services Glue Data Catalog you can interact with your tables using Amazon Web Services analytics services, such as Amazon Athena and Amazon Redshift. Amazon S3 manages maintenance of your tables through automatic file compaction and snapshot management. For more information, see Amazon S3 table buckets. import boto3 client = boto3.client('s3tables') These are the available methods: * can_paginate * close * create_namespace * create_table * create_table_bucket * delete_namespace * delete_table * delete_table_bucket * delete_table_bucket_encryption * delete_table_bucket_policy * delete_table_policy * get_namespace * get_paginator * get_table * get_table_bucket * get_table_bucket_encryption * get_table_bucket_maintenance_configuration * get_table_bucket_policy * get_table_encryption * get_table_maintenance_configuration * get_table_maintenance_job_status * get_table_metadata_location * get_table_policy * get_waiter * list_namespaces * list_table_buckets * list_tables * put_table_bucket_encryption * put_table_bucket_maintenance_configuration * put_table_bucket_policy * put_table_maintenance_configuration * put_table_policy * rename_table * update_table_metadata_location Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListNamespaces * ListTableBuckets * ListTables S3Tables / Paginator / ListNamespaces ListNamespaces ************** class S3Tables.Paginator.ListNamespaces paginator = client.get_paginator('list_namespaces') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Tables.Client.list_namespaces()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( tableBucketARN='string', prefix='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **prefix** (*string*) -- The prefix of the namespaces. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'namespaces': [ { 'namespace': [ 'string', ], 'createdAt': datetime(2015, 1, 1), 'createdBy': 'string', 'ownerAccountId': 'string', 'namespaceId': 'string', 'tableBucketId': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **namespaces** *(list) --* A list of namespaces. * *(dict) --* Contains details about a namespace. * **namespace** *(list) --* The name of the namespace. * *(string) --* * **createdAt** *(datetime) --* The date and time the namespace was created at. * **createdBy** *(string) --* The ID of the account that created the namespace. * **ownerAccountId** *(string) --* The ID of the account that owns the namespace. * **namespaceId** *(string) --* The system-assigned unique identifier for the namespace. * **tableBucketId** *(string) --* The system-assigned unique identifier for the table bucket that contains this namespace. * **NextToken** *(string) --* A token to resume pagination. S3Tables / Paginator / ListTables ListTables ********** class S3Tables.Paginator.ListTables paginator = client.get_paginator('list_tables') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Tables.Client.list_tables()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( tableBucketARN='string', namespace='string', prefix='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon resource Name (ARN) of the table bucket. * **namespace** (*string*) -- The namespace of the tables. * **prefix** (*string*) -- The prefix of the tables. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'tables': [ { 'namespace': [ 'string', ], 'name': 'string', 'type': 'customer'|'aws', 'tableARN': 'string', 'createdAt': datetime(2015, 1, 1), 'modifiedAt': datetime(2015, 1, 1), 'namespaceId': 'string', 'tableBucketId': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **tables** *(list) --* A list of tables. * *(dict) --* Contains details about a table. * **namespace** *(list) --* The name of the namespace. * *(string) --* * **name** *(string) --* The name of the table. * **type** *(string) --* The type of the table. * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **createdAt** *(datetime) --* The date and time the table was created at. * **modifiedAt** *(datetime) --* The date and time the table was last modified at. * **namespaceId** *(string) --* The unique identifier for the namespace that contains this table. * **tableBucketId** *(string) --* The unique identifier for the table bucket that contains this table. * **NextToken** *(string) --* A token to resume pagination. S3Tables / Paginator / ListTableBuckets ListTableBuckets **************** class S3Tables.Paginator.ListTableBuckets paginator = client.get_paginator('list_table_buckets') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Tables.Client.list_table_buckets()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( prefix='string', type='customer'|'aws', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **prefix** (*string*) -- The prefix of the table buckets. * **type** (*string*) -- The type of table buckets to filter by in the list. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'tableBuckets': [ { 'arn': 'string', 'name': 'string', 'ownerAccountId': 'string', 'createdAt': datetime(2015, 1, 1), 'tableBucketId': 'string', 'type': 'customer'|'aws' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **tableBuckets** *(list) --* A list of table buckets. * *(dict) --* Contains details about a table bucket. * **arn** *(string) --* The Amazon Resource Name (ARN) of the table bucket. * **name** *(string) --* The name of the table bucket. * **ownerAccountId** *(string) --* The ID of the account that owns the table bucket. * **createdAt** *(datetime) --* The date and time the table bucket was created at. * **tableBucketId** *(string) --* The system-assigned unique identifier for the table bucket. * **type** *(string) --* The type of the table bucket. * **NextToken** *(string) --* A token to resume pagination. S3Tables / Client / get_paginator get_paginator ************* S3Tables.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. S3Tables / Client / get_table_bucket_maintenance_configuration get_table_bucket_maintenance_configuration ****************************************** S3Tables.Client.get_table_bucket_maintenance_configuration(**kwargs) Gets details about a maintenance configuration for a given table bucket. For more information, see Amazon S3 table bucket maintenance in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetTableBucketMaintenanceConfiguration" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_bucket_maintenance_configuration( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket associated with the maintenance configuration. Return type: dict Returns: **Response Syntax** { 'tableBucketARN': 'string', 'configuration': { 'string': { 'status': 'enabled'|'disabled', 'settings': { 'icebergUnreferencedFileRemoval': { 'unreferencedDays': 123, 'nonCurrentDays': 123 } } } } } **Response Structure** * *(dict) --* * **tableBucketARN** *(string) --* The Amazon Resource Name (ARN) of the table bucket associated with the maintenance configuration. * **configuration** *(dict) --* Details about the maintenance configuration for the table bucket. * *(string) --* * *(dict) --* Details about the values that define the maintenance configuration for a table bucket. * **status** *(string) --* The status of the maintenance configuration. * **settings** *(dict) --* Contains details about the settings of the maintenance configuration. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "icebergUnreferencedFileRemoval". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **icebergUnreferencedFileRemoval** *(dict) --* The unreferenced file removal settings for the table bucket. * **unreferencedDays** *(integer) --* The number of days an object has to be unreferenced before it is marked as non-current. * **nonCurrentDays** *(integer) --* The number of days an object has to be non-current before it is deleted. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / put_table_maintenance_configuration put_table_maintenance_configuration *********************************** S3Tables.Client.put_table_maintenance_configuration(**kwargs) Creates a new maintenance configuration or replaces an existing maintenance configuration for a table. For more information, see S3 Tables maintenance in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:PutTableMaintenanceConfiguration" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_table_maintenance_configuration( tableBucketARN='string', namespace='string', name='string', type='icebergCompaction'|'icebergSnapshotManagement', value={ 'status': 'enabled'|'disabled', 'settings': { 'icebergCompaction': { 'targetFileSizeMB': 123, 'strategy': 'auto'|'binpack'|'sort'|'z-order' }, 'icebergSnapshotManagement': { 'minSnapshotsToKeep': 123, 'maxSnapshotAgeHours': 123 } } } ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table associated with the maintenance configuration. * **namespace** (*string*) -- **[REQUIRED]** The namespace of the table. * **name** (*string*) -- **[REQUIRED]** The name of the maintenance configuration. * **type** (*string*) -- **[REQUIRED]** The type of the maintenance configuration. * **value** (*dict*) -- **[REQUIRED]** Defines the values of the maintenance configuration for the table. * **status** *(string) --* The status of the maintenance configuration. * **settings** *(dict) --* Contains details about the settings for the maintenance configuration. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "icebergCompaction", "icebergSnapshotManagement". * **icebergCompaction** *(dict) --* Contains details about the Iceberg compaction settings for the table. * **targetFileSizeMB** *(integer) --* The target file size for the table in MB. * **strategy** *(string) --* The compaction strategy to use for the table. This determines how files are selected and combined during compaction operations. * **icebergSnapshotManagement** *(dict) --* Contains details about the Iceberg snapshot management settings for the table. * **minSnapshotsToKeep** *(integer) --* The minimum number of snapshots to keep. * **maxSnapshotAgeHours** *(integer) --* The maximum age of a snapshot before it can be expired. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / rename_table rename_table ************ S3Tables.Client.rename_table(**kwargs) Renames a table or a namespace. For more information, see S3 Tables in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:RenameTable" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.rename_table( tableBucketARN='string', namespace='string', name='string', newNamespaceName='string', newName='string', versionToken='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The current name of the table. * **newNamespaceName** (*string*) -- The new name for the namespace. * **newName** (*string*) -- The new name for the table. * **versionToken** (*string*) -- The version token of the table. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / can_paginate can_paginate ************ S3Tables.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. S3Tables / Client / list_namespaces list_namespaces *************** S3Tables.Client.list_namespaces(**kwargs) Lists the namespaces within a table bucket. For more information, see Table namespaces in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:ListNamespaces" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_namespaces( tableBucketARN='string', prefix='string', continuationToken='string', maxNamespaces=123 ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **prefix** (*string*) -- The prefix of the namespaces. * **continuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on this bucket with a token. "ContinuationToken" is obfuscated and is not a real key. You can use this "ContinuationToken" for pagination of the list results. * **maxNamespaces** (*integer*) -- The maximum number of namespaces to return in the list. Return type: dict Returns: **Response Syntax** { 'namespaces': [ { 'namespace': [ 'string', ], 'createdAt': datetime(2015, 1, 1), 'createdBy': 'string', 'ownerAccountId': 'string', 'namespaceId': 'string', 'tableBucketId': 'string' }, ], 'continuationToken': 'string' } **Response Structure** * *(dict) --* * **namespaces** *(list) --* A list of namespaces. * *(dict) --* Contains details about a namespace. * **namespace** *(list) --* The name of the namespace. * *(string) --* * **createdAt** *(datetime) --* The date and time the namespace was created at. * **createdBy** *(string) --* The ID of the account that created the namespace. * **ownerAccountId** *(string) --* The ID of the account that owns the namespace. * **namespaceId** *(string) --* The system-assigned unique identifier for the namespace. * **tableBucketId** *(string) --* The system-assigned unique identifier for the table bucket that contains this namespace. * **continuationToken** *(string) --* The "ContinuationToken" for pagination of the list results. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / put_table_bucket_policy put_table_bucket_policy *********************** S3Tables.Client.put_table_bucket_policy(**kwargs) Creates a new maintenance configuration or replaces an existing table bucket policy for a table bucket. For more information, see Adding a table bucket policy in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:PutTableBucketPolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_table_bucket_policy( tableBucketARN='string', resourcePolicy='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **resourcePolicy** (*string*) -- **[REQUIRED]** The "JSON" that defines the policy. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / delete_namespace delete_namespace **************** S3Tables.Client.delete_namespace(**kwargs) Deletes a namespace. For more information, see Delete a namespace in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:DeleteNamespace" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_namespace( tableBucketARN='string', namespace='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket associated with the namespace. * **namespace** (*string*) -- **[REQUIRED]** The name of the namespace. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / create_namespace create_namespace **************** S3Tables.Client.create_namespace(**kwargs) Creates a namespace. A namespace is a logical grouping of tables within your table bucket, which you can use to organize tables. For more information, see Create a namespace in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:CreateNamespace" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.create_namespace( tableBucketARN='string', namespace=[ 'string', ] ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket to create the namespace in. * **namespace** (*list*) -- **[REQUIRED]** A name for the namespace. * *(string) --* Return type: dict Returns: **Response Syntax** { 'tableBucketARN': 'string', 'namespace': [ 'string', ] } **Response Structure** * *(dict) --* * **tableBucketARN** *(string) --* The Amazon Resource Name (ARN) of the table bucket the namespace was created in. * **namespace** *(list) --* The name of the namespace. * *(string) --* **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table get_table ********* S3Tables.Client.get_table(**kwargs) Gets details about a table. For more information, see S3 Tables in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetTable" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table( tableBucketARN='string', namespace='string', name='string', tableArn='string' ) Parameters: * **tableBucketARN** (*string*) -- The Amazon Resource Name (ARN) of the table bucket associated with the table. * **namespace** (*string*) -- The name of the namespace the table is associated with. * **name** (*string*) -- The name of the table. * **tableArn** (*string*) -- The Amazon Resource Name (ARN) of the table. Return type: dict Returns: **Response Syntax** { 'name': 'string', 'type': 'customer'|'aws', 'tableARN': 'string', 'namespace': [ 'string', ], 'namespaceId': 'string', 'versionToken': 'string', 'metadataLocation': 'string', 'warehouseLocation': 'string', 'createdAt': datetime(2015, 1, 1), 'createdBy': 'string', 'managedByService': 'string', 'modifiedAt': datetime(2015, 1, 1), 'modifiedBy': 'string', 'ownerAccountId': 'string', 'format': 'ICEBERG', 'tableBucketId': 'string' } **Response Structure** * *(dict) --* * **name** *(string) --* The name of the table. * **type** *(string) --* The type of the table. * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **namespace** *(list) --* The namespace associated with the table. * *(string) --* * **namespaceId** *(string) --* The unique identifier of the namespace containing this table. * **versionToken** *(string) --* The version token of the table. * **metadataLocation** *(string) --* The metadata location of the table. * **warehouseLocation** *(string) --* The warehouse location of the table. * **createdAt** *(datetime) --* The date and time the table bucket was created at. * **createdBy** *(string) --* The ID of the account that created the table. * **managedByService** *(string) --* The service that manages the table. * **modifiedAt** *(datetime) --* The date and time the table was last modified on. * **modifiedBy** *(string) --* The ID of the account that last modified the table. * **ownerAccountId** *(string) --* The ID of the account that owns the table. * **format** *(string) --* The format of the table. * **tableBucketId** *(string) --* The unique identifier of the table bucket containing this table. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_bucket_encryption get_table_bucket_encryption *************************** S3Tables.Client.get_table_bucket_encryption(**kwargs) Gets the encryption configuration for a table bucket. Permissions You must have the "s3tables:GetTableBucketEncryption" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_bucket_encryption( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. Return type: dict Returns: **Response Syntax** { 'encryptionConfiguration': { 'sseAlgorithm': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } } **Response Structure** * *(dict) --* * **encryptionConfiguration** *(dict) --* The encryption configuration for the table bucket. * **sseAlgorithm** *(string) --* The server-side encryption algorithm to use. Valid values are "AES256" for S3-managed encryption keys, or "aws:kms" for Amazon Web Services KMS-managed encryption keys. If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption. * **kmsKeyArn** *(string) --* The Amazon Resource Name (ARN) of the KMS key to use for encryption. This field is required only when "sseAlgorithm" is set to "aws:kms". **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_policy get_table_policy **************** S3Tables.Client.get_table_policy(**kwargs) Gets details about a table policy. For more information, see Viewing a table policy in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetTablePolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_policy( tableBucketARN='string', namespace='string', name='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket that contains the table. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. Return type: dict Returns: **Response Syntax** { 'resourcePolicy': 'string' } **Response Structure** * *(dict) --* * **resourcePolicy** *(string) --* The "JSON" that defines the policy. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_waiter get_waiter ********** S3Tables.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" S3Tables / Client / create_table create_table ************ S3Tables.Client.create_table(**kwargs) Creates a new table associated with the given namespace in a table bucket. For more information, see Creating an Amazon S3 table in the *Amazon Simple Storage Service User Guide*. Permissions * You must have the "s3tables:CreateTable" permission to use this operation. * If you use this operation with the optional "metadata" request parameter you must have the "s3tables:PutTableData" permission. * If you use this operation with the optional "encryptionConfiguration" request parameter you must have the "s3tables:PutTableEncryption" permission. Note: Additionally, If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption. See also: AWS API Documentation **Request Syntax** response = client.create_table( tableBucketARN='string', namespace='string', name='string', format='ICEBERG', metadata={ 'iceberg': { 'schema': { 'fields': [ { 'name': 'string', 'type': 'string', 'required': True|False }, ] } } }, encryptionConfiguration={ 'sseAlgorithm': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket to create the table in. * **namespace** (*string*) -- **[REQUIRED]** The namespace to associated with the table. * **name** (*string*) -- **[REQUIRED]** The name for the table. * **format** (*string*) -- **[REQUIRED]** The format for the table. * **metadata** (*dict*) -- The metadata for the table. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "iceberg". * **iceberg** *(dict) --* Contains details about the metadata of an Iceberg table. * **schema** *(dict) --* **[REQUIRED]** The schema for an Iceberg table. * **fields** *(list) --* **[REQUIRED]** The schema fields for the table * *(dict) --* Contains details about a schema field. * **name** *(string) --* **[REQUIRED]** The name of the field. * **type** *(string) --* **[REQUIRED]** The field type. S3 Tables supports all Apache Iceberg primitive types. For more information, see the Apache Iceberg documentation. * **required** *(boolean) --* A Boolean value that specifies whether values are required for each row in this field. By default, this is "false" and null values are allowed in the field. If this is "true" the field does not allow null values. * **encryptionConfiguration** (*dict*) -- The encryption configuration to use for the table. This configuration specifies the encryption algorithm and, if using SSE-KMS, the KMS key to use for encrypting the table. Note: If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption. * **sseAlgorithm** *(string) --* **[REQUIRED]** The server-side encryption algorithm to use. Valid values are "AES256" for S3-managed encryption keys, or "aws:kms" for Amazon Web Services KMS-managed encryption keys. If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE- KMS encryption. * **kmsKeyArn** *(string) --* The Amazon Resource Name (ARN) of the KMS key to use for encryption. This field is required only when "sseAlgorithm" is set to "aws:kms". Return type: dict Returns: **Response Syntax** { 'tableARN': 'string', 'versionToken': 'string' } **Response Structure** * *(dict) --* * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **versionToken** *(string) --* The version token of the table. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / delete_table_bucket delete_table_bucket ******************* S3Tables.Client.delete_table_bucket(**kwargs) Deletes a table bucket. For more information, see Deleting a table bucket in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:DeleteTableBucket" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_table_bucket( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / put_table_bucket_encryption put_table_bucket_encryption *************************** S3Tables.Client.put_table_bucket_encryption(**kwargs) Sets the encryption configuration for a table bucket. Permissions You must have the "s3tables:PutTableBucketEncryption" permission to use this operation. Note: If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption in the *Amazon Simple Storage Service User Guide*. See also: AWS API Documentation **Request Syntax** response = client.put_table_bucket_encryption( tableBucketARN='string', encryptionConfiguration={ 'sseAlgorithm': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **encryptionConfiguration** (*dict*) -- **[REQUIRED]** The encryption configuration to apply to the table bucket. * **sseAlgorithm** *(string) --* **[REQUIRED]** The server-side encryption algorithm to use. Valid values are "AES256" for S3-managed encryption keys, or "aws:kms" for Amazon Web Services KMS-managed encryption keys. If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE- KMS encryption. * **kmsKeyArn** *(string) --* The Amazon Resource Name (ARN) of the KMS key to use for encryption. This field is required only when "sseAlgorithm" is set to "aws:kms". Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / list_table_buckets list_table_buckets ****************** S3Tables.Client.list_table_buckets(**kwargs) Lists table buckets for your account. For more information, see S3 Table buckets in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:ListTableBuckets" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_table_buckets( prefix='string', continuationToken='string', maxBuckets=123, type='customer'|'aws' ) Parameters: * **prefix** (*string*) -- The prefix of the table buckets. * **continuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on this bucket with a token. "ContinuationToken" is obfuscated and is not a real key. You can use this "ContinuationToken" for pagination of the list results. * **maxBuckets** (*integer*) -- The maximum number of table buckets to return in the list. * **type** (*string*) -- The type of table buckets to filter by in the list. Return type: dict Returns: **Response Syntax** { 'tableBuckets': [ { 'arn': 'string', 'name': 'string', 'ownerAccountId': 'string', 'createdAt': datetime(2015, 1, 1), 'tableBucketId': 'string', 'type': 'customer'|'aws' }, ], 'continuationToken': 'string' } **Response Structure** * *(dict) --* * **tableBuckets** *(list) --* A list of table buckets. * *(dict) --* Contains details about a table bucket. * **arn** *(string) --* The Amazon Resource Name (ARN) of the table bucket. * **name** *(string) --* The name of the table bucket. * **ownerAccountId** *(string) --* The ID of the account that owns the table bucket. * **createdAt** *(datetime) --* The date and time the table bucket was created at. * **tableBucketId** *(string) --* The system-assigned unique identifier for the table bucket. * **type** *(string) --* The type of the table bucket. * **continuationToken** *(string) --* You can use this "ContinuationToken" for pagination of the list results. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / delete_table delete_table ************ S3Tables.Client.delete_table(**kwargs) Deletes a table. For more information, see Deleting an Amazon S3 table in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:DeleteTable" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_table( tableBucketARN='string', namespace='string', name='string', versionToken='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket that contains the table. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. * **versionToken** (*string*) -- The version token of the table. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / update_table_metadata_location update_table_metadata_location ****************************** S3Tables.Client.update_table_metadata_location(**kwargs) Updates the metadata location for a table. The metadata location of a table must be an S3 URI that begins with the table's warehouse location. The metadata location for an Apache Iceberg table must end with ".metadata.json", or if the metadata file is Gzip- compressed, ".metadata.json.gz". Permissions You must have the "s3tables:UpdateTableMetadataLocation" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.update_table_metadata_location( tableBucketARN='string', namespace='string', name='string', versionToken='string', metadataLocation='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **namespace** (*string*) -- **[REQUIRED]** The namespace of the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. * **versionToken** (*string*) -- **[REQUIRED]** The version token of the table. * **metadataLocation** (*string*) -- **[REQUIRED]** The new metadata location for the table. Return type: dict Returns: **Response Syntax** { 'name': 'string', 'tableARN': 'string', 'namespace': [ 'string', ], 'versionToken': 'string', 'metadataLocation': 'string' } **Response Structure** * *(dict) --* * **name** *(string) --* The name of the table. * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **namespace** *(list) --* The namespace the table is associated with. * *(string) --* * **versionToken** *(string) --* The version token of the table. * **metadataLocation** *(string) --* The metadata location of the table. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_bucket_policy get_table_bucket_policy *********************** S3Tables.Client.get_table_bucket_policy(**kwargs) Gets details about a table bucket policy. For more information, see Viewing a table bucket policy in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetTableBucketPolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_bucket_policy( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. Return type: dict Returns: **Response Syntax** { 'resourcePolicy': 'string' } **Response Structure** * *(dict) --* * **resourcePolicy** *(string) --* The "JSON" that defines the policy. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / delete_table_policy delete_table_policy ******************* S3Tables.Client.delete_table_policy(**kwargs) Deletes a table policy. For more information, see Deleting a table policy in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:DeleteTablePolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_table_policy( tableBucketARN='string', namespace='string', name='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket that contains the table. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The table name. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_namespace get_namespace ************* S3Tables.Client.get_namespace(**kwargs) Gets details about a namespace. For more information, see Table namespaces in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetNamespace" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_namespace( tableBucketARN='string', namespace='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **namespace** (*string*) -- **[REQUIRED]** The name of the namespace. Return type: dict Returns: **Response Syntax** { 'namespace': [ 'string', ], 'createdAt': datetime(2015, 1, 1), 'createdBy': 'string', 'ownerAccountId': 'string', 'namespaceId': 'string', 'tableBucketId': 'string' } **Response Structure** * *(dict) --* * **namespace** *(list) --* The name of the namespace. * *(string) --* * **createdAt** *(datetime) --* The date and time the namespace was created at. * **createdBy** *(string) --* The ID of the account that created the namespace. * **ownerAccountId** *(string) --* The ID of the account that owns the namespcace. * **namespaceId** *(string) --* The unique identifier of the namespace. * **tableBucketId** *(string) --* The unique identifier of the table bucket containing this namespace. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_maintenance_job_status get_table_maintenance_job_status ******************************** S3Tables.Client.get_table_maintenance_job_status(**kwargs) Gets the status of a maintenance job for a table. For more information, see S3 Tables maintenance in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetTableMaintenanceJobStatus" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_maintenance_job_status( tableBucketARN='string', namespace='string', name='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **namespace** (*string*) -- **[REQUIRED]** The name of the namespace the table is associated with. * **name** (*string*) -- **[REQUIRED]** The name of the maintenance job. Return type: dict Returns: **Response Syntax** { 'tableARN': 'string', 'status': { 'string': { 'status': 'Not_Yet_Run'|'Successful'|'Failed'|'Disabled', 'lastRunTimestamp': datetime(2015, 1, 1), 'failureMessage': 'string' } } } **Response Structure** * *(dict) --* * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **status** *(dict) --* The status of the maintenance job. * *(string) --* * *(dict) --* Details about the status of a maintenance job. * **status** *(string) --* The status of the job. * **lastRunTimestamp** *(datetime) --* The date and time that the maintenance job was last run. * **failureMessage** *(string) --* The failure message of a failed job. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_maintenance_configuration get_table_maintenance_configuration *********************************** S3Tables.Client.get_table_maintenance_configuration(**kwargs) Gets details about the maintenance configuration of a table. For more information, see S3 Tables maintenance in the *Amazon Simple Storage Service User Guide*. Permissions * You must have the "s3tables:GetTableMaintenanceConfiguration" permission to use this operation. * You must have the "s3tables:GetTableData" permission to use set the compaction strategy to "sort" or "zorder". See also: AWS API Documentation **Request Syntax** response = client.get_table_maintenance_configuration( tableBucketARN='string', namespace='string', name='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. Return type: dict Returns: **Response Syntax** { 'tableARN': 'string', 'configuration': { 'string': { 'status': 'enabled'|'disabled', 'settings': { 'icebergCompaction': { 'targetFileSizeMB': 123, 'strategy': 'auto'|'binpack'|'sort'|'z-order' }, 'icebergSnapshotManagement': { 'minSnapshotsToKeep': 123, 'maxSnapshotAgeHours': 123 } } } } } **Response Structure** * *(dict) --* * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **configuration** *(dict) --* Details about the maintenance configuration for the table bucket. * *(string) --* * *(dict) --* Contains the values that define a maintenance configuration for a table. * **status** *(string) --* The status of the maintenance configuration. * **settings** *(dict) --* Contains details about the settings for the maintenance configuration. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "icebergCompaction", "icebergSnapshotManagement". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **icebergCompaction** *(dict) --* Contains details about the Iceberg compaction settings for the table. * **targetFileSizeMB** *(integer) --* The target file size for the table in MB. * **strategy** *(string) --* The compaction strategy to use for the table. This determines how files are selected and combined during compaction operations. * **icebergSnapshotManagement** *(dict) --* Contains details about the Iceberg snapshot management settings for the table. * **minSnapshotsToKeep** *(integer) --* The minimum number of snapshots to keep. * **maxSnapshotAgeHours** *(integer) --* The maximum age of a snapshot before it can be expired. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_bucket get_table_bucket **************** S3Tables.Client.get_table_bucket(**kwargs) Gets details on a table bucket. For more information, see Viewing details about an Amazon S3 table bucket in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:GetTableBucket" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_bucket( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. Return type: dict Returns: **Response Syntax** { 'arn': 'string', 'name': 'string', 'ownerAccountId': 'string', 'createdAt': datetime(2015, 1, 1), 'tableBucketId': 'string', 'type': 'customer'|'aws' } **Response Structure** * *(dict) --* * **arn** *(string) --* The Amazon Resource Name (ARN) of the table bucket. * **name** *(string) --* The name of the table bucket * **ownerAccountId** *(string) --* The ID of the account that owns the table bucket. * **createdAt** *(datetime) --* The date and time the table bucket was created. * **tableBucketId** *(string) --* The unique identifier of the table bucket. * **type** *(string) --* The type of the table bucket. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / close close ***** S3Tables.Client.close() Closes underlying endpoint connections. S3Tables / Client / delete_table_bucket_policy delete_table_bucket_policy ************************** S3Tables.Client.delete_table_bucket_policy(**kwargs) Deletes a table bucket policy. For more information, see Deleting a table bucket policy in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:DeleteTableBucketPolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_table_bucket_policy( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / create_table_bucket create_table_bucket ******************* S3Tables.Client.create_table_bucket(**kwargs) Creates a table bucket. For more information, see Creating a table bucket in the *Amazon Simple Storage Service User Guide*. Permissions * You must have the "s3tables:CreateTableBucket" permission to use this operation. * If you use this operation with the optional "encryptionConfiguration" parameter you must have the "s3tables:PutTableBucketEncryption" permission. See also: AWS API Documentation **Request Syntax** response = client.create_table_bucket( name='string', encryptionConfiguration={ 'sseAlgorithm': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } ) Parameters: * **name** (*string*) -- **[REQUIRED]** The name for the table bucket. * **encryptionConfiguration** (*dict*) -- The encryption configuration to use for the table bucket. This configuration specifies the default encryption settings that will be applied to all tables created in this bucket unless overridden at the table level. The configuration includes the encryption algorithm and, if using SSE-KMS, the KMS key to use. * **sseAlgorithm** *(string) --* **[REQUIRED]** The server-side encryption algorithm to use. Valid values are "AES256" for S3-managed encryption keys, or "aws:kms" for Amazon Web Services KMS-managed encryption keys. If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE- KMS encryption. * **kmsKeyArn** *(string) --* The Amazon Resource Name (ARN) of the KMS key to use for encryption. This field is required only when "sseAlgorithm" is set to "aws:kms". Return type: dict Returns: **Response Syntax** { 'arn': 'string' } **Response Structure** * *(dict) --* * **arn** *(string) --* The Amazon Resource Name (ARN) of the table bucket. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_metadata_location get_table_metadata_location *************************** S3Tables.Client.get_table_metadata_location(**kwargs) Gets the location of the table metadata. Permissions You must have the "s3tables:GetTableMetadataLocation" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_metadata_location( tableBucketARN='string', namespace='string', name='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. * **namespace** (*string*) -- **[REQUIRED]** The namespace of the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. Return type: dict Returns: **Response Syntax** { 'versionToken': 'string', 'metadataLocation': 'string', 'warehouseLocation': 'string' } **Response Structure** * *(dict) --* * **versionToken** *(string) --* The version token. * **metadataLocation** *(string) --* The metadata location. * **warehouseLocation** *(string) --* The warehouse location. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / delete_table_bucket_encryption delete_table_bucket_encryption ****************************** S3Tables.Client.delete_table_bucket_encryption(**kwargs) Deletes the encryption configuration for a table bucket. Permissions You must have the "s3tables:DeleteTableBucketEncryption" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_table_bucket_encryption( tableBucketARN='string' ) Parameters: **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / put_table_bucket_maintenance_configuration put_table_bucket_maintenance_configuration ****************************************** S3Tables.Client.put_table_bucket_maintenance_configuration(**kwargs) Creates a new maintenance configuration or replaces an existing maintenance configuration for a table bucket. For more information, see Amazon S3 table bucket maintenance in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:PutTableBucketMaintenanceConfiguration" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_table_bucket_maintenance_configuration( tableBucketARN='string', type='icebergUnreferencedFileRemoval', value={ 'status': 'enabled'|'disabled', 'settings': { 'icebergUnreferencedFileRemoval': { 'unreferencedDays': 123, 'nonCurrentDays': 123 } } } ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket associated with the maintenance configuration. * **type** (*string*) -- **[REQUIRED]** The type of the maintenance configuration. * **value** (*dict*) -- **[REQUIRED]** Defines the values of the maintenance configuration for the table bucket. * **status** *(string) --* The status of the maintenance configuration. * **settings** *(dict) --* Contains details about the settings of the maintenance configuration. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "icebergUnreferencedFileRemoval". * **icebergUnreferencedFileRemoval** *(dict) --* The unreferenced file removal settings for the table bucket. * **unreferencedDays** *(integer) --* The number of days an object has to be unreferenced before it is marked as non-current. * **nonCurrentDays** *(integer) --* The number of days an object has to be non-current before it is deleted. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / list_tables list_tables *********** S3Tables.Client.list_tables(**kwargs) List tables in the given table bucket. For more information, see S3 Tables in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:ListTables" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_tables( tableBucketARN='string', namespace='string', prefix='string', continuationToken='string', maxTables=123 ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon resource Name (ARN) of the table bucket. * **namespace** (*string*) -- The namespace of the tables. * **prefix** (*string*) -- The prefix of the tables. * **continuationToken** (*string*) -- "ContinuationToken" indicates to Amazon S3 that the list is being continued on this bucket with a token. "ContinuationToken" is obfuscated and is not a real key. You can use this "ContinuationToken" for pagination of the list results. * **maxTables** (*integer*) -- The maximum number of tables to return. Return type: dict Returns: **Response Syntax** { 'tables': [ { 'namespace': [ 'string', ], 'name': 'string', 'type': 'customer'|'aws', 'tableARN': 'string', 'createdAt': datetime(2015, 1, 1), 'modifiedAt': datetime(2015, 1, 1), 'namespaceId': 'string', 'tableBucketId': 'string' }, ], 'continuationToken': 'string' } **Response Structure** * *(dict) --* * **tables** *(list) --* A list of tables. * *(dict) --* Contains details about a table. * **namespace** *(list) --* The name of the namespace. * *(string) --* * **name** *(string) --* The name of the table. * **type** *(string) --* The type of the table. * **tableARN** *(string) --* The Amazon Resource Name (ARN) of the table. * **createdAt** *(datetime) --* The date and time the table was created at. * **modifiedAt** *(datetime) --* The date and time the table was last modified at. * **namespaceId** *(string) --* The unique identifier for the namespace that contains this table. * **tableBucketId** *(string) --* The unique identifier for the table bucket that contains this table. * **continuationToken** *(string) --* You can use this "ContinuationToken" for pagination of the list results. **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / put_table_policy put_table_policy **************** S3Tables.Client.put_table_policy(**kwargs) Creates a new maintenance configuration or replaces an existing table policy for a table. For more information, see Adding a table policy in the *Amazon Simple Storage Service User Guide*. Permissions You must have the "s3tables:PutTablePolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_table_policy( tableBucketARN='string', namespace='string', name='string', resourcePolicy='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket that contains the table. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. * **resourcePolicy** (*string*) -- **[REQUIRED]** The "JSON" that defines the policy. Returns: None **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.ConflictException" * "S3Tables.Client.exceptions.BadRequestException" S3Tables / Client / get_table_encryption get_table_encryption ******************** S3Tables.Client.get_table_encryption(**kwargs) Gets the encryption configuration for a table. Permissions You must have the "s3tables:GetTableEncryption" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_table_encryption( tableBucketARN='string', namespace='string', name='string' ) Parameters: * **tableBucketARN** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the table bucket containing the table. * **namespace** (*string*) -- **[REQUIRED]** The namespace associated with the table. * **name** (*string*) -- **[REQUIRED]** The name of the table. Return type: dict Returns: **Response Syntax** { 'encryptionConfiguration': { 'sseAlgorithm': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } } **Response Structure** * *(dict) --* * **encryptionConfiguration** *(dict) --* The encryption configuration for the table. * **sseAlgorithm** *(string) --* The server-side encryption algorithm to use. Valid values are "AES256" for S3-managed encryption keys, or "aws:kms" for Amazon Web Services KMS-managed encryption keys. If you choose SSE-KMS encryption you must grant the S3 Tables maintenance principal access to your KMS key. For more information, see Permissions requirements for S3 Tables SSE-KMS encryption. * **kmsKeyArn** *(string) --* The Amazon Resource Name (ARN) of the KMS key to use for encryption. This field is required only when "sseAlgorithm" is set to "aws:kms". **Exceptions** * "S3Tables.Client.exceptions.InternalServerErrorException" * "S3Tables.Client.exceptions.ForbiddenException" * "S3Tables.Client.exceptions.NotFoundException" * "S3Tables.Client.exceptions.AccessDeniedException" * "S3Tables.Client.exceptions.TooManyRequestsException" * "S3Tables.Client.exceptions.BadRequestException" S3Vectors ********* Client ====== class S3Vectors.Client A low-level client representing Amazon S3 Vectors Amazon S3 vector buckets are a bucket type to store and search vectors with sub-second search times. They are designed to provide dedicated API operations for you to interact with vectors to do similarity search. Within a vector bucket, you use a vector index to organize and logically group your vector data. When you make a write or read request, you direct it to a single vector index. You store your vector data as vectors. A vector contains a key (a name that you assign), a multi-dimensional vector, and, optionally, metadata that describes a vector. The key uniquely identifies the vector in a vector index. import boto3 client = boto3.client('s3vectors') These are the available methods: * can_paginate * close * create_index * create_vector_bucket * delete_index * delete_vector_bucket * delete_vector_bucket_policy * delete_vectors * get_index * get_paginator * get_vector_bucket * get_vector_bucket_policy * get_vectors * get_waiter * list_indexes * list_vector_buckets * list_vectors * put_vector_bucket_policy * put_vectors * query_vectors Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * ListIndexes * ListVectorBuckets * ListVectors S3Vectors / Paginator / ListVectorBuckets ListVectorBuckets ***************** class S3Vectors.Paginator.ListVectorBuckets paginator = client.get_paginator('list_vector_buckets') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Vectors.Client.list_vector_buckets()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( prefix='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **prefix** (*string*) -- Limits the response to vector buckets that begin with the specified prefix. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'vectorBuckets': [ { 'vectorBucketName': 'string', 'vectorBucketArn': 'string', 'creationTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **vectorBuckets** *(list) --* The list of vector buckets owned by the requester. * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Summary information about a vector bucket. * **vectorBucketName** *(string) --* The name of the vector bucket. * **vectorBucketArn** *(string) --* The Amazon Resource Name (ARN) of the vector bucket. * **creationTime** *(datetime) --* Date and time when the vector bucket was created. * **NextToken** *(string) --* A token to resume pagination. S3Vectors / Paginator / ListVectors ListVectors *********** class S3Vectors.Paginator.ListVectors paginator = client.get_paginator('list_vectors') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Vectors.Client.list_vectors()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( vectorBucketName='string', indexName='string', indexArn='string', segmentCount=123, segmentIndex=123, returnData=True|False, returnMetadata=True|False, PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket. * **indexName** (*string*) -- The name of the vector index. * **indexArn** (*string*) -- The Amazon resource Name (ARN) of the vector index. * **segmentCount** (*integer*) -- For a parallel "ListVectors" request, "segmentCount" represents the total number of vector segments into which the "ListVectors" operation will be divided. The value of "segmentCount" corresponds to the number of application workers that will perform the parallel "ListVectors" operation. For example, if you want to use four application threads to list vectors in a vector index, specify a "segmentCount" value of 4. If you specify a "segmentCount" value of 1, the "ListVectors" operation will be sequential rather than parallel. If you specify "segmentCount", you must also specify "segmentIndex". * **segmentIndex** (*integer*) -- For a parallel "ListVectors" request, "segmentIndex" is the index of the segment from which to list vectors in the current request. It identifies an individual segment to be listed by an application worker. Segment IDs are zero-based, so the first segment is always 0. For example, if you want to use four application threads to list vectors in a vector index, then the first thread specifies a "segmentIndex" value of 0, the second thread specifies 1, and so on. The value of "segmentIndex" must be less than the value provided for "segmentCount". If you provide "segmentIndex", you must also provide "segmentCount". * **returnData** (*boolean*) -- If true, the vector data of each vector will be included in the response. The default value is "false". * **returnMetadata** (*boolean*) -- If true, the metadata associated with each vector will be included in the response. The default value is "false". * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'vectors': [ { 'key': 'string', 'data': { 'float32': [ ..., ] }, 'metadata': {...}|[...]|123|123.4|'string'|True|None }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **vectors** *(list) --* Vectors in the current segment. * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. The attributes of a vector returned by the "ListVectors" operation. * **key** *(string) --* The name of the vector. * **data** *(dict) --* The vector data of the vector. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "float32". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **float32** *(list) --* The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed. * *(float) --* * **metadata** (*document*) -- Metadata about the vector. * **NextToken** *(string) --* A token to resume pagination. S3Vectors / Paginator / ListIndexes ListIndexes *********** class S3Vectors.Paginator.ListIndexes paginator = client.get_paginator('list_indexes') paginate(**kwargs) Creates an iterator that will paginate through responses from "S3Vectors.Client.list_indexes()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( vectorBucketName='string', vectorBucketArn='string', prefix='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector indexes. * **vectorBucketArn** (*string*) -- The ARN of the vector bucket that contains the vector indexes. * **prefix** (*string*) -- Limits the response to vector indexes that begin with the specified prefix. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'indexes': [ { 'vectorBucketName': 'string', 'indexName': 'string', 'indexArn': 'string', 'creationTime': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **indexes** *(list) --* The attributes of the vector indexes * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Summary information about a vector index. * **vectorBucketName** *(string) --* The name of the vector bucket that contains the vector index. * **indexName** *(string) --* The name of the vector index. * **indexArn** *(string) --* The Amazon Resource Name (ARN) of the vector index. * **creationTime** *(datetime) --* Date and time when the vector index was created. * **NextToken** *(string) --* A token to resume pagination. S3Vectors / Client / list_vector_buckets list_vector_buckets ******************* S3Vectors.Client.list_vector_buckets(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Returns a list of all the vector buckets that are owned by the authenticated sender of the request. Permissions You must have the "s3vectors:ListVectorBuckets" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_vector_buckets( maxResults=123, nextToken='string', prefix='string' ) Parameters: * **maxResults** (*integer*) -- The maximum number of vector buckets to be returned in the response. * **nextToken** (*string*) -- The previous pagination token. * **prefix** (*string*) -- Limits the response to vector buckets that begin with the specified prefix. Return type: dict Returns: **Response Syntax** { 'nextToken': 'string', 'vectorBuckets': [ { 'vectorBucketName': 'string', 'vectorBucketArn': 'string', 'creationTime': datetime(2015, 1, 1) }, ] } **Response Structure** * *(dict) --* * **nextToken** *(string) --* The element is included in the response when there are more buckets to be listed with pagination. * **vectorBuckets** *(list) --* The list of vector buckets owned by the requester. * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Summary information about a vector bucket. * **vectorBucketName** *(string) --* The name of the vector bucket. * **vectorBucketArn** *(string) --* The Amazon Resource Name (ARN) of the vector bucket. * **creationTime** *(datetime) --* Date and time when the vector bucket was created. **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / get_paginator get_paginator ************* S3Vectors.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. S3Vectors / Client / create_vector_bucket create_vector_bucket ******************** S3Vectors.Client.create_vector_bucket(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Creates a vector bucket in the Amazon Web Services Region that you want your bucket to be in. Permissions You must have the "s3vectors:CreateVectorBucket" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.create_vector_bucket( vectorBucketName='string', encryptionConfiguration={ 'sseType': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } ) Parameters: * **vectorBucketName** (*string*) -- **[REQUIRED]** The name of the vector bucket to create. * **encryptionConfiguration** (*dict*) -- The encryption configuration for the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically "AES256". * **sseType** *(string) --* The server-side encryption type to use for the encryption configuration of the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically "AES256". * **kmsKeyArn** *(string) --* Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the encryption configuration. This parameter is allowed if and only if "sseType" is set to "aws:kms". To specify the KMS key, you must use the format of the KMS key Amazon Resource Name (ARN). For example, specify Key ARN in the following format: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd- 56ef-1234567890ab" Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.ConflictException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / can_paginate can_paginate ************ S3Vectors.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. S3Vectors / Client / get_vectors get_vectors *********** S3Vectors.Client.get_vectors(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Returns vector attributes. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN). Permissions You must have the "s3vectors:GetVectors" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_vectors( vectorBucketName='string', indexName='string', indexArn='string', keys=[ 'string', ], returnData=True|False, returnMetadata=True|False ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector index. * **indexName** (*string*) -- The name of the vector index. * **indexArn** (*string*) -- The ARN of the vector index. * **keys** (*list*) -- **[REQUIRED]** The names of the vectors you want to return attributes for. * *(string) --* * **returnData** (*boolean*) -- Indicates whether to include the vector data in the response. The default value is "false". * **returnMetadata** (*boolean*) -- Indicates whether to include metadata in the response. The default value is "false". Return type: dict Returns: **Response Syntax** { 'vectors': [ { 'key': 'string', 'data': { 'float32': [ ..., ] }, 'metadata': {...}|[...]|123|123.4|'string'|True|None }, ] } **Response Structure** * *(dict) --* * **vectors** *(list) --* The attributes of the vectors. * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. The attributes of a vector returned by the "GetVectors" operation. * **key** *(string) --* The name of the vector. * **data** *(dict) --* The vector data of the vector. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "float32". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **float32** *(list) --* The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed. * *(float) --* * **metadata** (*document*) -- Metadata about the vector. **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.KmsInvalidKeyUsageException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.KmsInvalidStateException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.KmsNotFoundException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" * "S3Vectors.Client.exceptions.KmsDisabledException" S3Vectors / Client / delete_index delete_index ************ S3Vectors.Client.delete_index(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Deletes a vector index. To specify the vector index, you can either use both the vector bucket name and vector index name, or use the vector index Amazon Resource Name (ARN). Permissions You must have the "s3vectors:DeleteIndex" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_index( vectorBucketName='string', indexName='string', indexArn='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector index. * **indexName** (*string*) -- The name of the vector index to delete. * **indexArn** (*string*) -- The ARN of the vector index to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / get_waiter get_waiter ********** S3Vectors.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" S3Vectors / Client / put_vector_bucket_policy put_vector_bucket_policy ************************ S3Vectors.Client.put_vector_bucket_policy(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Creates a bucket policy for a vector bucket. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:PutVectorBucketPolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_vector_bucket_policy( vectorBucketName='string', vectorBucketArn='string', policy='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket. * **vectorBucketArn** (*string*) -- The Amazon Resource Name (ARN) of the vector bucket. * **policy** (*string*) -- **[REQUIRED]** The "JSON" that defines the policy. For more information about bucket policies for S3 Vectors, see Managing vector bucket policies in the *Amazon S3 User Guide*. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / delete_vector_bucket_policy delete_vector_bucket_policy *************************** S3Vectors.Client.delete_vector_bucket_policy(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Deletes a vector bucket policy. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:DeleteVectorBucketPolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_vector_bucket_policy( vectorBucketName='string', vectorBucketArn='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket to delete the policy from. * **vectorBucketArn** (*string*) -- The ARN of the vector bucket to delete the policy from. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / put_vectors put_vectors *********** S3Vectors.Client.put_vectors(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Adds one or more vectors to a vector index. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN). For more information about limits, see Limitations and restrictions in the *Amazon S3 User Guide*. Note: When inserting vector data into your vector index, you must provide the vector data as "float32" (32-bit floating point) values. If you pass higher-precision values to an Amazon Web Services SDK, S3 Vectors converts the values to 32-bit floating point before storing them, and "GetVectors", "ListVectors", and "QueryVectors" operations return the float32 values. Different Amazon Web Services SDKs may have different default numeric types, so ensure your vectors are properly formatted as "float32" values regardless of which SDK you're using. For example, in Python, use "numpy.float32" or explicitly cast your values. Permissions You must have the "s3vectors:PutVectors" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.put_vectors( vectorBucketName='string', indexName='string', indexArn='string', vectors=[ { 'key': 'string', 'data': { 'float32': [ ..., ] }, 'metadata': {...}|[...]|123|123.4|'string'|True|None }, ] ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector index. * **indexName** (*string*) -- The name of the vector index where you want to write vectors. * **indexArn** (*string*) -- The ARN of the vector index where you want to write vectors. * **vectors** (*list*) -- **[REQUIRED]** The vectors to add to a vector index. The number of vectors in a single request must not exceed the resource capacity, otherwise the request will be rejected with the error "ServiceUnavailableException" with the error message "Currently unable to handle the request". * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. The attributes of a vector to add to a vector index. * **key** *(string) --* **[REQUIRED]** The name of the vector. The key uniquely identifies the vector in a vector index. * **data** *(dict) --* **[REQUIRED]** The vector data of the vector. Vector dimensions must match the dimension count that's configured for the vector index. * For the "cosine" distance metric, zero vectors (vectors containing all zeros) aren't allowed. * For both "cosine" and "euclidean" distance metrics, vector data must contain only valid floating-point values. Invalid values such as NaN (Not a Number) or Infinity aren't allowed. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "float32". * **float32** *(list) --* The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed. * *(float) --* * **metadata** (*document*) -- Metadata about the vector. All metadata entries undergo validation to ensure they meet the format requirements for size and data types. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.KmsInvalidKeyUsageException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.KmsInvalidStateException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.KmsNotFoundException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" * "S3Vectors.Client.exceptions.KmsDisabledException" S3Vectors / Client / query_vectors query_vectors ************* S3Vectors.Client.query_vectors(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Performs an approximate nearest neighbor search query in a vector index using a query vector. By default, it returns the keys of approximate nearest neighbors. You can optionally include the computed distance (between the query vector and each vector in the response), the vector data, and metadata of each vector in the response. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN). Permissions You must have the "s3vectors:QueryVectors" permission to use this operation. Additional permissions are required based on the request parameters you specify: * With only "s3vectors:QueryVectors" permission, you can retrieve vector keys of approximate nearest neighbors and computed distances between these vectors. This permission is sufficient only when you don't set any metadata filters and don't request vector data or metadata (by keeping the "returnMetadata" parameter set to "false" or not specified). * If you specify a metadata filter or set "returnMetadata" to true, you must have both "s3vectors:QueryVectors" and "s3vectors:GetVectors" permissions. The request fails with a "403 Forbidden error" if you request metadata filtering, vector data, or metadata without the "s3vectors:GetVectors" permission. See also: AWS API Documentation **Request Syntax** response = client.query_vectors( vectorBucketName='string', indexName='string', indexArn='string', topK=123, queryVector={ 'float32': [ ..., ] }, filter={...}|[...]|123|123.4|'string'|True|None, returnMetadata=True|False, returnDistance=True|False ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector index. * **indexName** (*string*) -- The name of the vector index that you want to query. * **indexArn** (*string*) -- The ARN of the vector index that you want to query. * **topK** (*integer*) -- **[REQUIRED]** The number of results to return for each query. * **queryVector** (*dict*) -- **[REQUIRED]** The query vector. Ensure that the query vector has the same dimension as the dimension of the vector index that's being queried. For example, if your vector index contains vectors with 384 dimensions, your query vector must also have 384 dimensions. Note: This is a Tagged Union structure. Only one of the following top level keys can be set: "float32". * **float32** *(list) --* The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed. * *(float) --* * **filter** (*document*) -- Metadata filter to apply during the query. For more information about metadata keys, see Metadata filtering in the *Amazon S3 User Guide*. * **returnMetadata** (*boolean*) -- Indicates whether to include metadata in the response. The default value is "false". * **returnDistance** (*boolean*) -- Indicates whether to include the computed distance in the response. The default value is "false". Return type: dict Returns: **Response Syntax** { 'vectors': [ { 'key': 'string', 'data': { 'float32': [ ..., ] }, 'metadata': {...}|[...]|123|123.4|'string'|True|None, 'distance': ... }, ] } **Response Structure** * *(dict) --* * **vectors** *(list) --* The vectors in the approximate nearest neighbor search. * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. The attributes of a vector in the approximate nearest neighbor search. * **key** *(string) --* The key of the vector in the approximate nearest neighbor search. * **data** *(dict) --* The vector data associated with the vector, if requested. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "float32". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **float32** *(list) --* The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed. * *(float) --* * **metadata** (*document*) -- The metadata associated with the vector, if requested. * **distance** *(float) --* The measure of similarity between the vector in the response and the query vector. **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.KmsInvalidKeyUsageException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.KmsInvalidStateException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.KmsNotFoundException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" * "S3Vectors.Client.exceptions.KmsDisabledException" S3Vectors / Client / get_index get_index ********* S3Vectors.Client.get_index(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Returns vector index attributes. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN). Permissions You must have the "s3vectors:GetIndex" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_index( vectorBucketName='string', indexName='string', indexArn='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector index. * **indexName** (*string*) -- The name of the vector index. * **indexArn** (*string*) -- The ARN of the vector index. Return type: dict Returns: **Response Syntax** { 'index': { 'vectorBucketName': 'string', 'indexName': 'string', 'indexArn': 'string', 'creationTime': datetime(2015, 1, 1), 'dataType': 'float32', 'dimension': 123, 'distanceMetric': 'euclidean'|'cosine', 'metadataConfiguration': { 'nonFilterableMetadataKeys': [ 'string', ] } } } **Response Structure** * *(dict) --* * **index** *(dict) --* The attributes of the vector index. * **vectorBucketName** *(string) --* The name of the vector bucket that contains the vector index. * **indexName** *(string) --* The name of the vector index. * **indexArn** *(string) --* The Amazon Resource Name (ARN) of the vector index. * **creationTime** *(datetime) --* Date and time when the vector index was created. * **dataType** *(string) --* The data type of the vectors inserted into the vector index. * **dimension** *(integer) --* The number of values in the vectors that are inserted into the vector index. * **distanceMetric** *(string) --* The distance metric to be used for similarity search. * **metadataConfiguration** *(dict) --* The metadata configuration for the vector index. * **nonFilterableMetadataKeys** *(list) --* Non-filterable metadata keys allow you to enrich vectors with additional context during storage and retrieval. Unlike default metadata keys, these keys can’t be used as query filters. Non-filterable metadata keys can be retrieved but can’t be searched, queried, or filtered. You can access non-filterable metadata keys of your vectors after finding the vectors. For more information about non-filterable metadata keys, see Vectors and Limitations and restrictions in the *Amazon S3 User Guide*. * *(string) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / create_index create_index ************ S3Vectors.Client.create_index(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Creates a vector index within a vector bucket. To specify the vector bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:CreateIndex" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.create_index( vectorBucketName='string', vectorBucketArn='string', indexName='string', dataType='float32', dimension=123, distanceMetric='euclidean'|'cosine', metadataConfiguration={ 'nonFilterableMetadataKeys': [ 'string', ] } ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket to create the vector index in. * **vectorBucketArn** (*string*) -- The Amazon Resource Name (ARN) of the vector bucket to create the vector index in. * **indexName** (*string*) -- **[REQUIRED]** The name of the vector index to create. * **dataType** (*string*) -- **[REQUIRED]** The data type of the vectors to be inserted into the vector index. * **dimension** (*integer*) -- **[REQUIRED]** The dimensions of the vectors to be inserted into the vector index. * **distanceMetric** (*string*) -- **[REQUIRED]** The distance metric to be used for similarity search. * **metadataConfiguration** (*dict*) -- The metadata configuration for the vector index. * **nonFilterableMetadataKeys** *(list) --* **[REQUIRED]** Non-filterable metadata keys allow you to enrich vectors with additional context during storage and retrieval. Unlike default metadata keys, these keys can’t be used as query filters. Non-filterable metadata keys can be retrieved but can’t be searched, queried, or filtered. You can access non- filterable metadata keys of your vectors after finding the vectors. For more information about non-filterable metadata keys, see Vectors and Limitations and restrictions in the *Amazon S3 User Guide*. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.ConflictException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / delete_vector_bucket delete_vector_bucket ******************** S3Vectors.Client.delete_vector_bucket(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Deletes a vector bucket. All vector indexes in the vector bucket must be deleted before the vector bucket can be deleted. To perform this operation, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:DeleteVectorBucket" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_vector_bucket( vectorBucketName='string', vectorBucketArn='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket to delete. * **vectorBucketArn** (*string*) -- The ARN of the vector bucket to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.ConflictException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / close close ***** S3Vectors.Client.close() Closes underlying endpoint connections. S3Vectors / Client / get_vector_bucket_policy get_vector_bucket_policy ************************ S3Vectors.Client.get_vector_bucket_policy(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Gets details about a vector bucket policy. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:GetVectorBucketPolicy" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_vector_bucket_policy( vectorBucketName='string', vectorBucketArn='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket. * **vectorBucketArn** (*string*) -- The ARN of the vector bucket. Return type: dict Returns: **Response Syntax** { 'policy': 'string' } **Response Structure** * *(dict) --* * **policy** *(string) --* The "JSON" that defines the policy. **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / list_indexes list_indexes ************ S3Vectors.Client.list_indexes(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Returns a list of all the vector indexes within the specified vector bucket. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:ListIndexes" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.list_indexes( vectorBucketName='string', vectorBucketArn='string', maxResults=123, nextToken='string', prefix='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector indexes. * **vectorBucketArn** (*string*) -- The ARN of the vector bucket that contains the vector indexes. * **maxResults** (*integer*) -- The maximum number of items to be returned in the response. * **nextToken** (*string*) -- The previous pagination token. * **prefix** (*string*) -- Limits the response to vector indexes that begin with the specified prefix. Return type: dict Returns: **Response Syntax** { 'nextToken': 'string', 'indexes': [ { 'vectorBucketName': 'string', 'indexName': 'string', 'indexArn': 'string', 'creationTime': datetime(2015, 1, 1) }, ] } **Response Structure** * *(dict) --* * **nextToken** *(string) --* The next pagination token. * **indexes** *(list) --* The attributes of the vector indexes * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Summary information about a vector index. * **vectorBucketName** *(string) --* The name of the vector bucket that contains the vector index. * **indexName** *(string) --* The name of the vector index. * **indexArn** *(string) --* The Amazon Resource Name (ARN) of the vector index. * **creationTime** *(datetime) --* Date and time when the vector index was created. **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / get_vector_bucket get_vector_bucket ***************** S3Vectors.Client.get_vector_bucket(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Returns vector bucket attributes. To specify the bucket, you must use either the vector bucket name or the vector bucket Amazon Resource Name (ARN). Permissions You must have the "s3vectors:GetVectorBucket" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.get_vector_bucket( vectorBucketName='string', vectorBucketArn='string' ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket to retrieve information about. * **vectorBucketArn** (*string*) -- The ARN of the vector bucket to retrieve information about. Return type: dict Returns: **Response Syntax** { 'vectorBucket': { 'vectorBucketName': 'string', 'vectorBucketArn': 'string', 'creationTime': datetime(2015, 1, 1), 'encryptionConfiguration': { 'sseType': 'AES256'|'aws:kms', 'kmsKeyArn': 'string' } } } **Response Structure** * *(dict) --* * **vectorBucket** *(dict) --* The attributes of the vector bucket. * **vectorBucketName** *(string) --* The name of the vector bucket. * **vectorBucketArn** *(string) --* The Amazon Resource Name (ARN) of the vector bucket. * **creationTime** *(datetime) --* Date and time when the vector bucket was created. * **encryptionConfiguration** *(dict) --* The encryption configuration for the vector bucket. * **sseType** *(string) --* The server-side encryption type to use for the encryption configuration of the vector bucket. By default, if you don't specify, all new vectors in Amazon S3 vector buckets use server-side encryption with Amazon S3 managed keys (SSE-S3), specifically "AES256". * **kmsKeyArn** *(string) --* Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the encryption configuration. This parameter is allowed if and only if "sseType" is set to "aws:kms". To specify the KMS key, you must use the format of the KMS key Amazon Resource Name (ARN). For example, specify Key ARN in the following format: "arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab- 34cd-56ef-1234567890ab" **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / list_vectors list_vectors ************ S3Vectors.Client.list_vectors(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. List vectors in the specified vector index. To specify the vector index, you can either use both the vector bucket name and the vector index name, or use the vector index Amazon Resource Name (ARN). "ListVectors" operations proceed sequentially; however, for faster performance on a large number of vectors in a vector index, applications can request a parallel "ListVectors" operation by providing the "segmentCount" and "segmentIndex" parameters. Permissions You must have the "s3vectors:ListVectors" permission to use this operation. Additional permissions are required based on the request parameters you specify: * With only "s3vectors:ListVectors" permission, you can list vector keys when "returnData" and "returnMetadata" are both set to false or not specified.. * If you set "returnData" or "returnMetadata" to true, you must have both "s3vectors:ListVectors" and "s3vectors:GetVectors" permissions. The request fails with a "403 Forbidden" error if you request vector data or metadata without the "s3vectors:GetVectors" permission. See also: AWS API Documentation **Request Syntax** response = client.list_vectors( vectorBucketName='string', indexName='string', indexArn='string', maxResults=123, nextToken='string', segmentCount=123, segmentIndex=123, returnData=True|False, returnMetadata=True|False ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket. * **indexName** (*string*) -- The name of the vector index. * **indexArn** (*string*) -- The Amazon resource Name (ARN) of the vector index. * **maxResults** (*integer*) -- The maximum number of vectors to return on a page. If you don't specify "maxResults", the "ListVectors" operation uses a default value of 500. If the processed dataset size exceeds 1 MB before reaching the "maxResults" value, the operation stops and returns the vectors that are retrieved up to that point, along with a "nextToken" that you can use in a subsequent request to retrieve the next set of results. * **nextToken** (*string*) -- Pagination token from a previous request. The value of this field is empty for an initial request. * **segmentCount** (*integer*) -- For a parallel "ListVectors" request, "segmentCount" represents the total number of vector segments into which the "ListVectors" operation will be divided. The value of "segmentCount" corresponds to the number of application workers that will perform the parallel "ListVectors" operation. For example, if you want to use four application threads to list vectors in a vector index, specify a "segmentCount" value of 4. If you specify a "segmentCount" value of 1, the "ListVectors" operation will be sequential rather than parallel. If you specify "segmentCount", you must also specify "segmentIndex". * **segmentIndex** (*integer*) -- For a parallel "ListVectors" request, "segmentIndex" is the index of the segment from which to list vectors in the current request. It identifies an individual segment to be listed by an application worker. Segment IDs are zero-based, so the first segment is always 0. For example, if you want to use four application threads to list vectors in a vector index, then the first thread specifies a "segmentIndex" value of 0, the second thread specifies 1, and so on. The value of "segmentIndex" must be less than the value provided for "segmentCount". If you provide "segmentIndex", you must also provide "segmentCount". * **returnData** (*boolean*) -- If true, the vector data of each vector will be included in the response. The default value is "false". * **returnMetadata** (*boolean*) -- If true, the metadata associated with each vector will be included in the response. The default value is "false". Return type: dict Returns: **Response Syntax** { 'nextToken': 'string', 'vectors': [ { 'key': 'string', 'data': { 'float32': [ ..., ] }, 'metadata': {...}|[...]|123|123.4|'string'|True|None }, ] } **Response Structure** * *(dict) --* * **nextToken** *(string) --* Pagination token to be used in the subsequent request. The field is empty if no further pagination is required. * **vectors** *(list) --* Vectors in the current segment. * *(dict) --* Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. The attributes of a vector returned by the "ListVectors" operation. * **key** *(string) --* The name of the vector. * **data** *(dict) --* The vector data of the vector. Note: This is a Tagged Union structure. Only one of the following top level keys will be set: "float32". If a client receives an unknown member it will set "SDK_UNKNOWN_MEMBER" as the top level key, which maps to the name or tag of the unknown member. The structure of "SDK_UNKNOWN_MEMBER" is as follows: 'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'} * **float32** *(list) --* The vector data as 32-bit floating point numbers. The number of elements in this array must exactly match the dimension of the vector index where the operation is being performed. * *(float) --* * **metadata** (*document*) -- Metadata about the vector. **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" S3Vectors / Client / delete_vectors delete_vectors ************** S3Vectors.Client.delete_vectors(**kwargs) Note: Amazon S3 Vectors is in preview release for Amazon S3 and is subject to change. Deletes one or more vectors in a vector index. To specify the vector index, you can either use both the vector bucket name and vector index name, or use the vector index Amazon Resource Name (ARN). Permissions You must have the "s3vectors:DeleteVectors" permission to use this operation. See also: AWS API Documentation **Request Syntax** response = client.delete_vectors( vectorBucketName='string', indexName='string', indexArn='string', keys=[ 'string', ] ) Parameters: * **vectorBucketName** (*string*) -- The name of the vector bucket that contains the vector index. * **indexName** (*string*) -- The name of the vector index that contains a vector you want to delete. * **indexArn** (*string*) -- The ARN of the vector index that contains a vector you want to delete. * **keys** (*list*) -- **[REQUIRED]** The keys of the vectors to delete. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "S3Vectors.Client.exceptions.ValidationException" * "S3Vectors.Client.exceptions.ServiceUnavailableException" * "S3Vectors.Client.exceptions.TooManyRequestsException" * "S3Vectors.Client.exceptions.KmsInvalidKeyUsageException" * "S3Vectors.Client.exceptions.InternalServerException" * "S3Vectors.Client.exceptions.KmsInvalidStateException" * "S3Vectors.Client.exceptions.AccessDeniedException" * "S3Vectors.Client.exceptions.KmsNotFoundException" * "S3Vectors.Client.exceptions.NotFoundException" * "S3Vectors.Client.exceptions.ServiceQuotaExceededException" * "S3Vectors.Client.exceptions.KmsDisabledException"