# Execution Configuration ======================================================

# Terraform Version, Provider & Backend Configuration --------------------------
# Minimum version constraints for Terraform and the AWS provider.
# Upper bounds prevent silent breakage on major version bumps.

# Note: Declare the backend block here for s3, else Terraform will use the
# default backend (local) and fail to initialize in CI.

terraform {
  required_version = ">= 1.15.0, < 2.0.0"
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = ">= 6.0, < 7.0"
    }
  }
  backend "s3" {}
}

# Provider Configuration -------------------------------------------------------
# Declare the AWS provider for the target region using role assumption in the
# target aws account.

provider "aws" {
  region = "us-west-2"

  default_tags {
    tags = {
      managed-by = "terraform"
    }
  }

  assume_role {
    role_arn = "arn:aws:iam::907857453177:role/hca-iac-execution-role"
  }
}
