https://github.com/chrispsheehan/lambda-express-api
Run express api in lambda. Deploy multiple environments.
https://github.com/chrispsheehan/lambda-express-api
aws bash express github-actions lambda terraform
Last synced: 3 months ago
JSON representation
Run express api in lambda. Deploy multiple environments.
- Host: GitHub
- URL: https://github.com/chrispsheehan/lambda-express-api
- Owner: chrispsheehan
- Created: 2024-01-06T11:43:12.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-24T19:28:46.000Z (about 2 years ago)
- Last Synced: 2025-03-23T09:19:00.557Z (over 1 year ago)
- Topics: aws, bash, express, github-actions, lambda, terraform
- Language: HCL
- Homepage:
- Size: 207 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lambda-express-api
Express api running in aws lambda.
## security
Move all access settings to github. Only allow user x to create tags/run workflows manually etc.
## environments
Multiple environments are supported via [terraform workspaces](https://developer.hashicorp.com/terraform/language/state/workspaces).
- Changes to main are automatically deployed to dev.
- New tags will trigger deploy to QA.
- `git tag v1.0.0 && git push origin --tags`
- Deploy tag to prod by manually running `Deploy Environment` workflow
- Pass in the file name i.e. `v1.0.0.zip` along with a message.
## terraform
Minimum requires deployment iam privileges.
```json
[
"dynamodb:*",
"s3:*",
"lambda:*",
"apigateway:*",
"iam:*"
]
```
## ci
Commits to `main` will kick off a deployment.
Required github action variables.
- `AWS_ACCOUNT_ID`
- `AWS_REGION`
- `AWS_ROLE` role with deployment privileges
- `AWS_ROLE_VALIDATE_ONLY` role with readonly privileges (can be same as `AWS_ROLE`)
## lambda code
Uses the [aws-serverless-express](https://www.npmjs.com/package/aws-serverless-express) npm library.