Skip to content

cbsi-dto/terraform-github-organization

 
 

Repository files navigation

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

terraform-github-organization

A Terraform module that acts as a wrapper around the Terraform GitHub provider and offers a more convenient and tested way to manage GitHub Organizations following best practices.

This module supports Terraform v0.14, v0.13 as well as v0.12.9 and above and is compatible with the Terraform Github Provider v3 as well as v2.4 and above.

Module Features

  • Standard Module Features: Organization Members, Organization Owners (Admins), Organization Projects, Blocked Users

  • Extended Module Features: Change organization member roles without removing and re-inviting users, Rename projects without recreating (when providing unique ids), No need to import members/admins on first run, Create an all member team that contains every member of your organization

Getting Started

To quickly start managing your GitHub Organization with Terraform:

module "organization" {
  source  = "mineiros-io/organization/github"
  version = "~> 0.3.0"

  create_all_members_team = true

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

  admins = [
    "a-admin",
  ]

  blocked_users = [
    "blocked-user",
    "another-blocked-user",
  ]

  projects = [
    {
      id   = "project-a"
      name = "A Great Project"
      body = "This is a project created by Terraform"
    }
  ]
}

Module Argument Reference

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

Top-level Arguments

  • blocked_users: (Optional set(string))

    A list of usernames to be blocked from a GitHub organization. Default is [].

  • members: (Optional set(string))

    A list of users to be added to your organization with member role. When applied, an invitation will be sent to the user to become part of the organization. When destroyed, either the invitation will be cancelled or the user will be removed. Default is [].

  • admins: (Optional set(string))

    A list of users to be added to your organization with admin role. When applied, an invitation will be sent to the user to become part of the organization. When destroyed, either the invitation will be cancelled or the user will be removed. Default is [].

  • projects: (Optional list(project)) Create and manage projects for the GitHub organization. Default is [].

  • all_members_team_name: (Optional string)

    The name of the team that contains all members of the organization. Default is null.

  • all_members_team_visibility: (Optional string)

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

Module Attributes Reference

The following attributes are exported by the module:

  • module_enabled

    Whether this module is enabled.

  • blocked_users

    A list of github_organization_block resource objects that describe all users that are blocked by the organization.

  • memberships

    A list of github_membership resource objects that describe all members of the organization.

  • projects

    A list of github_organization_project resource objects that describe all projects of the organization.

External 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 DevOps as a Service company based in Berlin, Germany. We offer commercial support for all of our projects and encourage you to reach out if you have any questions or need help. Feel free to send us an email at [email protected] or join our Community Slack channel.

We can also help you with:

  • Terraform modules for all types of infrastructure such as VPCs, Docker clusters, databases, logging and monitoring, CI, etc.
  • Consulting & training on AWS, Terraform and DevOps

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 Mineiros GmbH

About

A Terraform module to manage GitHub Organizations. https://github.com/

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HCL 68.0%
  • Makefile 20.1%
  • Go 11.9%