我已经使用单用户轮换策略在 AWS Secret Manager 中创建了扇区。现在我想测试生成的 lambda 函数。在测试 lambda 函数时,我提供了如下所示的 args:
{
"Step": "setSecret",
"SecretId": "arn:aws:secretsmanager:us-east-1:xxxxxxxxxxx:secret:test_qa-ldpjrx",
"ClientRequestToken": "72921c2c-df3b-11eb-ba80-0242ac130004"
}
我从https://www.uuidgenerator.net/version1生成 "ClientRequestToken": "72921c2c-df3b-11eb-ba80-0242ac130004" 令牌并粘贴它。
在执行测试用例时,我遇到了以下问题:
{
"errorMessage": "Secret version 72921c2c-df3b-11eb-ba80-0242ac130004 has no stage for rotation of secret arn:aws:secretsmanager:us-east-1:xxxxxxxxxxx:secret:test_qa-ldpjrx",
"errorType": "ValueError",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 63, in lambda_handler\n raise ValueError(\"Secret version %s has no stage for rotation of secret %s.\" % (token, arn))\n"
]
}
这是描述秘密的控制台输出:
aws secretsmanager describe-secret --secret-id test_qa
{
"ARN": "arn:aws:secretsmanager:us-east-1:xxxxxxxxxxx:secret:test_qa-ldpjrx",
"Name": "test_qa",
"RotationEnabled": true,
"RotationLambdaARN": "arn:aws:lambda:us-east-1:10582323238:function:SecretsManagertest_qa",
"RotationRules": {
"AutomaticallyAfterDays": 30
},
"LastRotatedDate": "2021-07-07T21:22:10.689000+05:30",
"LastChangedDate": "2021-07-07T21:22:10.698000+05:30",
"LastAccessedDate": "2021-07-07T05:30:00+05:30",
"Tags": [],
"VersionIdsToStages": {
"aeee838a-6719-4d6a-be89-515a205ea470": [
"AWSCURRENT"
],
"d58a7df7-77ce-40e1-ad9c-2bbc9f9da98c": [
"AWSPREVIOUS"
]
},
"CreatedDate": "2021-07-07T19:51:32.487000+05:30"
}
我到底在哪里失踪?