UNPKG

@pulumi/github

Version:

A Pulumi package for creating and managing github cloud resources.

133 lines (132 loc) 5.84 kB
import * as pulumi from "@pulumi/pulumi"; /** * This resource allows you to create and manage custom roles in a GitHub Organization for use in repositories. * * > Note: Custom roles are currently only available in GitHub Enterprise Cloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as github from "@pulumi/github"; * * const example = new github.OrganizationCustomRole("example", { * name: "example", * description: "Example custom role that uses the read role as its base", * baseRole: "read", * permissions: [ * "add_assignee", * "add_label", * "bypass_branch_protection", * "close_issue", * "close_pull_request", * "mark_as_duplicate", * "create_tag", * "delete_issue", * "delete_tag", * "manage_deploy_keys", * "push_protected_branch", * "read_code_scanning", * "reopen_issue", * "reopen_pull_request", * "request_pr_review", * "resolve_dependabot_alerts", * "resolve_secret_scanning_alerts", * "view_secret_scanning_alerts", * "write_code_scanning", * ], * }); * ``` * * ## Import * * Custom roles can be imported using the `id` of the role. * The `id` of the custom role can be found using the [list custom roles in an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization) API. * * ```sh * $ pulumi import github:index/organizationCustomRole:OrganizationCustomRole example 1234 * ``` */ export declare class OrganizationCustomRole extends pulumi.CustomResource { /** * Get an existing OrganizationCustomRole 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?: OrganizationCustomRoleState, opts?: pulumi.CustomResourceOptions): OrganizationCustomRole; /** * Returns true if the given object is an instance of OrganizationCustomRole. 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 OrganizationCustomRole; /** * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. */ readonly baseRole: pulumi.Output<string>; /** * The description for the custom role. */ readonly description: pulumi.Output<string | undefined>; /** * The name of the custom role. */ readonly name: pulumi.Output<string>; /** * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. */ readonly permissions: pulumi.Output<string[]>; /** * Create a OrganizationCustomRole 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: OrganizationCustomRoleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering OrganizationCustomRole resources. */ export interface OrganizationCustomRoleState { /** * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. */ baseRole?: pulumi.Input<string>; /** * The description for the custom role. */ description?: pulumi.Input<string>; /** * The name of the custom role. */ name?: pulumi.Input<string>; /** * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. */ permissions?: pulumi.Input<pulumi.Input<string>[]>; } /** * The set of arguments for constructing a OrganizationCustomRole resource. */ export interface OrganizationCustomRoleArgs { /** * The system role from which the role inherits permissions. Can be one of: `read`, `triage`, `write`, or `maintain`. */ baseRole: pulumi.Input<string>; /** * The description for the custom role. */ description?: pulumi.Input<string>; /** * The name of the custom role. */ name?: pulumi.Input<string>; /** * A list of additional permissions included in this role. Must have a minimum of 1 additional permission. The list of available permissions can be found using the [list repository fine-grained permissions for an organization](https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization) API. */ permissions: pulumi.Input<pulumi.Input<string>[]>; }