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/graphql-router/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "github_repositories" {
  source                     = "git@github.com:theorchard/terraform-github.git//?ref=6.1.3"
  repository_name            = "graphql-router"
  description                = "Apollo Router for our federate graphql graph"
  application_family         = var.application_family
  default_code_owner         = "orchard-suite-platform-osp"
  branch_protection_patterns = ["master"]
  github_code_owner_reviews  = false
  delete_branch_on_merge     = true

  # graphql-router builds take a long time because of cargo compiling packages
  # we need to reduce churn related to this configuration
  require_branches_to_be_up_to_date = false
}
