2016-03-08 23:05:22 +01:00
|
|
|
---
|
|
|
|
layout: "github"
|
2016-04-07 16:26:01 +02:00
|
|
|
page_title: "GitHub: github_team_membership"
|
2016-03-08 23:05:22 +01:00
|
|
|
sidebar_current: "docs-github-resource-team-membership"
|
|
|
|
description: |-
|
2016-04-07 16:26:01 +02:00
|
|
|
Provides a GitHub team membership resource.
|
2016-03-08 23:05:22 +01:00
|
|
|
---
|
|
|
|
|
2017-04-10 18:25:29 +02:00
|
|
|
# github_team_membership
|
2016-03-08 23:05:22 +01:00
|
|
|
|
2016-04-07 16:26:01 +02:00
|
|
|
Provides a GitHub team membership resource.
|
2016-03-08 23:05:22 +01:00
|
|
|
|
|
|
|
This resource allows you to add/remove users from teams in your organization. When applied,
|
2017-02-18 23:48:50 +01:00
|
|
|
the user will be added to the team. If the user hasn't accepted their invitation to the
|
2016-03-08 23:05:22 +01:00
|
|
|
organization, they won't be part of the team until they do. When
|
|
|
|
destroyed, the user will be removed from the team.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-10 18:25:29 +02:00
|
|
|
```hcl
|
2016-03-08 23:05:22 +01:00
|
|
|
# Add a user to the organization
|
|
|
|
resource "github_membership" "membership_for_some_user" {
|
2017-02-18 23:48:50 +01:00
|
|
|
username = "SomeUser"
|
|
|
|
role = "member"
|
2016-03-08 23:05:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "github_team" "some_team" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "SomeTeam"
|
|
|
|
description = "Some cool team"
|
2016-03-08 23:05:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "github_team_membership" "some_team_membership" {
|
2017-02-18 23:48:50 +01:00
|
|
|
team_id = "${github_team.some_team.id}"
|
|
|
|
username = "SomeUser"
|
|
|
|
role = "member"
|
2016-03-08 23:05:22 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2016-04-07 16:26:01 +02:00
|
|
|
* `team_id` - (Required) The GitHub team id
|
2016-03-08 23:05:22 +01:00
|
|
|
* `username` - (Required) The user to add to the team.
|
2017-02-18 23:48:50 +01:00
|
|
|
* `role` - (Optional) The role of the user within the team.
|
2016-03-08 23:05:22 +01:00
|
|
|
Must be one of `member` or `maintainer`. Defaults to `member`.
|