在 AWS Secret Manager 中配置凭证轮换时出现权限错误

Permission error when configuring credential rotation in AWS Secret Manager

我正在按照此 document 配置凭据轮换,但出现此错误:

Fail to rotate the secret "xxxxxxxx"
Secrets Manager cannot invoke the specified Lambda function. Ensure that the function policy grants access to the principal secretsmanager.amazonaws.com

我正在使用开发者角色而不是根用户,我只是想知道如何解决这个问题并启用轮换?

我有一个潜在的解决方案,也许我可以手动创建一个 Lambda 函数并 select 'Use an existing Lambda function to perform rotation' 在 Secret Manager 中?但我觉得我可能仍然会得到同样的许可问题。任何建议将不胜感激。

您需要授予 Secrets Manager 调用策略的权限 - 请参阅 https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-secrets-manager/

'Grant Secrets Manager permission to call the function on your behalf'