Terraform multirepo
Create a VPC with a repo. export attributes for resources using output. output “vpc_id” { value = module.vpc.vpc_id } –> it exports the vpc_id for a vpc module. Create a new resource to be created over the VPC in a different repo structure. Read the remote backend: data “terraform_remote_state” “vpc” { backend = “s3” config = { bucket = “awsterraform-state” key = “env:/${terraform.workspace}/IaC/bastion-state.tfstateate.tfstate“ region = “us-east-1” encrypt = true } } Important here: when using workspace, the attribute key in…