AWS automation using Terraform and Jenkins

AWS automation using Terraform and Jenkins







First lets know about the basic terminologies used in this project .


What is Cloud Computing?

Cloud computing is a term referred to storing and accessing data over the internet. It doesn't store any data on the hard disk of your personal computer. In cloud computing, you can access data from a remote server.

No alt text provided for this image


What is AWS?

Amazon web service is a platform that offers flexible, reliable, scalable, easy-to-use and cost-effective cloud computing solutions.

AWS is a comprehensive, easy to use computing platform offered Amazon. The platform is developed with a combination of infrastructure as a service (IaaS), platform as a service (PaaS) and packaged software as a service (SaaS) offerings.

No alt text provided for this image


Important AWS Services

Amazon Web Services offers a wide range of different business purpose global cloud-based products. The products include storage, databases, analytics, networking, mobile, development tools, enterprise applications, with a pay-as-you-go pricing model.

No alt text provided for this image


What is Terraform?

Terraform is an open-source infrastructure as a 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).


No alt text provided for this image



Task : Have to create/launch Application using Terraform

  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 to update in code in /var/www/html

Solution:

We will do all the process step by step. So let's start.

No alt text provided for this image


Step1:

Creating two folders which contains two terraform file each having their own used cases

No alt text provided for this image

Seeing the content of the two folders.

No alt text provided for this image
No alt text provided for this image

Step2:

Configuring AWS terraform profile :

You can create your profile using aws configure. [ $ aws configure –profile profile_name ]

No alt text provided for this image


Step3:

Creating S3 Bucket  :

No alt text provided for this image
No alt text provided for this image


Now for uploading the image to s3 bucket we have to clone it from the Github into our local system and then we have to give it's path . So for this we have use Jenkins.

No alt text provided for this image
No alt text provided for this image


Step4:

Downloading object/image in S3 bucket

No alt text provided for this image
No alt text provided for this image


Step5:

Creating Cloudfront :

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


Step6:

Now once we get the url of the image in s3 bucket we manually go to our web page file and provide it in the image source column


Step7:

Now we switch to our next terraform file which we will use for instance creation. Configuring AWS terraform profile once again to create instances :

No alt text provided for this image


Step8:

Creating Key :

No alt text provided for this image
No alt text provided for this image


Step9:

Creating Security Group :

No alt text provided for this image

This security group will allow port 80 and 22.

No alt text provided for this image
No alt text provided for this image


Step10:

Creating AWS Instance :

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

This will connect via ssh and install the following softwares in it.

No alt text provided for this image


Step11:

Creating EBS Volume :

No alt text provided for this image

This volume will act as a persistent storage


Step12:

Attaching,Creating partition, formatting and mounting EBS Volume to Instance :

No alt text provided for this image
No alt text provided for this image


Final Output:

No alt text provided for this image


This is all from my side. Hope you like my work. Any suugestions or improvements related to this task is always appreciated.

Link to my Github profile :

https://github.com/stushar12/cloud_task1


No alt text provided for this image


Ajinkya Khandave

Associate @JP Morgan Chase and Co. | CIB Technology

4 年

Inspiring

GAURAV MALIK

SDE @Freecharge (A subsidiary of Axis Bank) | Ex- TCS | FinTech

4 年

Great work bro.

要查看或添加评论,请登录

Tushar Saxena的更多文章

  • Dynamic Jenkins

    Dynamic Jenkins

    This article is a simple integration of GitHub, Jenkins, Kubernetes and Docker to automate the process of deploying a…

    2 条评论
  • Configuring CI/CD on Kubernetes with Jenkins and Groovy

    Configuring CI/CD on Kubernetes with Jenkins and Groovy

    This article is a simple integration of GitHub, Jenkins, Kubernetes and Docker to automate the process of deploying a…

    1 条评论
  • DevOps Assembly Line Task 3

    DevOps Assembly Line Task 3

    This article is a simple integration of GitHub, Jenkins, Kubernetes and Docker to automate the process of deploying a…

    6 条评论
  • INTEGRATING PROMETHEUS AND GRAFANA WITH KUBERNETES

    INTEGRATING PROMETHEUS AND GRAFANA WITH KUBERNETES

    Task : Integrate Prometheus and Grafana and perform in following way: Deploy them as pods on top of Kubernetes by…

  • ML + DEVOPS = MLOPS

    ML + DEVOPS = MLOPS

    So before starting this article my one question to everyone is why 90% of machine learning models not deployed ? So…

    4 条评论
  • Face Recognition Model

    Face Recognition Model

    Training a model from scratch requires a very large dataset and takes a lot of time to train. The solution to this is…

  • Docker + Git + Github + Jenkins = Automated Project#2

    Docker + Git + Github + Jenkins = Automated Project#2

    This article is based on a integration of great DevOps tools like git , github , jenkins , docker. Integrating all the…

    6 条评论
  • DevOps Automation using Docker , Jenkins and Git/Github

    DevOps Automation using Docker , Jenkins and Git/Github

    This project uses DevOps tools for continuous development, continuous integration and continuous deployment.We have to…

    2 条评论

社区洞察

其他会员也浏览了