
variable "workspace_iam_roles" {
  type = map(string)
  default = {
    nf-sandbox         = "arn:aws:iam::721086286010:role/ops-mgmt-admin"
    nf-staging-int     = "arn:aws:iam::560269805515:role/ops-mgmt-admin"
    nf-prod-int        = "arn:aws:iam::745435643501:role/ops-mgmt-admin"
  }
}

provider "aws" {
  region = var.region[terraform.workspace]
  assume_role {
    role_arn = var.workspace_iam_roles[terraform.workspace]
  }
}


terraform {

  backend "s3" {
    bucket         = "nf-mop-tf-state"
    key            = "nfconsole_new/terraform.tfstate"
    region         = "us-east-1"
    encrypt        = true
    dynamodb_table = "nf-terraform-state-lock"
  }

  required_version = "~> 1.1"
  required_providers {
    aws = {
      source = "hashicorp/aws"
    }
  }
}

# Determine current region and account ID
data aws_caller_identity "current" {}
