provider "aws" {
  region = var.aws_region
}

# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "orcd-terraform-state"
    key     = "prod/github/orchard-features/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_repository_names = {

    orchard-features = {
      branch_protection_enabled        = true
      branch_protection_enforce_admins = true
      repo_auto_init                   = false
      archived_repository              = false
      github_code_owner_reviews        = true
      visibility                       = "private"
      description                      = "orchard-features"
      has_downloads                    = false
      homepage_url                     = "https://github.com/theorchard/orchard-features"
    }
  }

  github_push_teams = [
    "mergers",
  ]
}

import {
  id = "orchard-features"
  to = module.github_repositories.github_repository.orchard_repository["orchard-features"]
}
