provider "aws" {
  region = var.aws_region
}

provider "github" {
  owner = "theorchard"
  app_auth {}
}

# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "orcd-terraform-state"
    key     = "prod/github/abacus-monorepo/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "github_repositories" {
  source = "git@github.com:theorchard/terraform-github.git//?ref=6.1.7"

  repository_name                  = "abacus-monorepo"
  branch_protection_enabled        = true
  branch_protection_enforce_admins = true
  github_code_owner_reviews        = true
  description                      = "Consolidated monorepo for the Abacus royalty accounting platform"
  default_code_owner               = "abacus"
  application_family               = var.application_family
  github_pull_teams                = ["orcharddevs-ro"]
  github_push_teams                = ["mergers"]
  github_triage_teams              = []
  has_downloads                    = false
}
