Search code examples
node.jsamazon-web-servicesaws-sdkaws-api-gatewayaws-sdk-nodejs

Programmatically generating temporary AWS API Keys using JS SDK


I'm using AWS Javascript SDK to create API Keys. I now wanna create API Keys for some short period of time say for 15 days and need to remove/disable the keys after that time.

Is there any best way to do it programmatically preferably using anything like functions of their JavaScript SDK?


Solution

  • There's no current way to automatically expire API keys after a set amount of time, however it should be pretty trivial to implement yourself.

    For example, you could write a scheduled Lambda function that scans through the API Keys and disables them based on their createdDate or contents of description field.