Posted on 1 April 2020, updated on 6 August 2021.
When using Terraform with other people it’s often useful to store your state in a bucket. For example, an S3 bucket if you deploy on AWS. And then you may want to use the same bucket for different AWS accounts for consistency purposes. Or you may also want your S3 bucket to be stored in a different AWS account for right management reasons.
But how to use a Terraform state stored in one AWS account and deploy in another one? That’s what you’ll discover now.