- node.js
- globally installed terraform
- globally installed nestjs
- docker
- cd secrets
- openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
- create local.env file in src/common/envs folder and update env variables according to .env file
- cd ../
- You can start project in two ways: npm run start or start using Dockerfile
- cd deployment
- create variables.tf file and update it according to variables.example.tf file. Delete variables.example.tf
- terraform plan -out=planName
- terraform apply planName
- check your IP in amazon ECS task definitions
- ACCOUNT_ID=$(aws sts get-caller-identity | jq -r ".Account")
aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin "$ACCOUNT_ID.dkr.ecr.eu-central-1.amazonaws.com" - Create docker image using Dockerfile (update NODE_ENV to "DEVELOPMENT")
- Create development.env and update it according to .env file (HOSTNAME should be you server IP)
- docker tag :latest
- docker push :latest
P.S. you can find postman collection (IoT-server.postman_collection.json) in the root folder of the project