I found this rotation function template, I'm going to modify this template to create my own rotation function and tell Secrets Manager to use it perform the rotation.
My question is which part in the template should I change, it's not very clear in the template, such as line 47-49, should I replace SecretId
with my Secret ARN?
arn = event['SecretId']
token = event['ClientRequestToken']
step = event['Step']
Another example: line 57
endpoint_url=os.environ['SECRETS_MANAGER_ENDPOINT']
What value should I use for 'SECRETS_MANAGER_ENDPOINT'
, maybe 'https://secretsmanager.region.amazonaws.com'
??
In addition, line 205-206
This is where the lambda will validate the user's permissions.
Uncomment/modify the below lines to
# tailor these validations to your needs
What exactly I need to add in this part to grant the Secrets Manager permission to call this function?
A bit confused,I've been messing around with the whole credential rotation almost a whole day, any suggestions will be appreciated.