github.TeamSettings
Explore with Pulumi AI
This resource manages the team settings (in particular the request review delegation settings) within the organization
Creating this resource will alter the team Code Review settings.
The team must both belong to the same organization configured in the provider on GitHub.
Note: This resource relies on the v4 GraphQl GitHub API. If this API is not available, or the Stone Crop schema preview is not available, then this resource will not work as intended.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
// Add a repository to the team
const someTeam = new github.Team("some_team", {
name: "SomeTeam",
description: "Some cool team",
});
const codeReviewSettings = new github.TeamSettings("code_review_settings", {
teamId: someTeam.id,
reviewRequestDelegation: {
algorithm: "ROUND_ROBIN",
memberCount: 1,
notify: true,
},
});
import pulumi
import pulumi_github as github
# Add a repository to the team
some_team = github.Team("some_team",
name="SomeTeam",
description="Some cool team")
code_review_settings = github.TeamSettings("code_review_settings",
team_id=some_team.id,
review_request_delegation={
"algorithm": "ROUND_ROBIN",
"member_count": 1,
"notify": True,
})
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Add a repository to the team
someTeam, err := github.NewTeam(ctx, "some_team", &github.TeamArgs{
Name: pulumi.String("SomeTeam"),
Description: pulumi.String("Some cool team"),
})
if err != nil {
return err
}
_, err = github.NewTeamSettings(ctx, "code_review_settings", &github.TeamSettingsArgs{
TeamId: someTeam.ID(),
ReviewRequestDelegation: &github.TeamSettingsReviewRequestDelegationArgs{
Algorithm: pulumi.String("ROUND_ROBIN"),
MemberCount: pulumi.Int(1),
Notify: pulumi.Bool(true),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
// Add a repository to the team
var someTeam = new Github.Team("some_team", new()
{
Name = "SomeTeam",
Description = "Some cool team",
});
var codeReviewSettings = new Github.TeamSettings("code_review_settings", new()
{
TeamId = someTeam.Id,
ReviewRequestDelegation = new Github.Inputs.TeamSettingsReviewRequestDelegationArgs
{
Algorithm = "ROUND_ROBIN",
MemberCount = 1,
Notify = true,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Team;
import com.pulumi.github.TeamArgs;
import com.pulumi.github.TeamSettings;
import com.pulumi.github.TeamSettingsArgs;
import com.pulumi.github.inputs.TeamSettingsReviewRequestDelegationArgs;
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) {
// Add a repository to the team
var someTeam = new Team("someTeam", TeamArgs.builder()
.name("SomeTeam")
.description("Some cool team")
.build());
var codeReviewSettings = new TeamSettings("codeReviewSettings", TeamSettingsArgs.builder()
.teamId(someTeam.id())
.reviewRequestDelegation(TeamSettingsReviewRequestDelegationArgs.builder()
.algorithm("ROUND_ROBIN")
.memberCount(1)
.notify(true)
.build())
.build());
}
}
resources:
# Add a repository to the team
someTeam:
type: github:Team
name: some_team
properties:
name: SomeTeam
description: Some cool team
codeReviewSettings:
type: github:TeamSettings
name: code_review_settings
properties:
teamId: ${someTeam.id}
reviewRequestDelegation:
algorithm: ROUND_ROBIN
memberCount: 1
notify: true
Create TeamSettings Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TeamSettings(name: string, args: TeamSettingsArgs, opts?: CustomResourceOptions);
@overload
def TeamSettings(resource_name: str,
args: TeamSettingsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TeamSettings(resource_name: str,
opts: Optional[ResourceOptions] = None,
team_id: Optional[str] = None,
review_request_delegation: Optional[TeamSettingsReviewRequestDelegationArgs] = None)
func NewTeamSettings(ctx *Context, name string, args TeamSettingsArgs, opts ...ResourceOption) (*TeamSettings, error)
public TeamSettings(string name, TeamSettingsArgs args, CustomResourceOptions? opts = null)
public TeamSettings(String name, TeamSettingsArgs args)
public TeamSettings(String name, TeamSettingsArgs args, CustomResourceOptions options)
type: github:TeamSettings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args TeamSettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args TeamSettingsArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args TeamSettingsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TeamSettingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TeamSettingsArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var teamSettingsResource = new Github.TeamSettings("teamSettingsResource", new()
{
TeamId = "string",
ReviewRequestDelegation = new Github.Inputs.TeamSettingsReviewRequestDelegationArgs
{
Algorithm = "string",
MemberCount = 0,
Notify = false,
},
});
example, err := github.NewTeamSettings(ctx, "teamSettingsResource", &github.TeamSettingsArgs{
TeamId: pulumi.String("string"),
ReviewRequestDelegation: &github.TeamSettingsReviewRequestDelegationArgs{
Algorithm: pulumi.String("string"),
MemberCount: pulumi.Int(0),
Notify: pulumi.Bool(false),
},
})
var teamSettingsResource = new TeamSettings("teamSettingsResource", TeamSettingsArgs.builder()
.teamId("string")
.reviewRequestDelegation(TeamSettingsReviewRequestDelegationArgs.builder()
.algorithm("string")
.memberCount(0)
.notify(false)
.build())
.build());
team_settings_resource = github.TeamSettings("teamSettingsResource",
team_id="string",
review_request_delegation={
"algorithm": "string",
"member_count": 0,
"notify": False,
})
const teamSettingsResource = new github.TeamSettings("teamSettingsResource", {
teamId: "string",
reviewRequestDelegation: {
algorithm: "string",
memberCount: 0,
notify: false,
},
});
type: github:TeamSettings
properties:
reviewRequestDelegation:
algorithm: string
memberCount: 0
notify: false
teamId: string
TeamSettings Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The TeamSettings resource accepts the following input properties:
- Team
Id string - The GitHub team id or the GitHub team slug
- Review
Request TeamDelegation Settings Review Request Delegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- Team
Id string - The GitHub team id or the GitHub team slug
- Review
Request TeamDelegation Settings Review Request Delegation Args - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team
Id String - The GitHub team id or the GitHub team slug
- review
Request TeamDelegation Settings Review Request Delegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team
Id string - The GitHub team id or the GitHub team slug
- review
Request TeamDelegation Settings Review Request Delegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team_
id str - The GitHub team id or the GitHub team slug
- review_
request_ Teamdelegation Settings Review Request Delegation Args - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team
Id String - The GitHub team id or the GitHub team slug
- review
Request Property MapDelegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
Outputs
All input properties are implicitly available as output properties. Additionally, the TeamSettings resource produces the following output properties:
Look up Existing TeamSettings Resource
Get an existing TeamSettings resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: TeamSettingsState, opts?: CustomResourceOptions): TeamSettings
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
review_request_delegation: Optional[TeamSettingsReviewRequestDelegationArgs] = None,
team_id: Optional[str] = None,
team_slug: Optional[str] = None,
team_uid: Optional[str] = None) -> TeamSettings
func GetTeamSettings(ctx *Context, name string, id IDInput, state *TeamSettingsState, opts ...ResourceOption) (*TeamSettings, error)
public static TeamSettings Get(string name, Input<string> id, TeamSettingsState? state, CustomResourceOptions? opts = null)
public static TeamSettings get(String name, Output<String> id, TeamSettingsState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Review
Request TeamDelegation Settings Review Request Delegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- Team
Id string - The GitHub team id or the GitHub team slug
- Team
Slug string - The slug of the Team within the Organization.
- Team
Uid string - The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
- Review
Request TeamDelegation Settings Review Request Delegation Args - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- Team
Id string - The GitHub team id or the GitHub team slug
- Team
Slug string - The slug of the Team within the Organization.
- Team
Uid string - The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
- review
Request TeamDelegation Settings Review Request Delegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team
Id String - The GitHub team id or the GitHub team slug
- team
Slug String - The slug of the Team within the Organization.
- team
Uid String - The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
- review
Request TeamDelegation Settings Review Request Delegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team
Id string - The GitHub team id or the GitHub team slug
- team
Slug string - The slug of the Team within the Organization.
- team
Uid string - The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
- review_
request_ Teamdelegation Settings Review Request Delegation Args - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team_
id str - The GitHub team id or the GitHub team slug
- team_
slug str - The slug of the Team within the Organization.
- team_
uid str - The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
- review
Request Property MapDelegation - The settings for delegating code reviews to individuals on behalf of the team. If this block is present, even without any fields, then review request delegation will be enabled for the team. See GitHub Review Request Delegation below for details. See GitHub's documentation for more configuration details.
- team
Id String - The GitHub team id or the GitHub team slug
- team
Slug String - The slug of the Team within the Organization.
- team
Uid String - The unique ID of the Team on GitHub. Corresponds to the ID of the 'github_team_settings' resource.
Supporting Types
TeamSettingsReviewRequestDelegation, TeamSettingsReviewRequestDelegationArgs
- Algorithm string
- The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
- Member
Count int - The number of team members to assign to a pull request.
- Notify bool
- whether to notify the entire team when at least one member is also assigned to the pull request.
- Algorithm string
- The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
- Member
Count int - The number of team members to assign to a pull request.
- Notify bool
- whether to notify the entire team when at least one member is also assigned to the pull request.
- algorithm String
- The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
- member
Count Integer - The number of team members to assign to a pull request.
- notify_ Boolean
- whether to notify the entire team when at least one member is also assigned to the pull request.
- algorithm string
- The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
- member
Count number - The number of team members to assign to a pull request.
- notify boolean
- whether to notify the entire team when at least one member is also assigned to the pull request.
- algorithm str
- The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
- member_
count int - The number of team members to assign to a pull request.
- notify bool
- whether to notify the entire team when at least one member is also assigned to the pull request.
- algorithm String
- The algorithm to use when assigning pull requests to team members. Supported values are 'ROUND_ROBIN' and 'LOAD_BALANCE'.
- member
Count Number - The number of team members to assign to a pull request.
- notify Boolean
- whether to notify the entire team when at least one member is also assigned to the pull request.
Import
GitHub Teams can be imported using the GitHub team ID, or the team slug e.g.
$ pulumi import github:index/teamSettings:TeamSettings code_review_settings 1234567
or,
$ pulumi import github:index/teamSettings:TeamSettings code_review_settings SomeTeam
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
github
Terraform Provider.