Please enable Javascript for better experience...
 
Create An Application using Terraform (through EFS)
By Keshav Khatore | Jul 19, 2020 | In Articles | Total Views [ 1663 ]
Taged In
(0 Like)
Rate

What is an EFS?

An Amazon S3 bucket is a public cloud storage resource available in Amazon Web Services’ (AWS). It stands for Simple Storage Service (S3), an object storage offering. Amazon S3 buckets, which are similar to file folders, store objects, which consist of data and its descriptive metadata.

What is Cloud Front?
Amazon CloudFront is a content delivery network offered by Amazon Web Services. Content delivery networks provide a globally-distributed network of proxy servers which cache content, such as web videos or other bulky media, more locally to consumers, thus improving access speed for downloading the content.

What is Terraform?
Terraform is an open-source infrastructure as code software tool created by HashiCorp. It enables users to define and provision a datacenter infrastructure using a high-level configuration language known as Hashicorp Configuration Language, or optionally JSON.

Some tasks List 

  • Create Security group which allow the port 80.
  • Launch EC2 instance.
  • In this EC2 instance use existing key or provided key and security group .
  • Launch one Volume using the EFS service and attach it in your vpc, then mount that volume into /var/www/html.
  • Developer have uploaded the code into github repo also the repo has some images.
  • Copy the github repo code into /var/www/html.
  • Create S3 bucket, and copy/deploy the images from github repo into the s3 bucket and change the permission to public readable.
  • Create a Cloudfront using s3 bucket(which contains images) and use the Cloudfront URL to update in code in /var/www/html.

STEP1: Login with CLI then use aws configure command and give the access key, secret key from credential file and region name.

STEP2: Create a directory and then create a file inside it with “.tf” extension.

Now we will write the code in the terraform file we created.
Step3: Give the name of the provider(AWS) to whom the Terraform will contact.

STEP 4: Create public and private key pair

STEP 5: Creating Security group with allowing Port 80 For http and Port 22 For ssh

STEP 6: Launch EC2 instances.

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

STEP 8: Create S3 bucket, and copy deploy the images from github repo into the s3 bucket and change the permission to public readable.

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

Now, use the following commands to initialize and run the code.
terraform init
terraform validate

So finally this webpage is created by terraform just by running a single command.


Thanks for visiting here. Share this article if you found it useful.
Like Facebook Page https://www.facebook.com/VMwareInsight/
Connect to twitter https://twitter.com/imPranayK
Subscribe my Channel https://www.youtube.com/vmwareinsight
Connect over Linkedin https://in.linkedin.com/in/impranayk
Share this on Social Media

About the Author

Keshav Khatore
Keshav Khatore
Member VMwareInsight.com

Public profile: user/profile/99905478


Follow me

facebook linkedin twitter G+ VMTN youtube

I am Keshav Khatore student of Lovely Professional University, Phagwara, Punjab, India, currently pursuing Masters In Computer Application.I am a Member of Redhat Linux, the biggest network on the planet and it's a glad thing for me to be a piece of such extraordinary and lofty community. I expert in Linux and have certification Red-hat Certified System Administration . For Contact- keshavmah27@gmail.com || LinkedIn- https://www.linkedin.com/in/keshav-khatore/

 
Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Comment
 
Sponsors
 
 
 
 
 
Facebook Likes