This repository has been archived by the owner on Nov 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 575
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(proxy-service): don't hardcode AWS_REGION
Removes the hardcoded AWS_REGION from the Serverless config and adds a guard to the predeploy script to check that AWS_REGION is set.
- Loading branch information
1 parent
fda5cac
commit 20d338d
Showing
2 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,37 @@ | ||
if (typeof process.env.AWS_REGION === 'undefined') { | ||
console.error(` | ||
Please set the "AWS_REGION" environment variable to the AWS region to which you wish to deploy. | ||
These are some cheap options: | ||
Ireland: eu-west-1 | ||
USA, Virginia: us-east-1 | ||
USA, Oregon: us-west-2 | ||
For example: | ||
export AWS_REGION=eu-west-1 | ||
`) | ||
process.exit(1) | ||
} | ||
|
||
if (typeof process.env.AWS_IOT_HOST === 'undefined') { | ||
console.error(` | ||
Please set the "AWS_IOT_HOST" environment variable to your region's AWS IoT Custom Endpoint. | ||
Please set the "AWS_IOT_HOST" environment variable to your ${ | ||
process.env.AWS_REGION | ||
} region's AWS IoT Custom Endpoint. | ||
You can find it here: | ||
https://eu-west-1.console.aws.amazon.com/iot/home#/settings | ||
https://eu-west-1.console.aws.amazon.com/iot/home?region=${ | ||
process.env.AWS_REGION | ||
}#/settings | ||
Or with the AWS CLI: | ||
aws iot describe-endpoint --output text | ||
aws iot describe-endpoint --output text --region ${process.env.AWS_REGION} | ||
For Example: | ||
export AWS_REGION=replacethispart.iot.eu-west-1.amazonaws.com | ||
`) | ||
process.exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters