是否可以使用aws cli为s3存储桶设置默认的kms加密?
答案 0 :(得分:0)
对于 AES256:
aws s3api put-bucket-encryption --bucket bucketname --server-side-encryption-configuration '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "AES256"}}]}
对于 KMS:
aws s3api put-bucket-encryption --bucket bucketname --server-side-encryption-configuration '{"Rules": [{"ApplyServerSideEncryptionByDefault": {"SSEAlgorithm": "aws:kms","KMSMasterKeyID": "kmskeyID"}}]}