provider "aws" {
  region = var.aws_region
}

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

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

  github_push_teams = [
    "data-analytics-eng",
    "mergers",
  ]

  github_repository_names = {
    (var.service_name) = {
      branch_protection_enabled        = true
      branch_protection_enforce_admins = false
      repo_auto_init                   = true
      archived_repository              = false
      github_code_owner_reviews        = false
      visibility                       = "private"
      description                      = var.service_name
      homepage_url                     = "https://github.com/theorchard/${var.service_name}"
      has_downloads                    = false
    }
  }
}
