Deploy NestJS app to AWS ECS using Pulumi [Quick Tutorial]software
February 06, 2022
Pulumi is my favorite tool. It’s a great tool for building and deploying apps to the cloud platforms such as AWS, Azure, Google Cloud, etc. I’ve been using it for a while now and I’m very happy with the experience. Extremely easy to use and very powerful.
Create a new Pulumi project
$ pulumi new my-project $ cd my-project
- Install Pulumi NPM dependencies and import to the related js/ts file
- Define the credientials for Container
- Create a VPC, Gateway and Route Table
In that point I want to show you an AWS Architecture diagram.
You can see the best practices for creating a VPC, Subnets etc.. but we don’t need to create them for this lab.
- Create a S3 Bucket for storing the static files (I assume we also have frontend app)
- We almost done. We need to create an Elastic Load Balancer to reach the server app. After that we will create a AWS ECS fargate task definition. The task definition will be used to create a ECS cluster. It will also build our docker image and push it to the ECR.
- Let’s execute the following commands to run the IaC.
$ pulumi up
- Go to the pulumi dashboard and see the output. That’s all. :)
See you in the next lab.