Copernicus Lambda Deployer
Deploys the Copernicus API to AWS Lambda (plus DynamoDB and API Gateway).
Getting started
- Fork, clone or download this project
- Download latest Terraform (1.1.7 at time of writing) from https://www.terraform.io/downloads
- Set
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
, andAWS_DEFAULT_REGION
environment variables per your AWS setup - Set the
TF_VAR_jwt_secret
environment variable to a secret value - At https://jwt.io/ you can generate a JWT based on that secret
- Install and use nodejs 14.x (e.g. with
nvm use 14
) cd infra/modules/lambda/src
npm install
zip -r lambda_copernicus_api.zip index.js node_modules
- In the
infra
top-level directory, create a file calledbackend.tfvars
with:bucket = "name-of-s3-bucket-for-your-tfstate"
region = "your-aws-region"
cd infra
terraform init -backend-config=backend.tfvars
terraform workspace new fooenv
- Run
terraform plan
to preview what will be deployed - Run
terraform apply
to deploy everything - You should be able to CRUD the Copernicus API at https://a1b2c3.execute-api.your-aws-region.amazonaws.com/v1/swagger-html/
Built by Douugh.