TeamMembership

class TeamMembership : KotlinCustomResource

Provides a GitHub team membership resource. This resource allows you to add/remove users from teams in your organization. When applied, the user will be added to the team. If the user hasn't accepted their invitation to the organization, they won't be part of the team until they do. When destroyed, the user will be removed from the team.

Note This resource is not compatible with github.TeamMembers. Use either github.TeamMembers or github.TeamMembership. Note Organization owners may not be set as "members" of a team; they may only be set as "maintainers". Attempting to set organization an owner to "member" of a may result in a pulumi preview diff that changes their status back to "maintainer".

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Membership;
import com.pulumi.github.MembershipArgs;
import com.pulumi.github.Team;
import com.pulumi.github.TeamArgs;
import com.pulumi.github.TeamMembership;
import com.pulumi.github.TeamMembershipArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var membershipForSomeUser = new Membership("membershipForSomeUser", MembershipArgs.builder()
.username("SomeUser")
.role("member")
.build());
var someTeam = new Team("someTeam", TeamArgs.builder()
.description("Some cool team")
.build());
var someTeamMembership = new TeamMembership("someTeamMembership", TeamMembershipArgs.builder()
.teamId(someTeam.id())
.username("SomeUser")
.role("member")
.build());
}
}

Import

GitHub Team Membership can be imported using an ID made up of teamid:username or teamname:username, e.g.

$ pulumi import github:index/teamMembership:TeamMembership member 1234567:someuser
$ pulumi import github:index/teamMembership:TeamMembership member Administrators:someuser

Properties

Link copied to clipboard
val etag: Output<String>
Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val role: Output<String>?

The role of the user within the team. Must be one of member or maintainer. Defaults to member.

Link copied to clipboard
val teamId: Output<String>

The GitHub team id or the GitHub team slug

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val username: Output<String>

The user to add to the team.