AWS_REGION environment variable doesn't work
See original GitHub issueThis is a Bug Report
Description
For bug reports:
- What went wrong? I set the AWS_REGION environment variable to
eu-west-1
as described in the documentation, but my API was deployed tous-east-1
- What did you expect should have happened? The API should have been deployed to the
eu-west-1
AWS region - What was the config you used? A config without a default region set
- What stacktrace or error message from your provider did you see?
For feature proposals:
- What is the use case that should be solved. The more detail you describe this in the easier it is to understand for us.
- If there is additional config how would it look
Similar or dependent issues:
Additional Data
- Serverless Framework Version you’re using: 1.17.0
- Operating System: Windows 10 (1703)
- Stack Trace:
- Provider Error messages:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Using AWS Lambda environment variables
Configuring environment variables · Open the Functions page of the Lambda console. · Choose a function. · Choose Configuration, then choose Environment variables....
Read more >aws-cli: Exporting region env var not working? - Stack Overflow
The correct environment variable for region is AWS_DEFAULT_REGION . Refer this link for the list of environment variables.
Read more >Working with Environment Variables in Python - Twilio
Learn how to work with environment variables to configure your Python application.
Read more >Deploy-ECS.gitlab-ci.yml AWS_REGION variable (#219131)
I'm on gitlab.com and tried deploying to AWS ECS using the instructions for including the Deploy-ECS.gitlab-ci.yml template found here. I ended ...
Read more >HCL2 Environment Variables - Packer - HashiCorp Discuss
I am trying to use an env var AWS_REGION but not too sure how to do it using HCL2. ... but it doesn't...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@horike37
Here is my workaround,
AWS_DEFAULT_REGION
orAWS_REGION
is an environment variable, it should be set like this:@eahefnawy @horike37 I would think this order makes the most sense:
--region=eu-west-1
AWS_REGION
env var~\.aws\config
(set by the AWS CLI)My reasoning behind this is that more specific options should, IMO, get more precedence:
serverless.yml
is specific to the service being deployedAWS_REGION
is specific to serverless on the machine~\.aws\config
is specific to the AWS config on the machine