Mar 17, 2023
Hey,
For us, most of our staging is hosted on a single EC2 and RDS, for now we just turn it off programmatically using a lambda function which gets triggered on a CRON job basis and turn it off and on accordingly using appropriate permission.
Since, the staging env is off, no requests reaches Staging Lambda functions and thus no invocation.
Also, if there is an independent function that needs to be turned off, simple disable and enable cloudfront / api gateway in-front of the lambda function, this will not invoke any lambda function.
Simple.
I will try and spin an article on how I do this. Thanks.