我的 aws 帐户位于 us-west-2 区域。并且在该账户中创建的 KMS 密钥具有 ARN arn:aws:kms:us-east-1::key/。在我的节点模块中,我使用 Credstash 来解密使用 KMS 密钥加密的密钥。
var credstash = new Credstash({ 'table': 'tablename', 'awsOpts': { 'region':'region' } });
let secret = credstash.getSecret({name: 'keyname'}).then(result =>{
console.log(result);
});;
我越来越低于异常。
"The ciphertext refers to a customer master key that does not exist,
does not exist in this region, or you are not allowed to access"
以下是 sls 文件中的 IAM 政策。
Effect: "Allow"
Action: ["kms:Decrypt"]
Resource: [
Fn::Join: ["", [ "arn:aws:kms:us-east-1:accountid:key/",{"Fn::Sub": "kmskey"}]]
]
解决此问题的任何指示都会有很大帮助