https://github.com/coderbyheart/smartvan-aws
AWS resources for SmartVan
https://github.com/coderbyheart/smartvan-aws
smartvan
Last synced: 8 months ago
JSON representation
AWS resources for SmartVan
- Host: GitHub
- URL: https://github.com/coderbyheart/smartvan-aws
- Owner: coderbyheart
- Archived: true
- Created: 2020-11-23T22:57:44.000Z (about 5 years ago)
- Default Branch: saga
- Last Pushed: 2021-06-26T10:06:51.000Z (over 4 years ago)
- Last Synced: 2024-11-08T16:44:52.364Z (about 1 year ago)
- Topics: smartvan
- Language: TypeScript
- Homepage:
- Size: 2.4 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SmartVan

[](https://github.com/semantic-release/semantic-release)
[](http://commitizen.github.io/cz-cli/)
[](https://github.com/prettier/prettier/)
[](https://github.com/typescript-eslint/typescript-eslint)
AWS resources for
[SmartVan](https://github.com/coderbyheart?tab=repositories&q=smartvan&type=&language=).
## Deploy to AWS
Make these environment variable available:
> ℹ️ Linux users can use [direnv](https://direnv.net/) to simplify the process.
export AWS_REGION=<...>
export AWS_DEFAULT_REGION=<...>
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
Install dependencies
npm ci
Compile the source
npx tsc
Set the ID of the stack
export STACK_NAME="${STACK_NAME:-smartvan}"
Prepare the account for CDK resources:
npx cdk -a 'node dist/cloudformation-sourcecode.js' deploy
Deploy the server stack to an AWS account
npx cdk deploy ${STACK_NAME:-smartvan}
## Create a Thing for the SmartVan
Create a Thing and assign it to the `smartvan` group.
mkdir certificates
aws iot create-thing --thing-name smartvan
aws iot add-thing-to-thing-group --thing-group-name smartvan --thing-name smartvan
aws iot create-keys-and-certificate --set-as-active > certificates/smartvan.json
aws iot attach-thing-principal --thing-name smartvan --principal `cat certificates/smartvan.json | jq -r ".certificateArn"`