Deploying dynamic infrastructure with Terraform
Terraform is an infrastructure as code (IaC) tool that enables the ability to define, provision, and manage infrastructure in a declarative manner. Before getting hands-on, it’s important to understand a few key concepts:
- Configuration plan: A set of files that define the desired state of the infrastructure using a domain-specific language (DSL)—in this case, HashiCorp Configuration Language (HCL).
- Providers: Packages that allow Terraform to interact with external systems via APIs. For example, the AWS provider enables Terraform to manage resources in the AWS cloud. Similar to Ansible collections.
- Resources: Individual infrastructure components, such as virtual machines (VMs), databases, or networks, that Terraform provisions based on the configuration plan. It is similar to Ansible modules.
- Data sources: Existing infrastructure components outside Terraform’s control that provide useful...