Day 60 - Terraform🔥

Day 60 - Terraform🔥

Task 1: Answer below questions

  • Why we use terraform?

Terraform is a tool used for infrastructure automation and management. It allows users to define infrastructure as code, making it easy to provision and manage cloud resources across multiple providers. Terraform provides a simple and efficient way to create and manage infrastructure in a scalable and reproducible manner.

  • What is Infrastructure as Code (IaC)?

Infrastructure as Code (IaC) is an approach to infrastructure automation and management that involves defining infrastructure as code. This means that infrastructure is defined using code, rather than manual processes or graphical interfaces. IaC allows for automation of infrastructure provisioning, configuration, and management, resulting in faster and more efficient infrastructure management.

  • What is Resource?

In Terraform, a resource refers to any cloud infrastructure component that can be managed as code. Resources can include anything from virtual machines, storage accounts, network interfaces, and more.

  • What is Provider?

A provider in Terraform is a plugin that allows Terraform to interact with a specific cloud provider, such as Amazon Web Services, Google Cloud Platform, or Microsoft Azure. The provider defines the set of resources that can be created, modified, and deleted using Terraform.

  • Whats is State file in terraform? What’s the importance of it ?

The state file in Terraform is a JSON file that stores the current state of the infrastructure being managed by Terraform. The state file is important because it keeps track of the resources that have been created, their current configuration, and their dependencies. Terraform uses the state file to determine what changes need to be made to the infrastructure to reach the desired state.

  • What is Desired and Current State?

Desired state refers to the configuration of infrastructure that a user wants to achieve. This configuration is defined using Terraform code. Current state, on the other hand, refers to the current configuration of the infrastructure being managed by Terraform. Terraform uses the desired state and the current state to determine what changes need to be made to the infrastructure to reach the desired state.

Thanks for reading the blog. Hope it helps!

Task 2:

Install Terraform on your system.

Launch en EC2 instance

No alt text provided for this image

SSH into your Ubuntu EC2 instance

No alt text provided for this image

Visit the Terraform website's official download page at https://www.terraform.io/downloads.html to download the right package for your system.

Choose Ubuntu as the package management and Linux as the operating system.

the three commands listed below into the instance terminal.

No alt text provided for this image

No alt text provided for this image

Run the following command to confirm that Terraform is set up properly:

No alt text provided for this image