You are staring at two stacks that won’t talk to each other. One managed by AWS CloudFormation, the other living in Terraform. Both claim to be your infrastructure source of truth. Neither wants to take orders. Welcome to the DevOps cold war of IaC.
CloudFormation is AWS’s native templating engine. It defines and provisions resources inside your account using JSON or YAML. Terraform is the daredevil outsider, open source and cloud-agnostic. It writes the same infrastructure as code, but its power comes from providers and a single declarative workflow across any platform. Together, AWS CloudFormation Terraform alignment means one language for AWS semantics with the portability Terraform brings.
How it fits together
Think of CloudFormation as the official standard library and Terraform as the orchestrator that calls it. The Terraform AWS provider can create resources the same way CloudFormation would, or it can even use the CloudFormation stack resource type directly. You define infrastructure once, and Terraform drives CloudFormation to apply it inside AWS securely using IAM roles.
Most teams connect the dots through identity federation. They use OIDC or AWS SSO so Terraform’s runs inherit short-lived credentials from a trusted identity provider. That keeps humans out of the loop and satisfies compliance constraints like SOC 2 or ISO 27001 without endless key rotation.
Guardrails and good habits
Keep declarative ownership clear. Terraform should manage lifecycle, CloudFormation handles low-level drift detection. Always lock state remotely with versioning on. Use least-privilege IAM policies. Track stack outputs as Terraform data sources to avoid duplicating definitions. Those steps prevent the circular dependencies that usually appear at 2 a.m.