Over 10 years we help companies reach their financial and branding goals. Engitech is a values-driven technology agency dedicated.

Gallery

Contacts

411 University St, Seattle, USA

engitech@oceanthemes.net

+1 -800-456-478-23

IAC

What is Terraform?

Terraform, an open-source IaC tool by HashiCorp, uses declarative configuration files (HCL/JSON) to define and manage infrastructure. It automates resource provisioning, ensuring consistency across cloud providers. Its planning feature compares desired vs. current state, enabling efficient infrastructure deployment and management across various platforms. Terraform is its ability to work with various cloud providers (such as AWS, Azure, Google Cloud), as well as other services like Docker, Kubernetes, and more.

Benefits of using Terraform:

  • Infrastructure as Code
  • Multi-Cloud Support
  • State Management
  • Scalability and Efficiency
  • Version Control
  • Orchestration

Terraform Lifecycle

  • Initialization (terraform init): Initializes a working directory by downloading required providers and modules, setting up the environment for configuration.
  • Planning (terraform plan): Analyzes configurations, compares the desired state with the current state, and outlines the actions to be taken to achieve the desired state without actually applying changes.
  • Applying Changes (terraform apply): Executes the planned changes, creating, modifying, or deleting resources to align with the desired state described in the configuration files.
  • Destroying Infrastructure (terraform destroy): Removes all resources defined in the configuration, effectively tearing down the infrastructure provisioned using Terraform.

Terraform Core Concepts:

  • Declarative Configuration: Terraform uses declarative language (HCL/JSON) to describe the desired state of infrastructure rather than specifying step-by-step instructions. This approach focuses on what needs to be achieved, not how to achieve it.
  • Providers: These interface with various infrastructure platforms (AWS, Azure, GCP, etc.) to manage resources. Each provider offers resource types and manages their lifecycle—creating, updating, and deleting resources.
  • Resources: Represent infrastructure components like virtual machines, networks, databases, etc. Declared in Terraform configuration, these are managed by providers and can be created, modified, or deleted.
  • State Management: Terraform maintains a state file to track the current state of managed infrastructure. It helps in understanding what changes are needed and prevents unintended modifications by keeping track of resource attributes and dependencies.
  • Modules: Enable reusable configurations, allowing abstraction of infrastructure components. Modules encapsulate resources, making it easier to manage and share configurations across different projects.
  • Lifecycle Phases: Terraform follows an organized sequence of actions—init, plan, apply, and destroy—to manage infrastructure, ensuring a controlled and predictable deployment and modification process.

Author

elox