How to Reduce Cost of SAM Artifact Storage using S3 & CloudFormation
One subtle thing that you do when working AWS SAM is that you upload the Lambda deployment packages (artifacts) to a staging bucket where Lambda service retrieve these packages. After the artifacts were retrieved by AWS Lambda from s3, those packages often stay in the staging bucket and may build up over time especially for large projects with tons of Lambda functions. This often lead to a slow and steady increase in S3 bills over time. In this article, we will explored what are the common ways on to reduce the cost generated by SAM deployment artifacts over time. Option 1: Add a 1-day Expiry Rule for Dev Environment Artifacts Deployment artifacts for development environments are basically non-valuable to an organization, it doesn't allow developers to extract useful debugging information out of them except from cases where you really need to inspect the packages. To help your organization reduce cost, you can configure your development artifact storage for S3 bucke...