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

Add AWS_REGION to environment defaults #491

Merged
merged 2 commits into from
Sep 27, 2018
Merged

Add AWS_REGION to environment defaults #491

merged 2 commits into from
Sep 27, 2018

Conversation

clschnei
Copy link
Contributor

@clschnei clschnei commented Sep 26, 2018

Description

The attempts to fix the necessity to explicitly set your region. Documentation from AWS prevents us from setting AWS_REGION in the environment config because it is reserved.

Possible Related Issues

@dherault dherault merged commit 990994e into dherault:master Sep 27, 2018
@dherault
Copy link
Owner

Thanks @clschnei ! v3.25.15

@clschnei clschnei deleted the add-region-env-default branch September 27, 2018 13:48
@clschnei
Copy link
Contributor Author

Is there a process for getting these published to npm? For now I'm just using my forked github ref as a package, but would like to migrate off soon as this goes "live".

@dherault
Copy link
Owner

it is published. v3.25.15. Sorry i forgot to publish :)

@rstar2
Copy link

rstar2 commented Oct 26, 2018

The AWS_REGION is added to environment for the handler but if there's an authorizer-handler in front it is still 'undefined' and thus working with the 'aws-sdk' in the authorizer is not possible again.
Adding:
Object.assign( process.env, { AWS_REGION: serverless.service.provider.region });
in createAuthScheme.js just before creating the authorizer handler
handler = functionHelper.createHandler(funOptions, options); fixes it.
Sorry I'm a little new to Git and don't know how to propose pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants