@pulumi/github
Version:
A Pulumi package for creating and managing github cloud resources.
160 lines (159 loc) • 6.84 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Provides a GitHub repository collaborators resource.
*
* > Note: github.RepositoryCollaborators cannot be used in conjunction with github.RepositoryCollaborator and
* github.TeamRepository or they will fight over what your policy should be.
*
* This resource allows you to manage all collaborators for repositories in your
* organization or personal account. For organization repositories, collaborators can
* have explicit (and differing levels of) read, write, or administrator access to
* specific repositories, without giving the user full organization membership.
* For personal repositories, collaborators can only be granted write
* (implicitly includes read) permission.
*
* When applied, an invitation will be sent to the user to become a collaborators
* on a repository. When destroyed, either the invitation will be cancelled or the
* collaborators will be removed from the repository.
*
* This resource is authoritative. For adding a collaborator to a repo in a non-authoritative manner, use
* github.RepositoryCollaborator instead.
*
* Further documentation on GitHub collaborators:
*
* - [Adding outside collaborators to your personal repositories](https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-access-to-your-personal-repositories)
* - [Adding outside collaborators to repositories in your organization](https://help.github.com/articles/adding-outside-collaborators-to-repositories-in-your-organization/)
* - [Converting an organization member to an outside collaborators](https://help.github.com/articles/converting-an-organization-member-to-an-outside-collaborator/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as github from "@pulumi/github";
*
* // Add collaborators to a repository
* const someTeam = new github.Team("some_team", {
* name: "SomeTeam",
* description: "Some cool team",
* });
* const someRepo = new github.Repository("some_repo", {name: "some-repo"});
* const someRepoCollaborators = new github.RepositoryCollaborators("some_repo_collaborators", {
* repository: someRepo.name,
* users: [{
* permission: "admin",
* username: "SomeUser",
* }],
* teams: [{
* permission: "pull",
* teamId: someTeam.slug,
* }],
* });
* ```
*
* ## Import
*
* GitHub Repository Collaborators can be imported using the name `name`, e.g.
*
* ```sh
* $ pulumi import github:index/repositoryCollaborators:RepositoryCollaborators collaborators terraform
* ```
*/
export declare class RepositoryCollaborators extends pulumi.CustomResource {
/**
* Get an existing RepositoryCollaborators resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: RepositoryCollaboratorsState, opts?: pulumi.CustomResourceOptions): RepositoryCollaborators;
/**
* Returns true if the given object is an instance of RepositoryCollaborators. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is RepositoryCollaborators;
/**
* List of teams to ignore when checking for repository access. This supports ignoring teams granted access at an organizational level.
*/
readonly ignoreTeams: pulumi.Output<outputs.RepositoryCollaboratorsIgnoreTeam[] | undefined>;
/**
* Map of usernames to invitation ID for any users added as part of creation of this resource to
* be used in `github.UserInvitationAccepter`.
*/
readonly invitationIds: pulumi.Output<{
[key: string]: string;
}>;
/**
* The GitHub repository.
*/
readonly repository: pulumi.Output<string>;
/**
* List of teams to grant access to the repository.
*/
readonly teams: pulumi.Output<outputs.RepositoryCollaboratorsTeam[] | undefined>;
/**
* List of users to grant access to the repository.
*/
readonly users: pulumi.Output<outputs.RepositoryCollaboratorsUser[] | undefined>;
/**
* Create a RepositoryCollaborators resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: RepositoryCollaboratorsArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering RepositoryCollaborators resources.
*/
export interface RepositoryCollaboratorsState {
/**
* List of teams to ignore when checking for repository access. This supports ignoring teams granted access at an organizational level.
*/
ignoreTeams?: pulumi.Input<pulumi.Input<inputs.RepositoryCollaboratorsIgnoreTeam>[]>;
/**
* Map of usernames to invitation ID for any users added as part of creation of this resource to
* be used in `github.UserInvitationAccepter`.
*/
invitationIds?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The GitHub repository.
*/
repository?: pulumi.Input<string>;
/**
* List of teams to grant access to the repository.
*/
teams?: pulumi.Input<pulumi.Input<inputs.RepositoryCollaboratorsTeam>[]>;
/**
* List of users to grant access to the repository.
*/
users?: pulumi.Input<pulumi.Input<inputs.RepositoryCollaboratorsUser>[]>;
}
/**
* The set of arguments for constructing a RepositoryCollaborators resource.
*/
export interface RepositoryCollaboratorsArgs {
/**
* List of teams to ignore when checking for repository access. This supports ignoring teams granted access at an organizational level.
*/
ignoreTeams?: pulumi.Input<pulumi.Input<inputs.RepositoryCollaboratorsIgnoreTeam>[]>;
/**
* The GitHub repository.
*/
repository: pulumi.Input<string>;
/**
* List of teams to grant access to the repository.
*/
teams?: pulumi.Input<pulumi.Input<inputs.RepositoryCollaboratorsTeam>[]>;
/**
* List of users to grant access to the repository.
*/
users?: pulumi.Input<pulumi.Input<inputs.RepositoryCollaboratorsUser>[]>;
}