aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 819 forks source link

Removal of unused resources in S3 bucket and better asset management #10893

Open ykethan opened 2 years ago

ykethan commented 2 years ago

Is this feature request related to a new or existing Amplify category?

No response

Is this related to another service?

S3

Describe the feature you'd like to request

Amplify CLI perform S3 actions to upload files such as current-cloud-backend while maintaining older unused assets in the S3 bucket, this incurs additional storage costs.

Additionally, Amplify performs recurrent s3 API calls when a resource has been updated, causing additional costs for the API calls. For example: when a small change has been performed on a lambda layer Amplify performs multiple API calls that replaces the existing layer while maintaining older version of the layer as well.

For users utilizing the free tier provided by AWS the usage of S3 for every update causes the limit to be reached very quickly.

Describe the solution you'd like

Remove unused assets from S3 bucket and reduce the number of S3 API calls needed to perform updates.

Describe alternatives you've considered

creating manual scripts that remove older assets

Additional context

No response

Is this something that you'd be interested in working on?

Would this feature include a breaking change?

indiebloom commented 1 year ago

10873 does a better job of explaining the issues I'm having, but this seems to be the master task now. In a single day Amplify caused 4100 S3 reads and 750 writes over just a few builds.