This is the project where we manage our IaC. For this we use terraform
and serverless
With terraform we create the base structure:
- Amazon API Gateway
- Cognito Userpool and clients
- S3 buckets
- IAM Roles
In order to get the instalation of terraform you'll need to download the terraform cli from here
To get the aws plugin and the necesary configuration for terraform, cd to the folder terraform and run:
terraform init
To create and set a workspace (aka stage), you can perform:
terraform workspace new <ws>terraform workspace select <ws>
Where
<ws>is the desired workspace
Simply run:
terraform apply
You need to have
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY
With serverless we create the logic and storage:
- AWS Lambda
- DynamoDB
- DynamoDB Streams
The project and the version to deploy are in the file:
./serverless/deploy.properties
In order to deploy all of the projects declared in deploy.properties first:
cd serverless
Then run:
./deployStack.sh