data "terraform_remote_state" "mop_core" {
  backend = "s3"
  workspace = terraform.workspace
  config = {
    bucket = "nf-mop-tf-state"
    key = "core/terraform.tfstate"
    region = "us-east-1"
    encrypt = true
  }
}

data "terraform_remote_state" "central_mq" {
  backend = "s3"
  workspace = terraform.workspace
  config = {
    bucket = "nf-mop-tf-state"
    key = "central-mq/terraform.tfstate"
    region = "us-east-1"
    encrypt = true
  }
}

# caller info
data "aws_caller_identity" "current" {}

variable failover_workspaces {

  default = {
    nf-sandbox          = "nf-sandbox-dr"
    nf-staging-int      = "nf-staging-dr"
    nf-prod-int         = "nf-production-dr"
  }

}

data "terraform_remote_state" "mop_core_failover" {

  backend = "s3"
  workspace = var.failover_workspaces[terraform.workspace]

  config = {
    bucket = "nf-mop-tf-state"
    key = "core-failover/terraform.tfstate"
    region = "us-east-1"
    encrypt = true
  }
}
