provider "aws" {
  region = var.aws_region
}

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

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

  repository_name    = "monday-com-orca-frontend"
  description        = "Monday.com ORCA project repository (frontend)."
  application_family = "integrations"
  default_code_owner = "business-solutions"

  archived_repository = true

  github_code_owner_reviews = false

  allow_squash_merge     = true
  delete_branch_on_merge = false

  github_triage_teams = [
    "orcharddevs-ro",
  ]

  github_push_teams = [
    "youtube-audit-team",
    "mergers",
  ]
}

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

  repository_name    = "monday-com-orca-backend"
  description        = "Monday.com ORCA project repository (backend)."
  application_family = "integrations"
  default_code_owner = "business-solutions"

  archived_repository = true

  github_code_owner_reviews = false

  allow_squash_merge     = true
  delete_branch_on_merge = false

  github_triage_teams = [
    "orcharddevs-ro",
  ]

  github_push_teams = [
    "youtube-audit-team",
    "mergers",
  ]
}
