Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.1.5. Third-Party IaC: Terraform and Git Integration

šŸ’” First Principle: AWS-native tools (CloudFormation, CDK) are optimized for AWS but don't help you when half your infrastructure is on Azure or GCP. Terraform is the IaC tool of choice for multi-cloud organizations because it uses the same workflow and language (HCL) regardless of which cloud provider you're provisioning. The SOA-C03 exam recognizes that CloudOps engineers increasingly operate in Terraform environments.

Terraform Core Concepts:
ConceptDescription
ProviderPlugin that knows how to talk to an API (e.g., hashicorp/aws)
ResourceAn infrastructure object to be managed (e.g., aws_instance)
ModuleReusable group of resources with inputs and outputs
State fileterraform.tfstate — tracks what Terraform has provisioned
PlanPreview of changes (terraform plan)
ApplyExecute the plan (terraform apply)
Terraform Workflow:
CommandEffect
terraform initDownload providers, initialize backend
terraform planPreview changes (what will be created/modified/destroyed)
terraform applyExecute the changes
terraform destroyDestroy all managed resources
terraform stateInspect and manipulate state

State Management: Terraform tracks provisioned resources in a state file. In team environments, state must be stored remotely and locked to prevent concurrent modifications. For AWS environments, the standard backend is:

  • S3 for state storage (versioned bucket for history)
  • DynamoDB for state locking (prevents simultaneous applies)

Git Integration: Infrastructure as code in Terraform should be version-controlled in Git, following GitOps practices:

  • Infrastructure changes proposed as pull requests
  • Automated terraform plan runs on PRs to show change preview
  • Merges to main trigger terraform apply
  • State is always the source of truth for what's actually deployed

Infrastructure Drift: When someone makes a manual change in the AWS console that Terraform doesn't know about, the state file no longer matches reality. terraform plan will show this as a change (Terraform wants to revert the manual change). The fix is either: update the Terraform code to match the manual change, or let Terraform revert it.

āš ļø Exam Trap: The SOA-C03 exam is unlikely to ask deep Terraform syntax questions — that's beyond scope. It will test conceptual understanding: Terraform uses state files, state should be in S3+DynamoDB for teams, terraform plan is non-destructive, and Terraform can manage AWS resources alongside CloudFormation stacks (they don't conflict as long as they don't manage the same resources).

Reflection Question: A team uses Terraform to manage their AWS VPC and EC2 instances. A network engineer manually added an inbound rule to a security group via the console. What happens the next time terraform plan is run, and what are the two ways to resolve the state drift?

Alvin Varughese
Written byAlvin Varughese
Founder•15 professional certifications