Hello -
I am hoping someone can help me understand how to configure backends and
make them available across a multi-account setup using terragrunt.
My understanding of using the S3 state buckets is that a bucket is
created in each account e.g. staging = test-staging-tfstate ,
shared-services = test-shared-services-tfstate. Is this correct?
If the there is a state bucket for each account, how do you handle
authentication cross-account for data lookups?
Specifically, I need the ability to use a data lookup for remote state from
(shared-services) while in the (stage) account. This is for grabbing data for a
peering connection.
From the vpc-app wrapper in staging
data "terraform_remote_state" "mgmt_vpc" {
backend = "s3"
config = {
region = var.terraform_state_aws_region
bucket = var.terraform_state_s3_bucket
key = "${var.aws_region}/mgmt/vpc/terraform.tfstate"
}
}