Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Managing GitHub with Terraform

Managing GitHub with Terraform

In this talk, I look at how HashiCorp Terraform 0.10 can be used to manage GitHub Organizations, Teams, and Repositories.

This version of the presentation was given at Royal Schiphol Group in February 2018.

Kerim Satirli

February 20, 2018
Tweet

More Decks by Kerim Satirli

Other Decks in Technology

Transcript

  1. • built to codify infrastructure resources • wide support for

    different providers • flow based on HashiCorp Configura<on Language
  2. • terraform init • terraform get • terraform plan •

    terraform apply • terraform destroy • terraform graph
  3. # github_repositories.tf module "infra" { source = "github.com/my-organization/terraform-github-repository-my-organization" name =

    "infra" description = "Infrastructure" req_status_checks_context = ["continuous-integration/travis-ci"] auto_init = false gitignore_template = "" team_repository_team = "${github_team.operations.id}" enable_branch_protection = 0 req_pr_reviews_dismissal_teams = ["${github_team.operations.id}"] restrictions_teams = ["${github_team.operations.id}"] }
  4. # github_repositories.tf module "infra" { source = "github.com/my-organization/terraform-github-repository-my-organization" name =

    "infra" description = "Infrastructure" req_status_checks_context = ["continuous-integration/travis-ci"] auto_init = false gitignore_template = "" team_repository_team = "${github_team.operations.id}" enable_branch_protection = 1 req_pr_reviews_dismissal_teams = ["${github_team.operations.id}"] restrictions_teams = ["${github_team.operations.id}"] }
  5. # github_repositories.tf module "infra" { source = "github.com/my-organization/terraform-github-repository-my-organization" name =

    "infra" description = "Infrastructure" req_status_checks_context = ["continuous-integration/travis-ci"] auto_init = false gitignore_template = "" team_repository_team = "${github_team.operations.id}" enable_branch_protection = 1 req_pr_reviews_dismissal_teams = ["${github_team.operations.id}"] restrictions_teams = ["${github_team.operations.id}"] }
  6. # github_repositories.tf module "infra" { source = "github.com/my-organization/terraform-github-repository-my-organization" name =

    "infra" description = "Infrastructure" req_status_checks_context = ["continuous-integration/travis-ci"] auto_init = false gitignore_template = "" team_repository_team = "${github_team.operations.id}" enable_branch_protection = 1 req_pr_reviews_dismissal_teams = ["${github_team.operations.id}"] restrictions_teams = ["${github_team.operations.id}"] }
  7. Fin