DEV Community

Discussion on: Terraform Best Practices

Collapse
 
cryptic022 profile image
Pankaj Kumar

Sorry for the late reply. How are you managing the remote state in this case? We manage each environment on different AWS accounts. As per my knowledge, we can't use different remote s3 bucket for each terraform workspace.

Collapse
 
padakipavan profile image
padaki-pavan

Afaik, switching terraform workspaces creates completely independent state files. I usually commit them to a private git repo. Probably not the best solution, but it works for me.

Thread Thread
 
padakipavan profile image
padaki-pavan

Alternatively have a look at terragrunt, it solves the exact same problem you described.

Thread Thread
 
cryptic022 profile image
Pankaj Kumar

I have just started using terragrunt. It solves the exact problem.

Thread Thread
 
aronjohnson profile image
Aron Johnson

Thanks for the tip about Terragrunt. Looks super handy.