This task is about launching an application on AWS using services like EC2, EBS, S3 and Cloudfront with the help of terraform.

Task Description:-

Terraform Code:-

2. Create the key pair.

3. Create the Security Group which allow the port 80.

4. Launch EC2 instance by using the key and security key created.

5. EBS volume with size 1GB.

6. After creating the EBS volume now we need to mount it with the instance and then download the code from the github into the folder /var/www/html

7. Now I have created a S3 bucket and with permission to public and their i have downloaded the image from github.

8. Created a Cloudfront using s3 bucket and then I use the Cloudfront URL to update in code in /var/www/html

9. Here I had printed the IP of the instance and also launched the application using chrome after the whole setup is ready.

Now I just need to run the terraform command to run the code.

terraform apply -auto-approve

Here is the final output of my code.

Here is my website launched on aws using terraform.

Here is the github link of my code.

Thank you!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aditya Raj

I'm passionate learner diving into the concepts of computing 💻