AWS CLI put-bucket-recryption命令失败,验证错误的验证错误
我想在AWS S3存储桶上启用SSE-KMS加密,并将现有的KMS密钥应用于存储桶,还希望将bucke键
将其设置为 true 。
aws cli put-bucket-recryption v2 doc:
https://awscli.amazonaws.com/v2/documentation/api/latest/latest/reference/s3api/put-bucket-encryptimption.html对于put-bucket-recryption
and conter command,但获得了bucketKeyEnabled
param的验证错误。 如果我删除该参数,则命令运行正常并正确设置KMS密钥。 但是,我还想将bucke键
设置为 true 。
我的命令怎么了?我确实比较了AWS CLI版本V1和V2文档,并且在put-bucket-recryption
上看起来都相同。 这是AWS CLI版本
命令:
aws s3api put-bucket-encryption \
--bucket my-bucket \
--server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"AWS_KMS_key_ARN"},"BucketKeyEnabled":true}]}'
错误:
参数验证失败:未知参数 serversideCencryptionConfiguration.rules [0]:“ bucketKeyEnabled”,必须 是:applyServerSideCencryptionbyDefault
以下是我的AWS CLI版本信息:
$ aws --version
aws-cli/1.16.306 Python/2.7.16 Darwin/20.5.0 botocore/1.13.42
根据文档应该,但是此版本不支持buckeTKeyEnabled
param?更新到最新的AWS CLI版本会有所帮助吗?
I want to enable SSE-KMS encryption on AWS S3 bucket and apply an existing KMS key to the bucket and also want to set the Bucket Key
to true.
AWS CLI put-bucket-encryption v2 doc: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/put-bucket-encryption.html
I followed the above mentioned aws cli documentation for put-bucket-encryption
and ran following command but got the validation error for BucketKeyEnabled
param.
If I remove that param then the command runs fine and sets the KMS key correctly.
However, I also want to set the Bucket Key
to true.
What's wrong with my command? I did compare the AWS CLI version v1 and v2 documentation and both looks same for put-bucket-encryption
.
Is this an aws cli version
Command:
aws s3api put-bucket-encryption \
--bucket my-bucket \
--server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"AWS_KMS_key_ARN"},"BucketKeyEnabled":true}]}'
Error:
Parameter validation failed: Unknown parameter in
ServerSideEncryptionConfiguration.Rules[0]: "BucketKeyEnabled", must
be one of: ApplyServerSideEncryptionByDefault
Following is my aws cli version info:
$ aws --version
aws-cli/1.16.306 Python/2.7.16 Darwin/20.5.0 botocore/1.13.42
As per documentation it should, but does this version not support BucketKeyEnabled
param? would updating to the latest aws cli version help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
版本
aws-cli/1.16.306
是非常旧的,bucketKeyEnabled
在旧版本中不支持。如果要继续使用CLI的V1,请使用1.24.7
的最新版本。否则,更改为当前版本2.7.11
。Version
aws-cli/1.16.306
is very old, andBucketKeyEnabled
is not supported in the old version. If you want to keep using v1 of CLI, use the latest version which is1.24.7
. Otherwise change to the current version2.7.11
.