Aws-sam-cli: Specify name of zip file uploaded to s3 while running "sam package"

Created on 11 May 2019  路  3Comments  路  Source: aws/aws-sam-cli

Describe your idea/feature/enhancement

Every time I run command "sam package", it create a zip file with optional name then upload this zip file to s3. So, this command will create many zip file in s3 when I run "sam package" multiple time.

Proposal

It's good to specify a name of zip file which is uploaded to s3 when run "sam package"

Most helpful comment

This works but still, it would be better to have a name of the zip file rather than just random string.
Also, would be it worth having a command to just create the zip file?

All 3 comments

:+1 any update on this? My S3 bucket is filled with old zip files I think the whole name won't do because cloudformation needs to know when the zip file has been updated. A better option would be to add a prefix.

The --s3-prefix option exists today, and you can use this to prefix any of the auto-generated names using any scheme you like (S3 folder style or prefixes). For example:

sam package --output-template packaged.yml --s3-bucket my-source-bucket --s3-prefix "my-project/"

This works but still, it would be better to have a name of the zip file rather than just random string.
Also, would be it worth having a command to just create the zip file?

Was this page helpful?
0 / 5 - 0 ratings