This article will guide you on how to use Lambda functions to optimize costs for your system on AWS.
The deployment architecture can be seen in the following image: