ssekmsKeyId
Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.
General purpose buckets - If you specify x-amz-server-side-encryption
with aws:kms
or aws:kms:dsse
, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms
or x-amz-server-side-encryption:aws:kms:dsse
, but do not provide x-amz-server-side-encryption-aws-kms-key-id
, Amazon S3 uses the Amazon Web Services managed key (aws/s3
) to protect the data.
Directory buckets - To encrypt data using SSE-KMS, it's recommended to specify the x-amz-server-side-encryption
header to aws:kms
. Then, the x-amz-server-side-encryption-aws-kms-key-id
header implicitly uses the bucket's default KMS customer managed key ID. If you want to explicitly set the x-amz-server-side-encryption-aws-kms-key-id
header, it must match the bucket's default customer managed key (using key ID or ARN, not alias). Your SSE-KMS configuration can only support 1 customer managed key per directory bucket's lifetime. The Amazon Web Services managed key (aws/s3
) isn't supported. Incorrect key specification results in an HTTP 400 Bad Request
error.