Class: Aws::S3::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::S3::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-s3/client.rb
Overview
An API client for S3. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::S3::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#abort_multipart_upload(params = {}) ⇒ Types::AbortMultipartUploadOutput
This operation aborts a multipart upload.
-
#complete_multipart_upload(params = {}) ⇒ Types::CompleteMultipartUploadOutput
Completes a multipart upload by assembling previously uploaded parts.
-
#copy_object(params = {}) ⇒ Types::CopyObjectOutput
Creates a copy of an object that is already stored in Amazon S3.
-
#create_bucket(params = {}) ⇒ Types::CreateBucketOutput
<note markdown=“1”> This action creates an Amazon S3 bucket.
-
#create_bucket_metadata_table_configuration(params = {}) ⇒ Struct
Creates a metadata table configuration for a general purpose bucket.
-
#create_multipart_upload(params = {}) ⇒ Types::CreateMultipartUploadOutput
This action initiates a multipart upload and returns an upload ID.
-
#create_session(params = {}) ⇒ Types::CreateSessionOutput
Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets.
-
#delete_bucket(params = {}) ⇒ Struct
Deletes the S3 bucket.
-
#delete_bucket_analytics_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_cors(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_encryption(params = {}) ⇒ Struct
This implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3).
-
#delete_bucket_intelligent_tiering_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_inventory_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_lifecycle(params = {}) ⇒ Struct
Deletes the lifecycle configuration from the specified bucket.
-
#delete_bucket_metadata_table_configuration(params = {}) ⇒ Struct
Deletes a metadata table configuration from a general purpose bucket.
-
#delete_bucket_metrics_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_ownership_controls(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_policy(params = {}) ⇒ Struct
Deletes the policy of a specified bucket.
-
#delete_bucket_replication(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_tagging(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_bucket_website(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_object(params = {}) ⇒ Types::DeleteObjectOutput
Removes an object from a bucket.
-
#delete_object_tagging(params = {}) ⇒ Types::DeleteObjectTaggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#delete_objects(params = {}) ⇒ Types::DeleteObjectsOutput
This operation enables you to delete multiple objects from a bucket using a single HTTP request.
-
#delete_public_access_block(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_accelerate_configuration(params = {}) ⇒ Types::GetBucketAccelerateConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_acl(params = {}) ⇒ Types::GetBucketAclOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_analytics_configuration(params = {}) ⇒ Types::GetBucketAnalyticsConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_cors(params = {}) ⇒ Types::GetBucketCorsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_encryption(params = {}) ⇒ Types::GetBucketEncryptionOutput
Returns the default encryption configuration for an Amazon S3 bucket.
-
#get_bucket_intelligent_tiering_configuration(params = {}) ⇒ Types::GetBucketIntelligentTieringConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_inventory_configuration(params = {}) ⇒ Types::GetBucketInventoryConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_lifecycle(params = {}) ⇒ Types::GetBucketLifecycleOutput
For an updated version of this API, see [GetBucketLifecycleConfiguration].
-
#get_bucket_lifecycle_configuration(params = {}) ⇒ Types::GetBucketLifecycleConfigurationOutput
Returns the lifecycle configuration information set on the bucket.
-
#get_bucket_location(params = {}) ⇒ Types::GetBucketLocationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_logging(params = {}) ⇒ Types::GetBucketLoggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_metadata_table_configuration(params = {}) ⇒ Types::GetBucketMetadataTableConfigurationOutput
Retrieves the metadata table configuration for a general purpose bucket.
-
#get_bucket_metrics_configuration(params = {}) ⇒ Types::GetBucketMetricsConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_notification(params = {}) ⇒ Types::NotificationConfigurationDeprecated
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_notification_configuration(params = {}) ⇒ Types::NotificationConfiguration
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_ownership_controls(params = {}) ⇒ Types::GetBucketOwnershipControlsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_policy(params = {}) ⇒ Types::GetBucketPolicyOutput
Returns the policy of a specified bucket.
-
#get_bucket_policy_status(params = {}) ⇒ Types::GetBucketPolicyStatusOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_replication(params = {}) ⇒ Types::GetBucketReplicationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_request_payment(params = {}) ⇒ Types::GetBucketRequestPaymentOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_tagging(params = {}) ⇒ Types::GetBucketTaggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_versioning(params = {}) ⇒ Types::GetBucketVersioningOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_bucket_website(params = {}) ⇒ Types::GetBucketWebsiteOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_object(params = {}) ⇒ Types::GetObjectOutput
Retrieves an object from Amazon S3.
-
#get_object_acl(params = {}) ⇒ Types::GetObjectAclOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_object_attributes(params = {}) ⇒ Types::GetObjectAttributesOutput
Retrieves all the metadata from an object without returning the object itself.
-
#get_object_legal_hold(params = {}) ⇒ Types::GetObjectLegalHoldOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_object_lock_configuration(params = {}) ⇒ Types::GetObjectLockConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_object_retention(params = {}) ⇒ Types::GetObjectRetentionOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_object_tagging(params = {}) ⇒ Types::GetObjectTaggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_object_torrent(params = {}) ⇒ Types::GetObjectTorrentOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#get_public_access_block(params = {}) ⇒ Types::GetPublicAccessBlockOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#head_bucket(params = {}) ⇒ Types::HeadBucketOutput
You can use this operation to determine if a bucket exists and if you have permission to access it.
-
#head_object(params = {}) ⇒ Types::HeadObjectOutput
The ‘HEAD` operation retrieves metadata from an object without returning the object itself.
-
#list_bucket_analytics_configurations(params = {}) ⇒ Types::ListBucketAnalyticsConfigurationsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_bucket_intelligent_tiering_configurations(params = {}) ⇒ Types::ListBucketIntelligentTieringConfigurationsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_bucket_inventory_configurations(params = {}) ⇒ Types::ListBucketInventoryConfigurationsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_bucket_metrics_configurations(params = {}) ⇒ Types::ListBucketMetricsConfigurationsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_buckets(params = {}) ⇒ Types::ListBucketsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_directory_buckets(params = {}) ⇒ Types::ListDirectoryBucketsOutput
Returns a list of all Amazon S3 directory buckets owned by the authenticated sender of the request.
-
#list_multipart_uploads(params = {}) ⇒ Types::ListMultipartUploadsOutput
This operation lists in-progress multipart uploads in a bucket.
-
#list_object_versions(params = {}) ⇒ Types::ListObjectVersionsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_objects(params = {}) ⇒ Types::ListObjectsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#list_objects_v2(params = {}) ⇒ Types::ListObjectsV2Output
Returns some or all (up to 1,000) of the objects in a bucket with each request.
-
#list_parts(params = {}) ⇒ Types::ListPartsOutput
Lists the parts that have been uploaded for a specific multipart upload.
-
#put_bucket_accelerate_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_acl(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_analytics_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_cors(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_encryption(params = {}) ⇒ Struct
This operation configures default encryption and Amazon S3 Bucket Keys for an existing bucket.
-
#put_bucket_intelligent_tiering_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_inventory_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_lifecycle(params = {}) ⇒ Struct
For an updated version of this API, see [PutBucketLifecycleConfiguration].
-
#put_bucket_lifecycle_configuration(params = {}) ⇒ Types::PutBucketLifecycleConfigurationOutput
Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration.
-
#put_bucket_logging(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_metrics_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_notification(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_notification_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_ownership_controls(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_policy(params = {}) ⇒ Struct
Applies an Amazon S3 bucket policy to an Amazon S3 bucket.
-
#put_bucket_replication(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_request_payment(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_tagging(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_versioning(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_bucket_website(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_object(params = {}) ⇒ Types::PutObjectOutput
Adds an object to a bucket.
-
#put_object_acl(params = {}) ⇒ Types::PutObjectAclOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_object_legal_hold(params = {}) ⇒ Types::PutObjectLegalHoldOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_object_lock_configuration(params = {}) ⇒ Types::PutObjectLockConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_object_retention(params = {}) ⇒ Types::PutObjectRetentionOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_object_tagging(params = {}) ⇒ Types::PutObjectTaggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#put_public_access_block(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
-
#restore_object(params = {}) ⇒ Types::RestoreObjectOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#select_object_content(params = {}) ⇒ Types::SelectObjectContentOutput
<note markdown=“1”> This operation is not supported for directory buckets.
-
#upload_part(params = {}) ⇒ Types::UploadPartOutput
Uploads a part in a multipart upload.
-
#upload_part_copy(params = {}) ⇒ Types::UploadPartCopyOutput
Uploads a part by copying data from an existing object as data source.
-
#write_get_object_response(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
551 552 553 |
# File 'lib/aws-sdk-s3/client.rb', line 551 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20606 20607 20608 |
# File 'lib/aws-sdk-s3/client.rb', line 20606 def identifier @identifier end |
Class Method Details
Instance Method Details
#abort_multipart_upload(params = {}) ⇒ Types::AbortMultipartUploadOutput
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 markdown=“1”> * **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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
Permissions : * **General purpose bucket permissions** - For information about
permissions required to use the multipart upload, see [Multipart
Upload and Permissions][4] 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` ][5] 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` ][5].
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][6
- UploadPart][7
- CompleteMultipartUpload][8
- ListParts][1
- ListMultipartUploads][9
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [4]: docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html [8]: docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html
761 762 763 764 |
# File 'lib/aws-sdk-s3/client.rb', line 761 def abort_multipart_upload(params = {}, = {}) req = build_request(:abort_multipart_upload, params) req.send_request() end |
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20460 20461 20462 20463 20464 20465 20466 20467 20468 20469 20470 20471 20472 20473 20474 20475 20476 |
# File 'lib/aws-sdk-s3/client.rb', line 20460 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::S3') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-s3' context[:gem_version] = '1.176.0' Seahorse::Client::Request.new(handlers, context) end |
#complete_multipart_upload(params = {}) ⇒ Types::CompleteMultipartUploadOutput
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].
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 markdown=“1”> **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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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
- Available Local Zone for directory buckets][6
-
in the *Amazon S3 User
Guide*.
</note>
Permissions : * **General purpose bucket permissions** - For information about
permissions required to use the multipart upload API, see
[Multipart Upload and Permissions][7] in the *Amazon S3 User
Guide*.
If you provide an [additional checksum value][8] 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` ][9] 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` ][9].
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][10
- UploadPart][1
- AbortMultipartUpload][11
- ListParts][12
- ListMultipartUploads][13
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html [4]: docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [6]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [7]: docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html [8]: docs.aws.amazon.com/AmazonS3/latest/API/API_Checksum.html [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [10]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html [11]: docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html [12]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html [13]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html
1219 1220 1221 1222 |
# File 'lib/aws-sdk-s3/client.rb', line 1219 def complete_multipart_upload(params = {}, = {}) req = build_request(:complete_multipart_upload, params) req.send_request() end |
#copy_object(params = {}) ⇒ Types::CopyObjectOutput
Creates a copy of an object that is already stored in Amazon S3.
<note markdown=“1”> 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].
</note>
You can copy individual objects between general purpose buckets, between directory buckets, and between general purpose buckets and directory buckets.
<note markdown=“1”> * 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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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 [Available Local Zone for directory buckets] 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.
</note>
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*.
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][6].
**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 <b> <code>s3:GetObject</code> </b> permission to read the
source object that is being copied.
* If the destination bucket is a general purpose bucket, you must
have <b> <code>s3:PutObject</code> </b> 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 <b>
<code>s3express:CreateSession</code> </b> 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
<b> <code>s3express:CreateSession</code> </b> 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][7] and [Amazon Web Services Identity and Access
Management (IAM) identity-based policies for S3 Express One
Zone][8] 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][9]. 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][10].
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 ‘CopyObject`:
- PutObject][11
- GetObject][12
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [4]: docs.aws.amazon.com/accounts/latest/reference/manage-acct-regions.html#manage-acct-regions-enable-standalone [5]: docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html [6]: docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html [7]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html [8]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html [9]: repost.aws/knowledge-center/s3-resolve-200-internalerror [10]: aws.amazon.com/s3/pricing/ [11]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html [12]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
2275 2276 2277 2278 |
# File 'lib/aws-sdk-s3/client.rb', line 2275 def copy_object(params = {}, = {}) req = build_request(:copy_object, params) req.send_request() end |
#create_bucket(params = {}) ⇒ Types::CreateBucketOutput
<note markdown=“1”> This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts bucket, see [ ‘CreateBucket` ][1].
</note>
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 markdown=“1”> * **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][3] 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 ‘s3express-control.region-code.amazonaws.com/bucket-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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.
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 ][6] and [Blocking public access to your
Amazon S3 storage ][7] 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` ][8] 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 ][7] 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][9] in the *Amazon S3
User Guide*.
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][10] in the *Amazon
S3 User Guide*. For more information about supported S3 features
for directory buckets, see [Features of S3 Express One Zone][11]
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][12
- DeleteBucket][13
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [6]: docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html [7]: docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html [8]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html [9]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [10]: docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html [11]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-one-zone.html#s3-express-features [12]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html [13]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html
2599 2600 2601 2602 |
# File 'lib/aws-sdk-s3/client.rb', line 2599 def create_bucket(params = {}, = {}) req = build_request(:create_bucket, params) req.send_request() end |
#create_bucket_metadata_table_configuration(params = {}) ⇒ Struct
Creates a metadata table 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][2] 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][3] in the *Amazon S3 User Guide*.
* `s3:CreateBucketMetadataTableConfiguration`
* `s3tables:CreateNamespace`
* `s3tables:GetTable`
* `s3tables:CreateTable`
* `s3tables:PutTablePolicy`
The following operations are related to ‘CreateBucketMetadataTableConfiguration`:
- DeleteBucketMetadataTableConfiguration][4
- GetBucketMetadataTableConfiguration][5
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-integrating-aws.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html
2683 2684 2685 2686 |
# File 'lib/aws-sdk-s3/client.rb', line 2683 def (params = {}, = {}) req = build_request(:create_bucket_metadata_table_configuration, params) req.send_request() end |
#create_multipart_upload(params = {}) ⇒ Types::CreateMultipartUploadOutput
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 markdown=“1”> 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.
</note>
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 markdown=“1”> * 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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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)][6] 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][7] and [Protecting data
using server-side encryption with Amazon Web Services KMS][8] 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` ][9] 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` ][9].
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][1] and
[UploadPartCopy][10] 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 markdown="1"> * 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][7] and
[Protecting data using server-side encryption with Amazon Web
Services KMS][8] 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][11] in the *Amazon S3 User Guide*.
</note>
For more information about server-side encryption with KMS keys
(SSE-KMS), see [Protecting Data Using Server-Side Encryption
with KMS keys][8] 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)][12] 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][13] 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][14].
In the Zonal endpoint API calls (except [CopyObject][15] and
[UploadPartCopy][10]) 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 markdown="1"> 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][15] and [UploadPartCopy][10]), the encryption request
headers must match the default encryption configuration of the
directory bucket.
</note>
<note markdown="1"> 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.
</note>
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][1
- CompleteMultipartUpload][16
- AbortMultipartUpload][17
- ListParts][18
- ListMultipartUploads][19
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html [2]: docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html [7]: docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions [8]: docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [10]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html [11]: docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version [12]: docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html [13]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html [14]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html [15]: docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html [16]: docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html [17]: docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html [18]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html [19]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html
3632 3633 3634 3635 |
# File 'lib/aws-sdk-s3/client.rb', line 3632 def create_multipart_upload(params = {}, = {}) req = build_request(:create_multipart_upload, params) req.send_request() end |
#create_session(params = {}) ⇒ Types::CreateSessionOutput
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 markdown=“1”> * 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][3] in the *Amazon S3
User Guide*. For more information about endpoints in Local Zones,
see [Available Local Zone for directory buckets][4] 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].
</note>
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` ][7]. For example policies, see [Example
bucket policies for S3 Express One Zone][8] and [Amazon Web Services
Identity and Access Management (IAM) identity-based policies for S3
Express One Zone][9] 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][10] 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][11].
For [Zonal endpoint (object-level) API operations][12] except
[CopyObject][5] and [UploadPartCopy][13], you authenticate and
authorize requests through [CreateSession][14] 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][15]). 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 markdown="1"> Only 1 [customer managed key][15] is supported per directory bucket
for the lifetime of the bucket. The [Amazon Web Services managed
key][16] (`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.
</note>
In the Zonal endpoint API calls (except [CopyObject][5] and
[UploadPartCopy][13]) 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 markdown="1"> 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][5] and
[UploadPartCopy][13]), it's not supported to override the values of
the encryption settings from the `CreateSession` request.
</note>
HTTP Host header syntax
: Directory buckets - The HTTP Host header syntax is ‘
Bucket-name.s3express-zone-id.region-code.amazonaws.com`.
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-APIs.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-optimizing-performance-guidelines-design-patterns.html#s3-express-optimizing-performance-session-authentication [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html#API_CreateSession_RequestParameters [8]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html [9]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-identity-policies.html [10]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html [11]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html [12]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-differences.html#s3-express-differences-api-operations [13]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html [14]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [15]: docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk [16]: docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
3926 3927 3928 3929 |
# File 'lib/aws-sdk-s3/client.rb', line 3926 def create_session(params = {}, = {}) req = build_request(:create_session, params) req.send_request() end |
#delete_bucket(params = {}) ⇒ Struct
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 markdown=“1”> * **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 ‘s3express-control.region-code.amazonaws.com/bucket-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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][3] 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][4
- DeleteObject][5
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html
4036 4037 4038 4039 |
# File 'lib/aws-sdk-s3/client.rb', line 4036 def delete_bucket(params = {}, = {}) req = build_request(:delete_bucket, params) req.send_request() end |
#delete_bucket_analytics_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][4
- ListBucketAnalyticsConfigurations][5
- PutBucketAnalyticsConfiguration][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html
4102 4103 4104 4105 |
# File 'lib/aws-sdk-s3/client.rb', line 4102 def delete_bucket_analytics_configuration(params = {}, = {}) req = build_request(:delete_bucket_analytics_configuration, params) req.send_request() end |
#delete_bucket_cors(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
- RESTOPTIONSobject][3
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/cors.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html
4162 4163 4164 4165 |
# File 'lib/aws-sdk-s3/client.rb', line 4162 def delete_bucket_cors(params = {}, = {}) req = build_request(:delete_bucket_cors, params) req.send_request() end |
#delete_bucket_encryption(params = {}) ⇒ Struct
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 markdown=“1”> * **General purpose buckets** - For information about the bucket
default encryption feature, see [Amazon S3 Bucket Default
Encryption][1] 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].
</note>
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][3] and [Managing Access Permissions to Your Amazon S3
Resources][4].
* **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][5] 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][6
- GetBucketEncryption][7
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html
4267 4268 4269 4270 |
# File 'lib/aws-sdk-s3/client.rb', line 4267 def delete_bucket_encryption(params = {}, = {}) req = build_request(:delete_bucket_encryption, params) req.send_request() end |
#delete_bucket_intelligent_tiering_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
- PutBucketIntelligentTieringConfiguration][3
- ListBucketIntelligentTieringConfigurations][4
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html
4334 4335 4336 4337 |
# File 'lib/aws-sdk-s3/client.rb', line 4334 def delete_bucket_intelligent_tiering_configuration(params = {}, = {}) req = build_request(:delete_bucket_intelligent_tiering_configuration, params) req.send_request() end |
#delete_bucket_inventory_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
Deletes an 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][4
- PutBucketInventoryConfiguration][5
- ListBucketInventoryConfigurations][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html
4399 4400 4401 4402 |
# File 'lib/aws-sdk-s3/client.rb', line 4399 def delete_bucket_inventory_configuration(params = {}, = {}) req = build_request(:delete_bucket_inventory_configuration, params) req.send_request() end |
#delete_bucket_lifecycle(params = {}) ⇒ Struct
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][1].
^
* **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][2]
in the *Amazon S3 User Guide*.
<note markdown="1"> <b>Directory buckets </b> - For directory buckets, you must make
requests for this API operation to the Regional endpoint. These
endpoints support path-style requests in the format
`https://s3express-control.region-code.amazonaws.com/bucket-name
`. 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][3] in the *Amazon S3 User Guide*. For more information
about endpoints in Local Zones, see [Available Local Zone for
directory buckets][4] in the *Amazon S3 User Guide*.
</note>
^
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][6
- GetBucketLifecycleConfiguration][7
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [5]: docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html
4509 4510 4511 4512 |
# File 'lib/aws-sdk-s3/client.rb', line 4509 def delete_bucket_lifecycle(params = {}, = {}) req = build_request(:delete_bucket_lifecycle, params) req.send_request() end |
#delete_bucket_metadata_table_configuration(params = {}) ⇒ Struct
Deletes a metadata table configuration from 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:DeleteBucketMetadataTableConfiguration` permission. For more
information, see [Setting up permissions for configuring metadata
tables][2] in the *Amazon S3 User Guide*.
The following operations are related to ‘DeleteBucketMetadataTableConfiguration`:
- CreateBucketMetadataTableConfiguration][3
- GetBucketMetadataTableConfiguration][4
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataTableConfiguration.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetadataTableConfiguration.html
4560 4561 4562 4563 |
# File 'lib/aws-sdk-s3/client.rb', line 4560 def (params = {}, = {}) req = build_request(:delete_bucket_metadata_table_configuration, params) req.send_request() end |
#delete_bucket_metrics_configuration(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][4
- PutBucketMetricsConfiguration][5
- ListBucketMetricsConfigurations][6
- Monitoring Metrics with Amazon CloudWatch][3
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html
4630 4631 4632 4633 |
# File 'lib/aws-sdk-s3/client.rb', line 4630 def delete_bucket_metrics_configuration(params = {}, = {}) req = build_request(:delete_bucket_metrics_configuration, params) req.send_request() end |
#delete_bucket_ownership_controls(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html [2]: docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html
4680 4681 4682 4683 |
# File 'lib/aws-sdk-s3/client.rb', line 4680 def delete_bucket_ownership_controls(params = {}, = {}) req = build_request(:delete_bucket_ownership_controls, params) req.send_request() end |
#delete_bucket_policy(params = {}) ⇒ Struct
Deletes the policy of a specified bucket.
<note markdown=“1”> 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 ‘s3express-control.region-code.amazonaws.com/bucket-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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.
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][3] 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][4] 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][5
- DeleteObject][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html
4810 4811 4812 4813 |
# File 'lib/aws-sdk-s3/client.rb', line 4810 def delete_bucket_policy(params = {}, = {}) req = build_request(:delete_bucket_policy, params) req.send_request() end |
#delete_bucket_replication(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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 markdown=“1”> It can take a while for the deletion of a replication configuration to fully propagate.
</note>
For information about replication configuration, see [Replication] in the *Amazon S3 User Guide*.
The following operations are related to ‘DeleteBucketReplication`:
- PutBucketReplication][4
- GetBucketReplication][5
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/replication.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html
4880 4881 4882 4883 |
# File 'lib/aws-sdk-s3/client.rb', line 4880 def delete_bucket_replication(params = {}, = {}) req = build_request(:delete_bucket_replication, params) req.send_request() end |
#delete_bucket_tagging(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][1
- PutBucketTagging][2
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html
4936 4937 4938 4939 |
# File 'lib/aws-sdk-s3/client.rb', line 4936 def delete_bucket_tagging(params = {}, = {}) req = build_request(:delete_bucket_tagging, params) req.send_request() end |
#delete_bucket_website(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
- PutBucketWebsite][3
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html
5004 5005 5006 5007 |
# File 'lib/aws-sdk-s3/client.rb', line 5004 def delete_bucket_website(params = {}, = {}) req = build_request(:delete_bucket_website, params) req.send_request() end |
#delete_object(params = {}) ⇒ Types::DeleteObjectOutput
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 markdown=“1”> * **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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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 markdown=“1”> **Directory buckets** - MFA delete is not supported by directory buckets.
</note>
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 markdown=“1”> **Directory buckets** - S3 Lifecycle is not supported by directory buckets.
</note>
Permissions : * **General purpose bucket permissions** - The following permissions
are required in your policies when your `DeleteObjects` request
includes specific headers.
* <b> <code>s3:DeleteObject</code> </b> - To delete an object from
a bucket, you must always have the `s3:DeleteObject` permission.
* <b> <code>s3:DeleteObjectVersion</code> </b> - 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` ][8] 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` ][8].
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][9
^
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [5]: docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html [8]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
5320 5321 5322 5323 |
# File 'lib/aws-sdk-s3/client.rb', line 5320 def delete_object(params = {}, = {}) req = build_request(:delete_object, params) req.send_request() end |
#delete_object_tagging(params = {}) ⇒ Types::DeleteObjectTaggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
- GetObjectTagging][3
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html
5444 5445 5446 5447 |
# File 'lib/aws-sdk-s3/client.rb', line 5444 def delete_object_tagging(params = {}, = {}) req = build_request(:delete_object_tagging, params) req.send_request() end |
#delete_objects(params = {}) ⇒ Types::DeleteObjectsOutput
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 1000 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. Note that if the object specified in the request is not found, Amazon S3 returns the result as deleted.
<note markdown=“1”> * **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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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 markdown=“1”> **Directory buckets** - MFA delete is not supported by directory buckets.
</note>
Permissions : * **General purpose bucket permissions** - The following permissions
are required in your policies when your `DeleteObjects` request
includes specific headers.
* <b> <code>s3:DeleteObject</code> </b> - To delete an object from
a bucket, you must always specify the `s3:DeleteObject`
permission.
* <b> <code>s3:DeleteObjectVersion</code> </b> - 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` ][4] 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` ][4].
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][5
- UploadPart][6
- CompleteMultipartUpload][7
- ListParts][8
- AbortMultipartUpload][9
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html [8]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html
5824 5825 5826 5827 |
# File 'lib/aws-sdk-s3/client.rb', line 5824 def delete_objects(params = {}, = {}) req = build_request(:delete_objects, params) req.send_request() end |
#delete_public_access_block(params = {}) ⇒ Struct
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][3
- GetPublicAccessBlock][4
- PutPublicAccessBlock][5
- GetBucketPolicyStatus][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html
5881 5882 5883 5884 |
# File 'lib/aws-sdk-s3/client.rb', line 5881 def delete_public_access_block(params = {}, = {}) req = build_request(:delete_public_access_block, params) req.send_request() end |
#get_bucket_accelerate_configuration(params = {}) ⇒ Types::GetBucketAccelerateConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][3
-
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][3
^
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html [4]: docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html
5977 5978 5979 5980 |
# File 'lib/aws-sdk-s3/client.rb', line 5977 def get_bucket_accelerate_configuration(params = {}, = {}) req = build_request(:get_bucket_accelerate_configuration, params) req.send_request() end |
#get_bucket_acl(params = {}) ⇒ Types::GetBucketAclOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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 markdown=“1”> 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*.
</note>
The following operations are related to ‘GetBucketAcl`:
- ListObjects][3
^
[1]: docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html
6073 6074 6075 6076 |
# File 'lib/aws-sdk-s3/client.rb', line 6073 def get_bucket_acl(params = {}, = {}) req = build_request(:get_bucket_acl, params) req.send_request() end |
#get_bucket_analytics_configuration(params = {}) ⇒ Types::GetBucketAnalyticsConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][4
- ListBucketAnalyticsConfigurations][5
- PutBucketAnalyticsConfiguration][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html
6159 6160 6161 6162 |
# File 'lib/aws-sdk-s3/client.rb', line 6159 def get_bucket_analytics_configuration(params = {}, = {}) req = build_request(:get_bucket_analytics_configuration, params) req.send_request() end |
#get_bucket_cors(params = {}) ⇒ Types::GetBucketCorsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][3
- DeleteBucketCors][4
[1]: docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList [2]: docs.aws.amazon.com/AmazonS3/latest/dev/cors.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html
6279 6280 6281 6282 |
# File 'lib/aws-sdk-s3/client.rb', line 6279 def get_bucket_cors(params = {}, = {}) req = build_request(:get_bucket_cors, params) req.send_request() end |
#get_bucket_encryption(params = {}) ⇒ Types::GetBucketEncryptionOutput
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 markdown=“1”> * **General purpose buckets** - For information about the bucket
default encryption feature, see [Amazon S3 Bucket Default
Encryption][1] 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].
</note>
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][3] and [Managing Access Permissions to Your Amazon S3
Resources][4].
* **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][5] 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][6
- DeleteBucketEncryption][7
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html
6393 6394 6395 6396 |
# File 'lib/aws-sdk-s3/client.rb', line 6393 def get_bucket_encryption(params = {}, = {}) req = build_request(:get_bucket_encryption, params) req.send_request() end |
#get_bucket_intelligent_tiering_configuration(params = {}) ⇒ Types::GetBucketIntelligentTieringConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
- PutBucketIntelligentTieringConfiguration][3
- ListBucketIntelligentTieringConfigurations][4
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html
6477 6478 6479 6480 |
# File 'lib/aws-sdk-s3/client.rb', line 6477 def get_bucket_intelligent_tiering_configuration(params = {}, = {}) req = build_request(:get_bucket_intelligent_tiering_configuration, params) req.send_request() end |
#get_bucket_inventory_configuration(params = {}) ⇒ Types::GetBucketInventoryConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
Returns an 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][4
- ListBucketInventoryConfigurations][5
- PutBucketInventoryConfiguration][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html
6560 6561 6562 6563 |
# File 'lib/aws-sdk-s3/client.rb', line 6560 def get_bucket_inventory_configuration(params = {}, = {}) req = build_request(:get_bucket_inventory_configuration, params) req.send_request() end |
#get_bucket_lifecycle(params = {}) ⇒ Types::GetBucketLifecycleOutput
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 markdown=“1”> This operation is not supported for directory buckets.
</note>
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][1
- PutBucketLifecycle][5
- DeleteBucketLifecycle][6
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html [2]: docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html
6678 6679 6680 6681 |
# File 'lib/aws-sdk-s3/client.rb', line 6678 def get_bucket_lifecycle(params = {}, = {}) req = build_request(:get_bucket_lifecycle, params) req.send_request() end |
#get_bucket_lifecycle_configuration(params = {}) ⇒ Types::GetBucketLifecycleConfigurationOutput
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 markdown=“1”> Lifecyle configurations for directory buckets only support expiring objects and cancelling multipart uploads. Expiring of versioned objects, transitions and tag filters are not supported.
</note>
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][3].
^
* **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][4]
in the *Amazon S3 User Guide*.
<note markdown="1"> <b>Directory buckets </b> - For directory buckets, you must make
requests for this API operation to the Regional endpoint. These
endpoints support path-style requests in the format
`https://s3express-control.region-code.amazonaws.com/bucket-name
`. 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][5] in the *Amazon S3 User Guide*. For more information
about endpoints in Local Zones, see [Available Local Zone for
directory buckets][6] in the *Amazon S3 User Guide*.
</note>
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][2
- PutBucketLifecycle][7
- DeleteBucketLifecycle][8
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [6]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html [8]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html
6864 6865 6866 6867 |
# File 'lib/aws-sdk-s3/client.rb', line 6864 def get_bucket_lifecycle_configuration(params = {}, = {}) req = build_request(:get_bucket_lifecycle_configuration, params) req.send_request() end |
#get_bucket_location(params = {}) ⇒ Types::GetBucketLocationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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 markdown=“1”> We recommend that you use [HeadBucket] to return the Region that a bucket resides in. For backward compatibility, Amazon S3 continues to support GetBucketLocation.
</note>
The following operations are related to ‘GetBucketLocation`:
- GetObject][4
- CreateBucket][1
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
6961 6962 6963 6964 |
# File 'lib/aws-sdk-s3/client.rb', line 6961 def get_bucket_location(params = {}, = {}) req = build_request(:get_bucket_location, params) req.send_request() end |
#get_bucket_logging(params = {}) ⇒ Types::GetBucketLoggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][1
- PutBucketLogging][2
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html
7020 7021 7022 7023 |
# File 'lib/aws-sdk-s3/client.rb', line 7020 def get_bucket_logging(params = {}, = {}) req = build_request(:get_bucket_logging, params) req.send_request() end |
#get_bucket_metadata_table_configuration(params = {}) ⇒ Types::GetBucketMetadataTableConfigurationOutput
Retrieves the metadata table 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
`s3:GetBucketMetadataTableConfiguration` permission. For more
information, see [Setting up permissions for configuring metadata
tables][2] in the *Amazon S3 User Guide*.
The following operations are related to ‘GetBucketMetadataTableConfiguration`:
- CreateBucketMetadataTableConfiguration][3
- DeleteBucketMetadataTableConfiguration][4
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-overview.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/metadata-tables-permissions.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucketMetadataTableConfiguration.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetadataTableConfiguration.html
7083 7084 7085 7086 |
# File 'lib/aws-sdk-s3/client.rb', line 7083 def (params = {}, = {}) req = build_request(:get_bucket_metadata_table_configuration, params) req.send_request() end |
#get_bucket_metrics_configuration(params = {}) ⇒ Types::GetBucketMetricsConfigurationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][4
- DeleteBucketMetricsConfiguration][5
- ListBucketMetricsConfigurations][6
- Monitoring Metrics with Amazon CloudWatch][3
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html
7169 7170 7171 7172 |
# File 'lib/aws-sdk-s3/client.rb', line 7169 def get_bucket_metrics_configuration(params = {}, = {}) req = build_request(:get_bucket_metrics_configuration, params) req.send_request() end |
#get_bucket_notification(params = {}) ⇒ Types::NotificationConfigurationDeprecated
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
No longer used, see [GetBucketNotificationConfiguration].
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html
7300 7301 7302 7303 |
# File 'lib/aws-sdk-s3/client.rb', line 7300 def get_bucket_notification(params = {}, = {}) req = build_request(:get_bucket_notification, params) req.send_request() end |
#get_bucket_notification_configuration(params = {}) ⇒ Types::NotificationConfiguration
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][4
^
[1]: docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList [2]: docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html
7415 7416 7417 7418 |
# File 'lib/aws-sdk-s3/client.rb', line 7415 def get_bucket_notification_configuration(params = {}, = {}) req = build_request(:get_bucket_notification_configuration, params) req.send_request() end |
#get_bucket_ownership_controls(params = {}) ⇒ Types::GetBucketOwnershipControlsOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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].
For information about Amazon S3 Object Ownership, see [Using Object Ownership].
The following operations are related to ‘GetBucketOwnershipControls`:
-
PutBucketOwnershipControls
-
DeleteBucketOwnershipControls
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html
7472 7473 7474 7475 |
# File 'lib/aws-sdk-s3/client.rb', line 7472 def get_bucket_ownership_controls(params = {}, = {}) req = build_request(:get_bucket_ownership_controls, params) req.send_request() end |
#get_bucket_policy(params = {}) ⇒ Types::GetBucketPolicyOutput
Returns the policy of a specified bucket.
<note markdown=“1”> 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 ‘s3express-control.region-code.amazonaws.com/bucket-name `. 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 [Available Local Zone for directory buckets] in the *Amazon S3 User Guide*.
</note>
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.
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][3] 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][4] in the *Amazon S3 User Guide*.
Example bucket policies
: **General purpose buckets example bucket policies** - See [Bucket
policy examples][5] in the *Amazon S3 User Guide*.
**Directory bucket example bucket policies** - See [Example bucket
policies for S3 Express One Zone][6] 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][7
^
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html [4]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html [5]: docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html [6]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html [7]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html
7638 7639 7640 7641 |
# File 'lib/aws-sdk-s3/client.rb', line 7638 def get_bucket_policy(params = {}, = {}, &block) req = build_request(:get_bucket_policy, params) req.send_request(, &block) end |
#get_bucket_policy_status(params = {}) ⇒ Types::GetBucketPolicyStatusOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][3
- GetPublicAccessBlock][4
- PutPublicAccessBlock][5
- DeletePublicAccessBlock][6
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html [2]: docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status [3]: docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html
7703 7704 7705 7706 |
# File 'lib/aws-sdk-s3/client.rb', line 7703 def get_bucket_policy_status(params = {}, = {}) req = build_request(:get_bucket_policy_status, params) req.send_request() end |
#get_bucket_replication(params = {}) ⇒ Types::GetBucketReplicationOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
Returns the replication configuration of a bucket.
<note markdown=“1”> It can take a while to propagate the put or delete a replication configuration to all Amazon S3 systems. Therefore, a get request soon after put or delete can return a wrong result.
</note>
For information about replication configuration, see [Replication] in the *Amazon S3 User Guide*.
This action requires permissions for the ‘s3:GetReplicationConfiguration` action. For more information about permissions, see [Using Bucket Policies and User Policies].
If you include the ‘Filter` element in a replication configuration, you must also include the `DeleteMarkerReplication` and `Priority` elements. The response also returns those elements.
For information about ‘GetBucketReplication` errors, see [List of replication-related error codes]
The following operations are related to ‘GetBucketReplication`:
- PutBucketReplication][4
- DeleteBucketReplication][5
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/replication.html [2]: docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html
7826 7827 7828 7829 |
# File 'lib/aws-sdk-s3/client.rb', line 7826 def get_bucket_replication(params = {}, = {}) req = build_request(:get_bucket_replication, params) req.send_request() end |
#get_bucket_request_payment(params = {}) ⇒ Types::GetBucketRequestPaymentOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
^
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html
7892 7893 7894 7895 |
# File 'lib/aws-sdk-s3/client.rb', line 7892 def get_bucket_request_payment(params = {}, = {}) req = build_request(:get_bucket_request_payment, params) req.send_request() end |
#get_bucket_tagging(params = {}) ⇒ Types::GetBucketTaggingOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][1
- DeleteBucketTagging][2
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html
7978 7979 7980 7981 |
# File 'lib/aws-sdk-s3/client.rb', line 7978 def get_bucket_tagging(params = {}, = {}) req = build_request(:get_bucket_tagging, params) req.send_request() end |
#get_bucket_versioning(params = {}) ⇒ Types::GetBucketVersioningOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][1
- PutObject][2
- DeleteObject][3
[1]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html
8055 8056 8057 8058 |
# File 'lib/aws-sdk-s3/client.rb', line 8055 def get_bucket_versioning(params = {}, = {}) req = build_request(:get_bucket_versioning, params) req.send_request() end |
#get_bucket_website(params = {}) ⇒ Types::GetBucketWebsiteOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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][2
- PutBucketWebsite][3
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html [2]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html
8147 8148 8149 8150 |
# File 'lib/aws-sdk-s3/client.rb', line 8147 def get_bucket_website(params = {}, = {}) req = build_request(:get_bucket_website, params) req.send_request() end |
#get_object(params = {}) ⇒ Types::GetObjectOutput
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 `examplebucket–use1-az5–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 `bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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
- Available Local Zone for directory buckets][3
-
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][4] 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` ][5] 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` ][5].
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][6]. Otherwise, this operation returns an
`InvalidObjectState` error. For information about restoring archived
objects, see [Restoring Archived Objects][7] in the *Amazon S3 User
Guide*.
<b>Directory buckets </b> - For directory buckets, only the S3
Express One Zone storage class is supported to store newly created
objects. 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][8] 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 markdown="1"> 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.
</note>
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][9
- GetObjectAcl][10
[1]: docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [3]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [4]: docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html [7]: docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html [8]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html [10]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html
8817 8818 8819 8820 |
# File 'lib/aws-sdk-s3/client.rb', line 8817 def get_object(params = {}, = {}, &block) req = build_request(:get_object, params) req.send_request(, &block) end |
#get_object_acl(params = {}) ⇒ Types::GetObjectAclOutput
<note markdown=“1”> This operation is not supported for directory buckets.
</note>
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 markdown=“1”> 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*.
</note>
The following operations are related to ‘GetObjectAcl`:
- GetObject][3
- GetObjectAttributes][4
- DeleteObject][5
- PutObject][6
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html [3]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html [5]: docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html [6]: docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
9001 9002 9003 9004 |
# File 'lib/aws-sdk-s3/client.rb', line 9001 def get_object_acl(params = {}, = {}) req = build_request(:get_object_acl, params) req.send_request() end |
#get_object_attributes(params = {}) ⇒ Types::GetObjectAttributesOutput
Retrieves all 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 each of those individual calls can be returned with a single call to `GetObjectAttributes`.
<note markdown=“1”> **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 ‘bucket-name.s3express-zone-id.region-code.amazonaws.com/key-name `. 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
- Available Local Zone for directory buckets][2
-
in the *Amazon S3 User
Guide*.
</note>
Permissions : * **General purpose bucket permissions** - To use
`GetObjectAttributes`, you must have READ access to the object.
The permissions that you need to use this operation depend on
whether the bucket is versioned. If the bucket is versioned, you
need both the `s3:GetObjectVersion` and
`s3:GetObjectVersionAttributes` permissions for this operation. If
the bucket is not versioned, you need the `s3:GetObject` and
`s3:GetObjectAttributes` permissions. For more information, see
[Specifying Permissions in a Policy][3] 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` ][4] 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` ][4].
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 markdown=“1”> 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.
</note>
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)][5] in the *Amazon S3 User
Guide*.
<note markdown="1"> **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][6] 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][7].
</note>
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][8].
* 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][8].
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][9
- GetObjectAcl][10
- GetObjectLegalHold][11
- GetObjectLockConfiguration][12
- GetObjectRetention][13
- GetObjectTagging][14
- HeadObject][15
- ListParts][16
[1]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html [2]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html [3]: docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html [4]: docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html [5]: docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html [6]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html [7]: docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html [8]: tools.ietf.org/html/rfc7232 [9]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html [10]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html [11]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html [12]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html [13]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html [14]: docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html [15]: docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html [16]: docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html