/copernicus-lambda-deployer

Deploys the Copernicus API to AWS Lambda (plus DynamoDB and API Gateway).

Primary LanguageHCLApache License 2.0Apache-2.0

Copernicus Lambda Deployer

Deploys the Copernicus API to AWS Lambda (plus DynamoDB and API Gateway).

Getting started

  1. Fork, clone or download this project
  2. Download latest Terraform (1.1.7 at time of writing) from https://www.terraform.io/downloads
  3. Set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_DEFAULT_REGION environment variables per your AWS setup
  4. Set the TF_VAR_jwt_secret environment variable to a secret value
  5. At https://jwt.io/ you can generate a JWT based on that secret
  6. Install and use nodejs 14.x (e.g. with nvm use 14)
  7. cd infra/modules/lambda/src
  8. npm install
  9. zip -r lambda_copernicus_api.zip index.js node_modules
  10. In the infra top-level directory, create a file called backend.tfvars with: bucket = "name-of-s3-bucket-for-your-tfstate" region = "your-aws-region"
  11. cd infra
  12. terraform init -backend-config=backend.tfvars
  13. terraform workspace new fooenv
  14. Run terraform plan to preview what will be deployed
  15. Run terraform apply to deploy everything
  16. 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.