@@ -365,31 +365,56 @@ final class CopyObjectRequest extends Input
365
365
private $ taggingDirective ;
366
366
367
367
/**
368
- * The server-side encryption algorithm used when storing this object in Amazon S3 (for example, `AES256`, `aws:kms`,
369
- * `aws:kms:dsse`). Unrecognized or unsupported values won’t write a destination object and will receive a `400 Bad
370
- * Request` response.
368
+ * The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values
369
+ * won’t write a destination object and will receive a `400 Bad Request` response.
371
370
*
372
371
* Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you
373
372
* don't specify encryption information in your copy request, the encryption setting of the target object is set to the
374
373
* default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption
375
374
* configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a
376
- * default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS),
377
- * dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with
378
- * customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to
379
- * encrypt the target object copy.
380
- *
381
- * When you perform a `CopyObject` operation, if you want to use a different type of encryption setting for the target
382
- * object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed
383
- * key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default
384
- * encryption configuration of the destination bucket, the encryption setting in your request takes precedence.
375
+ * different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target
376
+ * object copy.
385
377
*
386
378
* With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and
387
379
* decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side
388
380
* Encryption [^1] in the *Amazon S3 User Guide*.
389
381
*
390
- * > For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (`AES256`) is supported.
382
+ * **General purpose buckets **
383
+ *
384
+ * - For general purpose buckets, there are the following supported options for server-side encryption: server-side
385
+ * encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web
386
+ * Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3
387
+ * uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.
388
+ * - When you perform a `CopyObject` operation, if you want to use a different type of encryption setting for the target
389
+ * object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3
390
+ * managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the
391
+ * default encryption configuration of the destination bucket, the encryption setting in your request takes
392
+ * precedence.
393
+ *
394
+ * **Directory buckets **
395
+ *
396
+ * - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with
397
+ * Amazon S3 managed keys (SSE-S3) (`AES256`) and server-side encryption with KMS keys (SSE-KMS) (`aws:kms`). We
398
+ * recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the
399
+ * bucket default encryption in your `CreateSession` requests or `PUT` object requests. Then, new objects are
400
+ * automatically encrypted with the desired encryption settings. For more information, see Protecting data with
401
+ * server-side encryption [^2] in the *Amazon S3 User Guide*. For more information about the encryption overriding
402
+ * behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads [^3].
403
+ * - To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory
404
+ * bucket's default encryption configuration with a KMS key (specifically, a customer managed key [^4]). Amazon Web
405
+ * Services managed key [^5] (`aws/s3`) isn't supported. Your SSE-KMS configuration can only support 1 customer
406
+ * managed key [^6] per directory bucket for the lifetime of the bucket. After you specify a customer managed key for
407
+ * SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform
408
+ * a `CopyObject` operation and want to specify server-side encryption settings for new object copies with SSE-KMS in
409
+ * the encryption-related request headers, you must ensure the encryption key is the same customer managed key that
410
+ * you specified for the directory bucket's default encryption configuration.
391
411
*
392
412
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html
413
+ * [^2]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html
414
+ * [^3]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-specifying-kms-encryption.html
415
+ * [^4]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
416
+ * [^5]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
417
+ * [^6]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
393
418
*
394
419
* @var ServerSideEncryption::*|null
395
420
*/
@@ -475,25 +500,41 @@ final class CopyObjectRequest extends Input
475
500
private $ sseCustomerKeyMd5 ;
476
501
477
502
/**
478
- * Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an
479
- * object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any
480
- * of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature
503
+ * Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for
504
+ * an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring
505
+ * any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature
481
506
* Version in Request Authentication [^1] in the *Amazon S3 User Guide*.
482
507
*
483
- * > This functionality is not supported when the destination bucket is a directory bucket.
508
+ * **Directory buckets** - If you specify `x-amz-server-side-encryption` with `aws:kms`, you must specify the `
509
+ * x-amz-server-side-encryption-aws-kms-key-id` header with the ID (Key ID or Key ARN) of the KMS symmetric encryption
510
+ * customer managed key to use. Otherwise, you get an HTTP `400 Bad Request` error. Only use the key ID or key ARN. The
511
+ * key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key
512
+ * [^2] per directory bucket for the lifetime of the bucket. Amazon Web Services managed key [^3] (`aws/s3`) isn't
513
+ * supported.
484
514
*
485
515
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
516
+ * [^2]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk
517
+ * [^3]: https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk
486
518
*
487
519
* @var string|null
488
520
*/
489
521
private $ sseKmsKeyId ;
490
522
491
523
/**
492
- * Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a
493
- * base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly
494
- * added to specify encryption context for `CopyObject` requests .
524
+ * Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the
525
+ * destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the
526
+ * encryption context key-value pairs .
495
527
*
496
- * > This functionality is not supported when the destination bucket is a directory bucket.
528
+ * **General purpose buckets** - This value must be explicitly added to specify encryption context for `CopyObject`
529
+ * requests if you want an additional encryption context for your destination object. The additional encryption context
530
+ * of the source object won't be copied to the destination object. For more information, see Encryption context [^1] in
531
+ * the *Amazon S3 User Guide*.
532
+ *
533
+ * **Directory buckets** - You can optionally provide an explicit encryption context value. The value must match the
534
+ * default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not
535
+ * supported.
536
+ *
537
+ * [^1]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html#encryption-context
497
538
*
498
539
* @var string|null
499
540
*/
@@ -509,9 +550,13 @@ final class CopyObjectRequest extends Input
509
550
*
510
551
* For more information, see Amazon S3 Bucket Keys [^1] in the *Amazon S3 User Guide*.
511
552
*
512
- * > This functionality is not supported when the destination bucket is a directory bucket.
553
+ * > **Directory buckets** - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general
554
+ * > purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory
555
+ * > buckets, through CopyObject [^2]. In this case, Amazon S3 makes a call to KMS every time a copy request is made for
556
+ * > a KMS-encrypted object.
513
557
*
514
558
* [^1]: https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html
559
+ * [^2]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html
515
560
*
516
561
* @var bool|null
517
562
*/
0 commit comments