我已经设置了存储桶,并设置了kms id,尝试访问该存储桶并向其中写入一些测试数据,以某种方式我一直在获取aws :: KMS :: Errors :: AccessDeniedException 这是我写的红宝石代码
region = 'us-east-1'
keyId = "arn:aws:kms:us-east-1:xxx:key/xxx"
kms = aws::KMS::Client.new(region: region)
client = aws::S3::Encryption::Client.new(
region: region,
kms_key_id: keyId,
kms_client: kms
)
bucket = "test_bucket"
item = "test_item"
contents = "some testing"
client.put_object(
body: contents,
bucket: bucket,
key: item