https://github.com/greenvine/serverless-ts-boilerplate
Typescript Boilerplate for Serverless Framework
https://github.com/greenvine/serverless-ts-boilerplate
aws aws-lambda boilerplate serverless typescript
Last synced: 9 months ago
JSON representation
Typescript Boilerplate for Serverless Framework
- Host: GitHub
- URL: https://github.com/greenvine/serverless-ts-boilerplate
- Owner: GreenVine
- Created: 2018-05-31T14:33:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-31T14:38:23.000Z (almost 8 years ago)
- Last Synced: 2024-12-30T16:53:21.218Z (over 1 year ago)
- Topics: aws, aws-lambda, boilerplate, serverless, typescript
- Language: JavaScript
- Size: 54.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Serverless Typescript Boilerplate
## Environment Variables
```bash
export API_DOMAIN=hello.api.example.com # API Gateway Endpoint Domain
export AWS_REGION=us-east-1 # Deployment Region
export API_CERT_NAME=*.api.example.com # API Certificate Name (Best match)
export API_STAGE=v1 # Stage name
```
## Deployment
### SSL Certificate
The environment variable `API_CERT_NAME` specifies the certificate name for API Gateway custom domain. The Serverless plugin will do the best-match over this name. Refer to [serverless-domain-manager plugin documentation](https://github.com/amplify-education/serverless-domain-manager) for detailed guidance.
### Custom Domain
#### Set up
To set up the custom domain for API Gateway, simply run `yarn run sls create_domain` once.
Please note that this command cannot modify the existing custom domain that created previously by other means, e.g. through AWS Console, API.
Sample Output:
`
Serverless: 'hello.api.example.com' was created/updated. New domains may take up to 40 minutes to be initialized.
`
#### Tear Down
To remove the custom domain, run `yarn run sls delete_domain` once.
### Deploy Project
To deploy or update the project, run `yarn run sls deploy`.
### Destroy Project
:warning: To destroy all resources, run `yarn run sls remove`. **Be careful when running this command towards a production stage name**.
## References
### AWS as the Provider
- [Quick Start Guide](https://serverless.com/framework/docs/providers/aws/guide/quick-start/)
- Serverless Config: [serverless.yml](https://serverless.com/framework/docs/providers/aws/guide/serverless.yml)
- [API Gateway Events](https://serverless.com/framework/docs/providers/aws/events/apigateway)