Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sam deploy guided doesn't allow specifying bucket #1700

Open
eedwards-sk opened this issue Jan 2, 2020 · 13 comments
Open

sam deploy guided doesn't allow specifying bucket #1700

eedwards-sk opened this issue Jan 2, 2020 · 13 comments
Labels
area/deploy sam deploy command type/feature Feature request

Comments

@eedwards-sk
Copy link

Description

A new stack is created instead of updating an existing stack when using --guided.

--guided does not allow me to specify the bucket

Steps to reproduce

Create a stack without a samconfig.toml

Attempt to update the stack using sam deploy --guided

Observed result

A new stack is created / the name of bucket is never asked for.

Expected result

Bucket name is asked for, existing stack is modified.

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

  1. OS: osx 10.15.1
  2. sam --version: SAM CLI, version 0.39.0

Add --debug flag to command you are running

@c2tarun
Copy link
Contributor

c2tarun commented Jan 2, 2020

Hi @eedwards-sk,

Thanks for reporting this issue. I am trying to reproduce. I do agree that s3 bucket name is not asked and guided deploy creates a new bucket. However, for me it is picking my previous stack name and not creating new stack. Following are steps I tried to reproduce:

  1. sam init to create hello world python.
  2. aws s3 mb s3://issue-1700-bucket to create s3 bucket.
  3. sam deploy --s3-bucket issue-1700-bucket --stack-name issue-1700-stack --capabilities CAPABILITY_IAM to deploy.
  4. Made a minor code change.
  5. sam deploy --guided to deploy.
    1. Enter stack name as issue-1700-stack which was used during deploy.
    2. Enter region.

My deployment updated my stack. Here is my samconfig.toml file.

version = 0.1
[default]
[default.deploy]
[default.deploy.parameters]
stack_name = "issue-1700-stack"
s3_bucket = "aws-sam-cli-managed-default-samclisourcebucket-69h5i89z4z54"
s3_prefix = "issue-1700-stack"
region = "us-west-2"
confirm_changeset = true
capabilities = "CAPABILITY_IAM"

Can you please confirm if your stack name was same or not?

@c2tarun c2tarun added the blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. label Jan 2, 2020
@eedwards-sk
Copy link
Author

I tried that, but a samconfig.toml was not generated when using sam deploy without --guided

and a new stack was created

@eedwards-sk
Copy link
Author

sam deploy --profile brainier --region us-east-1 --stack-name brainier --s3-bucket brainier --capabilities CAPABILITY_IAM

this works against existing stack

but following that up with the following:

sam deploy --profile brainier --guided

and entering the same stack name as above, results in a new stack:

Screen Shot 2020-01-02 at 2 15 02 PM

and it doesn't allow me to specify the bucket

it's a mess

@c2tarun
Copy link
Contributor

c2tarun commented Jan 2, 2020

Can you please explain what do you mean by new stack? In your screenshot I only see one stack with stack-name brainier.

@eedwards-sk
Copy link
Author

Uh... aws-sam-cli-managed-default ?? Are you looking at the same screenshot I am? Lol!

@jfuss
Copy link
Contributor

jfuss commented Jan 2, 2020

@eedwards-sk Let's be respectful please.

The new stack is the managed stack guided will produce (this is by design). Guided creates this stack so we can package artifacts and put them into a bucket that you do not need to provide. If this is not desired, you will need to not use guided, as that is not something guided allows at the moment.

@eedwards-sk
Copy link
Author

As per my initial issue description, I wish to provide the bucket and use an existing stack when using --guided.

If this is not supported by design, you may change it to a feature request.

@jfuss
Copy link
Contributor

jfuss commented Jan 2, 2020

@eedwards-sk I understand. I was just explaining what the current state is and what the extra stack is/why we create it.

@jfuss jfuss added area/deploy sam deploy command type/feature Feature request and removed blocked/more-info-needed More info is needed from the requester. If no response in 14 days, it will become stale. labels Jan 2, 2020
@mousedownmike
Copy link

I'm having issues with the fact that if I specify --s3-bucket and --s3-prefix in addition to --guided my --s3-* flags are silently ignored. The sam deploy documentation doesn't indicate that in --guided mode most (all?) of the remaining flags are ignored.

Is this an active feature request? If it isn't an active request (i.e. not likely to change soon), I'm happy to make a PR to update the docs, I'm curious which additional flags are ignored in guided mode. I'm guessing the following:

  • stack-name
  • s3-bucket
  • s3-prefix
  • capabilities
  • parameter-overrides
  • config-file
  • config-env

@GeniusWiki
Copy link

First day use sam, try hello world and use --guided as README, stop on "InvalidBucketName" error. After I found this bug open over a year, I wonder if I should put time to learn sam... it is failed in such basic step by step test. Any confidence to use it in production?

@mousedownmike
Copy link

@GeniusWiki my experience has been that SAM is adequate for production once deployed. The problems you'll run into are centered around the CLI which has a lot of bugs that don't seem to be getting resolved. I chose SAM because it's the only way I could use CodeDeploy. The struggle with the CLI is unfortunate but necessary.

This is one of those cases where you should be suspicious of the tool before your own code.

@miridius
Copy link

miridius commented Sep 9, 2021

This has been fixed (for me at least) by upgrading to v1.31 - see #3243 (comment)

@qingchm
Copy link
Contributor

qingchm commented Jan 28, 2022

Sorry guys but --guided by design does not yet take in custom s3 bucket values so yes what you are experiencing is expected. We have noted the feature request and will try to evaluate the request with the team!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deploy sam deploy command type/feature Feature request
Projects
None yet
Development

No branches or pull requests

8 participants