Managing Merge Conflicts for Environment-Specific Files in Terraform with Separate Branches

Hi all,
I’m using Terraform Cloud with separate branches for different environments (dev, staging, prod). Each branch contains an environment.auto.tfvars file and an smm_parameters.tf file with environment-specific variables and SSM parameter values.

The problem is that these files are large and cause merge conflicts when merging branches.

why not use the Terraform Cloud’s built-in features for storing variables at the workspace level. Instead of keeping large .tfvars files in the repository, you can actually define environment-specific variables in each Terraform Cloud workspace.