-
-
Notifications
You must be signed in to change notification settings - Fork 796
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
Failure: Missing region in config #189
Comments
Same here, I've defined my stage and region in |
Hi, thanks for reporting this issue. This does not look like an error the plugin would raise. Can someone paste a stack trace please ? |
I've attached the stack trace, but the error occurs when trying to initialise an AWS service. The stack trace doesn't show any errors from the plugin - it seems as if environment variables such as stage and region aren't being passed any more :/
|
Ahh I just remembered a workaround, export the environment variable yourself: $ export SERVERLESS_REGION=us-east-1
$ sls offline --location .webpack I'm using this package in conjunction with |
I was facing this same issue, but the above didn't fix it, this however did:
|
Thank you @benday280412 ! Works for me too! |
This error happens if you run code locally that tries to access AWS resources without explicitly specifying a region. E.g. if you just do something like this: const sns = new AWS.SNS({ apiVersion: '2010-08-01' }); In that case the AWS_REGION environment might be set if the user doesn't set it explicitly in the Typically you want to explicitly specify a region for your resources. The resources you want to access might not be in the same region where your code runs. We usually use the following pattern (and I guess that's what @hassankhan does as well): const sns = new AWS.SNS({ apiVersion: '2010-08-01', region: process.env.SERVERLESS_REGION }); This sets the region explicitly to a To simulate the AWS environment more closely, @dherault You think we should open a new task discussing setting |
Coincidentally I've just found this: serverless/serverless#3908 -- Seems |
We shouldn't have to explicitly set |
I get this error upon sending my first request while using serverless-offline. No idea what it means, though other issues on the internet seem to imply that it has to do with environment variables that get populated when you deploy ... how does one get over this while working/testing with serverless-offline?
The text was updated successfully, but these errors were encountered: