I am using aws cloudformation package
to automatically package and upload Lambda function code to an S3 bucket.
When I upload a new version of the Lambda function, previous objects remain in the S3 bucket. Is there any way to automatically remove "old" versions when uploading a new one?
CodePudding user response:
Sadly there is no such way with just aws cloudformation package
command. You would have to chain with other command to delete (aws s3api delete-object
) the previous version yourself.