Skip to content

Commit

Permalink
fix: Boto3 reads AWS_DEFAULT_REGION not AWS_REGION (#6037)
Browse files Browse the repository at this point in the history
When we deploy the managed stack and SAM CLI deploys the stack, if there
is no region found we state to set the AWS_REGION. Boto3 only reads the
AWS_DEFAULT_REGION, causing customer confusion

Co-authored-by: Jacob Fuss <[email protected]>
  • Loading branch information
jfuss and jfuss authored Oct 4, 2023
1 parent aa35c0a commit 085f2b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self, stack_name, region, s3_bucket, s3_prefix):
except NoRegionError as ex:
raise RegionError(
"Error Setting Up Managed Stack Client: Unable to resolve a region. "
"Please provide a region via the --region parameter or by the AWS_REGION environment variable."
"Please provide a region via the --region parameter or by the AWS_DEFAULT_REGION environment variable."
) from ex

def set_functions(
Expand Down
4 changes: 2 additions & 2 deletions samcli/lib/utils/managed_cloudformation_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def update_stack(
except NoRegionError as ex:
raise RegionError(
"Error Setting Up Managed Stack Client: Unable to resolve a region. "
"Please provide a region via the --region parameter or by the AWS_REGION environment variable."
"Please provide a region via the --region parameter or by the AWS_DEFAULT_REGION environment variable."
) from ex
return _create_or_update_stack(cloudformation_client, stack_name, template_body, parameter_overrides)

Expand Down Expand Up @@ -140,7 +140,7 @@ def manage_stack(
except NoRegionError as ex:
raise RegionError(
"Error Setting Up Managed Stack Client: Unable to resolve a region. "
"Please provide a region via the --region parameter or by the AWS_REGION environment variable."
"Please provide a region via the --region parameter or by the AWS_DEFAULT_REGION environment variable."
) from ex
return _create_or_get_stack(cloudformation_client, stack_name, template_body, parameter_overrides)

Expand Down

0 comments on commit 085f2b8

Please sign in to comment.