Knowledge is knowledge

Terraform

 What is Terraform

  • It allows to automate and manage your infrastructure , platform, and services that run on that plateform.
  • Open source.
  • Declarative ( don't have to define every step ).
  • Tool for infrastructure provisioning.

There are two steps in deploying a project or infrastructure first is provisionoing infrastructure ( preparing server liek sequirity , installing docker etc ) and second is actually deploying the application.

Difference in Ansible and Terraform?

Both: Infrastructure as code

Both automate: provisioning, configuring and managing the infrastructure.

Terraform: Mainly infrastructure provisioning tool., relatively new, more advanced in orchestration.

Ansible: Mainly a configuration tool, more mature.

organizations uses both for there benefits dependin on use case.

Managing existing infrastructure: changes to existing infrastructure are done by Terraform. like addition of new server and security etc. it automate the continuos changes to your infrastructure.

we can also replicate existing infrastructure using terraform code used for creating infrastructure.

How does terraform work? How it connect to aws etc to do what we want.

Terraform Architecture

First

Core: compare config and current state and figure out what steps to do to achive certain state.

Take two inputs ( Tf-config file defined by user what to create, and current state of infrastructure ) .

Second

Providers 

AWS}Azure } [IaaS], Kubernetes | [PaaS]

Fastly | [SaaS]

Terraform commands for different stages

refresh: query infrastructure provider to get current state.

plan: create an execution plan.

apply: execute the plan.

destroy: destroy the resources/infrastructure.









Share:

No comments:

Post a Comment