Open paulthorburn opened 2 years ago
I noticed this same issue along with the prefix and bucket options not working. I documented these issues at bottom of my Readme.md here https://github.com/prower-turnitin/sam-app-with-layers. Main point of that issue documentation is about issues with publishing to Serverless Application Repository. I mentioned issues I found with using .toml file and s3 flags at the bottom of that Readme.md.
Hello there @paulthorburn @prower-turnitin I am sorry that this issue has been a pain point for you guys, but unfortunately is working as designed. For using --guided for --resolve-s3 options, we will by design use the default managed s3 location. Specifying an s3 location does not override that. I believe we have a option mechanism that errors out when both s3-bucket and resolve-s3 are provided, maybe we can have that kind of check on guided deployments as well. Let us know if you have any further questions!
You can specify the bucket destination in samconfig.toml
file under the following line
[default.deploy.parameters]
...
s3_bucket = "my-bucket"
s3_prefix = "my-object"
After the first sam deploy --guided
, if you answered Yes to save configuration question, it will save the config it in samconfig.toml
file. The next deployment, if you want to update your stack, just sam deploy
without guided flag. And the above line and it will save within that bucket.
Description:
I was thinking it would be nice to have 1 bucket for aws sam deployments rather than several randomly named buckets "aws-sam-cli-managed-default-samclisourcebucket-xxxxxxx". If. you try to do --guided with --s3-bucket switch is ignored and it will create a randomly named bucket for you.
Also the ' --resolve-s3 ' switch makes reference to a '--s3-guided' switch that does not exist.
Steps to reproduce:
sam deploy --guided --profile myadminprofile --s3-bucket SomeS3BucketNaneGoesHere
Observed result:
SAM creates a bucket "sam-cli-managed-default-samclisourcebucket-xxxxxxx"
Expected result:
SAM uses the bucket name i specify
Workaround:
sam deploy --guided .... sam delete edit samconfig.toml with new s3 bucket name sam deploy ...
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.40.1