AWS Lambda function allowing removal of keys from Redis
Built with ❤︎ by
Stockport Council and
contributors
- Easy invalidation: simple way to remove a value from Redis using the key
A REDIS_URL
environment variable has to be set, providing the url to your Redis store. The default Redis port (6379) is used.
We needed a simple, standalone solution to invalidate our Redis cache distributions.
Built to be used with AWS Lambda and API Gateway.
To manually send a request to trigger a invalidate request you need to supply a 'Header' value of key 'x-api-key' with the API Gateway key associated with the Enviroment you are targeting.
The API Gateway url is found at: APIs > invalidateRedis > Stages (The url will end with default/invalidaRedis{ENV})
The API Gateway API key is found at within AWS gateway.
Possible responses:
- 200 OK: Successfuly deleted the key. Also returned when the key does not exist in the store.
- 500 Internal Server Error: Error while carrying out the operation. Contains
error
property.