Hi all. I’ve bumped into a problem and I’m stumped.
I’m using Terraform to manage CodeBuild & CodePipelines in AWS. This also entails S3 buckets and ECR repos. I initially told the default provider what region I wanted it to deploy to. As time went on I added a second provider for similar infra in a different region, and use an alias to refer to it for those resources.
So far, so good. “terraform apply …” run just fine.
Now, I am trying to move the region that the default provider uses. Cool. I would expect that all I would have to do would be to just pass a different region to the default provider, terraform would see that I now want a different desired state, tear down everything in the initial default provider region and stand everything up in the newly desired default provider region. Pretty simple straight forward change, right?
Unfortunately, when I attempt to do this I get a wall of errors each saying:
Error retreiving Projects: “InvalidInputException: Invalid project ARN: region does not match caller’s region”
I’m stumped.
I can deploy all the config to my new region using the same code minus the stuff I don’t want to move if I use a new state file and everything works just fine? Unfortunately, because of how much I have in both regions, this is going to involve a lot of state stitching between the two regions.
Terraform version v0.14.5
AWS provider version v3.60.0
Any hints would be welcome.
Thanks in advance.