Using this as lambda function - https://github.com/aws-samples/aws-secrets-manager-rotation-lambdas/blob/master/SecretsManagerRotationTemplate/lambda_function.py. giving perimeters as
{
"SecretId": "giving arn",
"ClientRequestToken":"giving random 32 digit number",
"Step":"testsecret"
}
Giving Error:
{
"errorMessage": "'SECRETS_MANAGER_ENDPOINT'",
"errorType": "KeyError",
"requestId": "##",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 17, in lambda_handler\n service_client = boto3.client('secretsmanager', endpoint_url=os.environ['SECRETS_MANAGER_ENDPOINT'])\n",
" File \"/var/lang/lib/python3.9/os.py\", line 679, in __getitem__\n raise KeyError(key) from None\n"
]
}
Function Logs
START RequestId: ####### Version: $LATEST
[ERROR] KeyError: 'SECRETS_MANAGER_ENDPOINT'
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 17, in lambda_handler
service_client = boto3.client('secretsmanager', endpoint_url=os.environ['SECRETS_MANAGER_ENDPOINT'])
File "/var/lang/lib/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from NoneEND RequestId:########
REPORT RequestId: #### Duration: 13.10 ms Billed Duration: 14 ms Memory Size: 128 MB Max Memory Used: 52 MB Init Duration: 251.10 ms