Skip to content

RaftechNL/terraform-github-team

 
 

Repository files navigation

Build Status GitHub tag (latest SemVer) Terraform Version Github Provider Version Join Slack

terraform-github-team

A Terraform module that offers a more convenient and tested way to provision and manage GitHub teams.

This module supports Terraform v1.x and is compatible with the Official Terraform GitHub Provider v4.x from integrations/github.

Attention: This module is incompatible with the Hashicorp GitHub Provider! The latest version of this module supporting hashicorp/github provider is ~> 0.6.0

Module Features

This module supports the following resources:

  • Team
  • Nested Team
  • Memberships
  • Team Repositories

Getting Started

module "team" {
  source  = "mineiros-io/team/github"
  version = "~> 0.8.0"

  name        = "DevOps"
  description = "The DevOps Team"
  privacy     = "secret"

  members = [
    "a-user",
    "b-user"
  ]

  maintainers = [
    "a-maintainer"
  ]

  push_repositories = [
    github_repository.repository.name,
  ]
}

resource "github_repository" "repository" {
  name   = "a-repository"
}

provider "github" {}

terraform {
  required_version = "~> 1.0"

  required_providers {
    github = {
      source  = "integrations/github"
      version = "~> 4.0"
    }
  }
}

Module Argument Reference

See variables.tf and examples/ for details and use-cases.

Main Resource Configuration

  • name: (Required string)

    The name of the team.

  • description: (Optional string)

    A description of the team.

    Default is "".

  • privacy: (Optional string)

    The level of privacy for the team. Must be one of secret or closed.

    Default is "secret".

  • parent_team_id: (Optional number)

    The ID of the parent team, if this is a nested team.

    Default is to create a root team without a parent.

  • ldap_dn: (Optional string)

    The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise.

  • create_default_maintainer: (Optional bool)

    Adds the creating user to the team when set to true."

    Default is false.

Extended Resource Configuration

Team membership

  • maintainers: (Optional set(string))

    A list of users that will be added to the current team with maintainer permissions.

    Default is [].

  • members: (Optional set(string))

    A list of users that will be added to the current team with member permissions.

    Default is [].

Team repository access

Module Configuration

  • module_depends_on: (Optional list(object))

    A list of dependencies. Any object can be assigned to this list to define a hidden external dependency.

    Default is [].

  • module_enabled: (Optional bool)

    Specifies whether resources in the module will be created.

    Default is true.

  • module_use_members: (Optional bool)

    Wether to use github_team_members or github_team_membership.

    Default is false.

Module Outputs

The following attributes are exported in the outputs of the module:

  • id: (string)

    The ID of the team.

  • name: (string)

    The name of the team.

  • slug: (string)

    The Slug of the team.

  • team: (object(team))

    The full team object.

  • team_members: (list(team_members))

    A list of all team members (when using github_team_members).

  • team_memberships: (list(team_membership))

    A list of all team memberships (when using github_team_membership).

  • team_repositories: (list(team_repository))

    A list of all team repositories.

External Documentation

GitHub Provider Documentation

Module Versioning

This Module follows the principles of Semantic Versioning (SemVer).

Given a version number MAJOR.MINOR.PATCH, we increment the:

  1. MAJOR version when we make incompatible changes,
  2. MINOR version when we add functionality in a backwards compatible manner, and
  3. PATCH version when we make backwards compatible bug fixes.

Backwards compatibility in 0.0.z and 0.y.z version

  • Backwards compatibility in versions 0.0.z is not guaranteed when z is increased. (Initial development)
  • Backwards compatibility in versions 0.y.z is not guaranteed when y is increased. (Pre-release)

About Mineiros

Mineiros is a remote-first company headquartered in Berlin, Germany that solves development, automation and security challenges in cloud infrastructure.

Our vision is to massively reduce time and overhead for teams to manage and deploy production-grade and secure cloud infrastructure.

We offer commercial support for all of our modules and encourage you to reach out if you have any questions or need help. Feel free to email us at hello@mineiros.io or join our Community Slack channel.

GitHub as Code

GitHub as Code is a commercial solution built on top of our open-source Terraform modules for GitHub. It helps our customers to manage their GitHub organization more efficiently by enabling anyone in their organization to self-service manage on- and offboarding of users, repositories, and settings such as branch protections, secrets, and more through code.

For details please see https://www.mineiros.io/github-as-code.

Reporting Issues

We use GitHub Issues to track community reported issues and missing features.

Contributing

Contributions are always encouraged and welcome! For the process of accepting changes, we use Pull Requests. If you'd like more information, please see our Contribution Guidelines.

Makefile Targets

This repository comes with a handy Makefile. Run make help to see details on each available target.

License

license

This module is licensed under the Apache License Version 2.0, January 2004. Please see LICENSE for full details.

Copyright © 2020-2022 Mineiros GmbH

About

A Terraform module to manage GitHub Teams.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 61.7%
  • Makefile 31.1%
  • Go 7.2%