CREATING INFRASTRUCTURE USING TERRAFORM
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 (HCL), or optionally JSON.
- NOW WE WILL SEE ABOUT BASIC STEPS BEFORE PERFORMING THE TASK:-
- FIRST WE NEED TO INSTALL THE TERRAFORM AND DECRYPT THE FILE.
- THEN WE NEED TO SETUP THE PATH FOR IT.
3. WE NEED TO HAVE THREE COMMANDS WHICH WILL BE IMPORTANT:-
A) TERRAFORM INIT
B)TERRAFORM APPLY
C)TERRAFORM DESTROY
QUES) CREATING OR LAUNCHING INFRASTRUCTURE USING TERRAFORM:-
STEPS TO BE FOLLOWED WHILE PERFORMING THE TASK:-
1. Create the key and security group which allow the port 80.
2. Launch EC2 instance.
3. In this Ec2 instance use the key and security group which we have created in step 1.
4. Launch one Volume (EBS) and mount that volume into /var/www/html
5. Developer have uploded the code into github repo also the repo has some images.
6. Copy the github repo code into /var/www/html
7. Create 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.
#PERFORMING THE TASK:-
BEFORE IT WE HAVE TO LOGIN USING THE PROVIDER BY GIVING REGION ID AND PROFILE NAME.
STEP-1 Create a key and security group with port number 80:
KEY: IT IS LIKE A PASSWORD FOR AUTOMATIC LOGIN IN TO THE CONSOLE.
STEP-2 AND 3:-LAUNCH EC2 INSTANCE AND LOGGING USING SECURITY GROUP AND KEY:-
STEP-4:-LAUNCHING THE VOLUME:-
STEP-4:- ATTACHING THE VOLUME:-
STEP-5 AND 6:CREATING THE S3 BUCKET AND STORING OBJECTS IN IT:-
STEP-7:CREATING CLOUD DISTRIBUTIONS:-
STEP-8:STORING THE FILE AND GIVIVNG OUTPUT COMMANDS:-
NOW LOOKING AT THE OUTPUT:-
Keep up the good work 👍👍