**** Hybrid-Multi-Cloud-Task 2****

Arpit Sironiya
4 min readSep 2, 2020

Task Description:-

Perform the task-1 using EFS instead of EBS service on the AWS as

Task 1 Link:- https://medium.com/@faristaap02/hybrid-multi-cloud-task-1-769711d43c50

Create/launch Application using Terraform

1. Create a Security group that allows the port 80.

2. Launch EC2 instance.

3. In this Ec2 instance use the existing key or provided key and security group which we have created in step 1.

4. Launch one Volume using the EFS service and attach it in your vpc, then mount that volume into /var/www/html

5. The developer have uploaded the code into the GitHub repo also the repo has some images.

6. Copy the GitHub repo code into /var/www/html

7. Create an S3 bucket, and copy/deploy the images from GitHub repo into the s3 bucket and change the permission to public readable.

8 Create a Cloudfront using s3 bucket(which contains images) and use the Cloudfront URL to update in code in /var/www/html

This is “task2” folder in which I have instance.tf file as shown below:-

This is “instance.tf” file code as shown below:-

First, we run “terraform init & terraform validate ” command as shown below:-

Then we also run “ terraform plan ” command as shown below:-

Now, We run “ terraform apply — -auto-approve

Now, at last, we get the output of instance, public IP as also shown below:-

So, “arpit_sg” Security Group is created successfully as shown below:-

The “arpitOs1” instance is also created:-

EFS “arpitefs” also created as shown below:-

Terraform code also created s3 which is used to store images as shown below:-

Terraform code also create CloudFront Distribution as also shown below:-

So Finally, this is the output as shown below:-

One command “ terraform destroy — -auto-approve ” and all Infrastructure delete:-

********************THANKS********************

--

--

Arpit Sironiya

Ansible / Flutter / Hybrid Multi-Cloud / GCP / EKS / Kubernetes / DevOps / MlOps / Docker Expertise / RHCSA / Advance JAVA / Python Learner / Arth Learner