aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.49k stars 1.17k forks source link

`sam deploy` does not use specified S3 bucket in samconfig.toml #2599

Closed xirkus closed 3 years ago

xirkus commented 3 years ago

Description:

Attempting to use a previously configured S3 bucket for deployments by specifying the s3_bucket parameter in the samconfig.toml does not work.

Steps to reproduce:

  1. Create an S3 bucket with the same bucket policy as the SAM CLI's dynamically created default source bucket.
  2. Update your samconfig.toml to include this new bucket's ARN: s3_bucket = "arn:aws:s3:::bucket-name" (although I tried with the bucket name as well)
  3. Run sam build --guided.

Observed result:

Note the Deployment s3 bucket in the output provided:

Deploying with following values
===============================
Stack name                         : process-lambda
Region                                 : us-east-1
Confirm changeset            : True
Deployment image repository  : 
                                       {
                                           "ProcessFunction": "834609584094.dkr.ecr.us-east-1.amazonaws.com/dev-scrb-process"
                                       }
Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-1w6spftg6a31d <<<<
Capabilities                           : ["CAPABILITY_IAM"]
Parameter overrides            : {}
Signing Profiles                    : {}

Expected result:

The Deployment s3 bucket should use the supplied s3_bucket value configured in the samconfig.toml file (either arn:aws:s3:::bucket-name or bucket-name.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS:MacOS
  2. SAM CLI, version 1.17.0
  3. AWS region: us-east-1
Jacco commented 3 years ago

Current SAM version is 1.34.0. Have you tried upgrading?

jfuss commented 3 years ago

@Jacco SAM Version is 1.34 but the CLI version is 1.17. They are not versioned separately.

Transferring to the correct repo as this relates to SAM CLI not SAM the spec.

sriram-mv commented 3 years ago

I'm closing this issue as I could not reproduce it with the latest version of the SAM CLI. Please comment if you are still experiencing this.

vincentluan commented 3 years ago

I'm still experiencing this with SAM CLI 1.26.0 on Amazon Linux 2 OS. Although my issue is with sam deploy --guided instead.

hakiour commented 2 years ago

The issue is still happening on SAM CLI v1.37.0

romawu commented 1 year ago

Still facing this issue with SAM CLI v1.55.0

warrior8792 commented 1 year ago

I believe this still exists in SAM CLI v1.66.0

pedroGenio commented 1 year ago

same issue on SAM CLI, version 1.73.0 for "sam deploy --guided" also --s3-bucket didnt work

Axe-- commented 2 months ago

Works fine apparently without the --guided flag