简体   繁体   English

用于轮换密钥的 AWS Secret Manager Lambda 函数

[英]AWS Secret Manager Lambda function to rotate secrets

I have created a "other type of secret".我创造了一个“其他类型的秘密”。 I have also added a lambda function as give in this template .我还在这个模板中添加了一个 lambda 函数。 Now when I try to rotate immediately its saying "Fail to rotate the secret "TEST_SECRET_ROTATING" A previous rotation isn't complete. That rotation will be reattempted."现在,当我尝试立即旋转时,它说“无法旋转秘密“TEST_SECRET_ROTATING”,之前的旋转未完成。该旋转将被重新尝试。 The rotation time is one day, even next day I see secrete is not updated.轮换时间是一天,隔天我看secrete没有更新。 I simply added that lambda function.我只是添加了那个 lambda 函数。 Do I need to define any parameter or any other lambda settings.我是否需要定义任何参数或任何其他 lambda 设置。 I also see in documentation that If you enable automatic rotation, the first rotation will happen immediately when you store this secret.我还在文档中看到,如果您启用自动轮换,则在您存储此密钥时将立即进行第一次轮换。 But I don`t see this rotation even first time.但我第一次也没有看到这种轮换。 I also followed this question here .我也在这里关注了这个问题。 I was able to find version id of AWSPENDING stage, I delete this version ID> click on rotate secret immediately > I see "Secret successfully scheduled for rotation" > but secret us not changed yet, Is there any issue with lambda code now?我能够找到 AWSPENDING 阶段的版本 ID,我删除了此版本 ID> 立即单击轮换密钥 > 我看到“密钥已成功安排轮换”> 但我们的密钥尚未更改,现在 lambda 代码有问题吗?

其他问题中给出的答案很好,但我必须做一些更改,代码模板没有说我们需要为秘密管理器“SECRETS_MANAGER_ENDPOINT”创建 VPC 端点,我们需要为 lambda 角色授予 KMS 密钥权限,正如约翰所说,我们需要在 lambda 函数中添加 VPC,我还必须在 set_secret、test_secret 和 give pass 中注释“raise NotImplementedError”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM