-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 delete
doesn't detect region.
#5248
Comments
@garretwilson Thanks for reporting. Marking this as a bug. |
Patch is released in v1.87.0. Closing |
|
I just tested with v1.88.0, and it appears this fixed the problem. Thank you, @jfuss! Have a great weekend. |
I'm using SAM 1.84.0 on Windows 10.
I can deploy a stack using something like this:
sam deploy \ --profile my-aws-profile \ --template-file $SCRIPT_DIR/sam-template.yaml \ --stack-name my-stack \ --s3-bucket sam-bucket
Note that I don't specify a region anywhere. My
samconfig.toml
doesn't contain anything about a region. I have set up a default region inmy-aws-profile
, which is standard for AWS CLI work. For example my~/.aws/cofig
might look like this:That all works as expected. But then it comes time to delete the stack:
Unfortunately that produces:
But I don't want to remember what region to use and provide a
--region
on the command line. The region is already known because I specified a--profile
, for while a region is specified. Again this is standard AWS CLI configuration.I didn't need to specify a
--region
when I ransam deploy …
. I shouldn't be required to provide a--region
when I delete the same stack, providing the same information, when runningsam delete …
.This is not just an inconvenience: it is a duplication of information that promotes errors in the future. We have a centralized location for defining the profile, and it gets passed to the batch files as
$awsProfile
. Imagine for example that we take this project and simply change$awsProfile
. The entire deployment will work exactly the same, except that it will use the other AWS profile in the appropriate region. But becausesam delete …
requires a separate--region
designation (even though it should already know that information, just assam deploy …
does), what happens if we forget to go update the--region
information in the batch files when we update$awsProfile
? The whole thing breaks — needlessly.Please update the
sam delete …
logic to determine the region based upon the AWS profile in the standard AWS CLI~/.aws/cofig
configuration, as it does forsam deploy …
.The text was updated successfully, but these errors were encountered: