provider "aws" {
  region = var.aws_region
}

provider "github" {
  organization = var.github_organization
  app_auth {}
}

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

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

  repository_name                      = var.service_name
  description                          = var.service_name
  default_code_owner                   = "content-creation-management-ccm"
  application_family                   = var.application_family
  allow_rebase_merge                   = true
  github_code_owner_reviews            = true
  github_repository_push_collaborators = ["zyvpeople"]
  github_push_teams = [
    "content-creation-management-ccm",
    "graphql-maintainers",
    "mergers",
    "overloop-eng",
  ]
  require_branches_to_be_up_to_date = false
}
