Skip to content

Infrastructure as code: we configure GitHub via Terraform configuration files

Notifications You must be signed in to change notification settings

nl-design-system/terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform for NL Design System

Getting started

On macOS:

  1. Install Homebrew
  2. Install GitHub CLI: brew install gh
  3. Install Terraform:
  4. brew tap hashicorp/tap
  5. brew install hashicorp/tap/terraform

Importing an existing repo

 export TF_VAR_GITHUB_TOKEN=<GITHUB_TOKEN>
terraform import "github_repository.terraform-playground" "name-of-github-repository-resource"

Fine-grained personal access token

  • Repository:
    • Administration: read and write
    • Issues: read and write (voor labels)
    • Metadata: read only
    • Pages: read and write
  • Organization:
    • Administration: read only
    • Members: read and write

Terraform Cloud

You can login in to Terraform on app.terraform.io.

Start using cloud services

When you configure Terraform Cloud, you must configure use the user interface to configure the sensitive variables defined in variables.tf.

How to stop using cloud services

The following code is responsible for storing the Terraform state in the cloud:

  cloud {
    organization = "nl-design-system"

    workspaces {
      name = "github"
    }
  }

Removing this code should allow you to switch back to storing state in terraform.tfstate.

API Documentation

Contributing: new GitHub user to existing team

  1. Add the github_user to user.tf.
  2. Add the github_user as one of the members to the existing team in team-members.tf.

Contributing: new GitHub team for repo

  1. Create the github_team in team.tf.
  2. Create a subteam github_team in team.tf, with people who should be able to make pull requests. Follow the team name pattern: organization-committer or organization-repository-committer. Specify parent_team_id to extend the organization team.
  3. Create a subteam for maintainers the github_team in team.tf. Follow the team name pattern: organization-maintainer. Specify parent_team_id to extend the committer team.
  4. Add each user as github_user to user.tf.
  5. Add github_team_members for the new team in team-members.tf, and specify all users as members. Decide which users go into the committer team, and which users are in the maintainer team.
  6. Add the organization-maintainer team to the terraform github_repository in terraform.tf, so the maintainers are able to make and review Pull Requests.

About

Infrastructure as code: we configure GitHub via Terraform configuration files

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages