=> Running without Dockerfile
- npm install
- node code.js
=> Running using Dockerfile
-> Build docker Image using Dockerfile
-> Run docker Image in iteractive terminal mode
-
docker run -it -p 3000:3000 --name http-container http-project:0.0.1
To run in detached mode run use flag -d.
-
First use
terraform initcommand to Initialise and download our resource we mentioned in main.tf file
-
Following that use
terraform validatecommand -> This will find any syntax error or any variable we're missing out referring to and etc.
-
Now use
terraform plancommand, this will show the plan also throw error if you haven't exposed the variables. It will look something like this. In our case.
-
Finally, use
terraform --auto-approvecommand and let the terraform do it's magic.
When we go to our http://publicIP:3000/list-bucket-content. We will be seeing

Assumptions:
- S3 Bucket Unblocking access for account and bucket(our bucket. Named "list-bucket-content)
- Please refer code.js file inside the Part-1 directory to maintain the flow of understanding the project
- Response you'll get once you run npm install -> node code.js command

- Create Dockerfile. So that we will not have to face the issue "It works on my machine."
- Use AWS Secrets Manager to store the secrets and create required Role and attach a Policy to it. Follow least privilege best practice.
- Create an EC2 Instance and deploy on it.
- Use default VPC, and create a Security Group with required ports to expose.
- Refer to main.tf file inside the Part-2 directory while understanding it you'll have to refer to variables.tf and userdata.sh
- I have made a video of 18 minutes and 58 seconds. I have attached it in the end of the this README file go through it for better understanding.
- Then output.tf -> Once, the infrastructure is provisioned, Terraform will show us the value of these parameters.
Yeah so that's all I can recollect about the project for now, will edit this file if something comes up in my mind.
Here's the drive link to the video: https://drive.google.com/file/d/1uAVb9GIHaHHw-PFhbLSOok189CddQuoe/view?usp=sharing
Thank you for reading.
Warm Regards, Devarsh



