How to Automate Infrastructure setup using Terraform & Jenkins | Terraform Remote State Store in S3

preview_player
Показать описание

We will be learning how to provision resources in AWS cloud using Terraform and Jenkins. We will also learn how to store terraform state info remotely in AWS S3 bucket.

We will create S3 bucket for storing terraform state info and DynamoDB table for locking capability.

We will try to create an EC2 instance and S3 Bucket using Terraform and Jenkins in AWS cloud. Look at the diagram that describes the whole flow.

Pre-requistes:
Create S3 bucket for storing TF state
Create dynamo DB table for providing lock capability
Jenkins is up and running
Terraform is installed in Jenkins
Terraform files already created in your SCM
Make sure you have necessary IAM role created with right policy and attached to Jenkins EC2 instance.

Step 1 - Create S3 bucket and DynamoDB table in AWS

Step 2 - Create IAM role with three policies mentioned and attach to Jenkins EC2

Step 3 - Create Jenkins pipeline with parameters

Step 4- Execute pipeline
Рекомендации по теме
Комментарии
Автор

Hii, i am getting error in Plan stage, (Error acquiring the state lock), Solutions for this?, Wts wrong?

tippeshtg
Автор

Hi, Can you please list down some common error we face while working with Terraform and Jenkins in real time.

sreekanthreddyb
Автор

Great video sir. What is the use of dynamoDB here? If you could briefly explain?

ibmuser
Автор

is it neccessary to have linux installed in our system to run this? because in my windows built in node, the sh is not recognising terraform init command

raghunandanp
Автор

Where did you do the authentication for AWS and Jenkins as in access and secret keys?

roopamgaikar
Автор

while checking out, I am getting error. Failed to connect to repository : Error performing git command: git ls-remote -h . Any resolution on this? my inbound and outbound traffic is set to everywhere while trying to resolve it.

SS
Автор

kindly use mic . very very less audible

MrNNAVNEET