State changes when using multiple AWS regions in modules

Hi,

I’m currently using Terraform with Terraform Cloud as remote state and currently using 1 module which gets deployed in 2 AWS regions.

provider "aws" {
  alias  = "eu-west-1"
  region = "eu-west-1"
}

provider "aws" {
  alias  = "us-east-1"
  region = "us-east-1"
}


module "eu-west-1" {
  source          = "./modules/api-stack"
  dns_suffix      = "xxxxxxxx"
  certificate_arn = "arn:aws:acm:eu-west-1:xxxxxxxx"

  providers = {
    aws = aws.eu-west-1
  }
}

module "us-east-1" {
  source          = "./modules/api-stack"
  dns_suffix      = "xxxxxxxx"
  certificate_arn = "arn:aws:acm:us-east-1:xxxxxxxxx"

  providers = {
    aws = aws.us-east-1
  }
}

I’m also using 2 workspaces, 1 for ‘dev’ and one for ‘prod’. This actually works as expected but when I have a look at the changes in the state file it seems like something is not 100% the way it should be. The region in the state file gets switched but not every time.

I’m not exactly sure what or why this happens so I thought I posted it here…
Thanks.

Vincent