azuredevops logo
Azure DevOps v2.7.0, Mar 27 23

azuredevops.TeamAdministrators

Explore with Pulumi AI

Manages administrators of a team within a project in a Azure DevOps organization.

PAT Permissions Required

  • vso.project_write: Grants the ability to read and update projects and teams.

Example Usage

using System.Collections.Generic;
using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

return await Deployment.RunAsync(() => 
{
    var exampleProject = new AzureDevOps.Project("exampleProject", new()
    {
        WorkItemTemplate = "Agile",
        VersionControl = "Git",
        Visibility = "private",
        Description = "Managed by Terraform",
    });

    var example_project_contributors = AzureDevOps.GetGroup.Invoke(new()
    {
        ProjectId = exampleProject.Id,
        Name = "Contributors",
    });

    var exampleTeam = new AzureDevOps.Team("exampleTeam", new()
    {
        ProjectId = exampleProject.Id,
    });

    var example_team_administrators = new AzureDevOps.TeamAdministrators("example-team-administrators", new()
    {
        ProjectId = exampleTeam.ProjectId,
        TeamId = exampleTeam.Id,
        Mode = "overwrite",
        Administrators = new[]
        {
            example_project_contributors.Apply(example_project_contributors => example_project_contributors.Apply(getGroupResult => getGroupResult.Descriptor)),
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azuredevops/sdk/v2/go/azuredevops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleProject, err := azuredevops.NewProject(ctx, "exampleProject", &azuredevops.ProjectArgs{
			WorkItemTemplate: pulumi.String("Agile"),
			VersionControl:   pulumi.String("Git"),
			Visibility:       pulumi.String("private"),
			Description:      pulumi.String("Managed by Terraform"),
		})
		if err != nil {
			return err
		}
		example_project_contributors := azuredevops.LookupGroupOutput(ctx, azuredevops.GetGroupOutputArgs{
			ProjectId: exampleProject.ID(),
			Name:      pulumi.String("Contributors"),
		}, nil)
		exampleTeam, err := azuredevops.NewTeam(ctx, "exampleTeam", &azuredevops.TeamArgs{
			ProjectId: exampleProject.ID(),
		})
		if err != nil {
			return err
		}
		_, err = azuredevops.NewTeamAdministrators(ctx, "example-team-administrators", &azuredevops.TeamAdministratorsArgs{
			ProjectId: exampleTeam.ProjectId,
			TeamId:    exampleTeam.ID(),
			Mode:      pulumi.String("overwrite"),
			Administrators: pulumi.StringArray{
				example_project_contributors.ApplyT(func(example_project_contributors azuredevops.GetGroupResult) (*string, error) {
					return &example_project_contributors.Descriptor, nil
				}).(pulumi.StringPtrOutput),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.Project;
import com.pulumi.azuredevops.ProjectArgs;
import com.pulumi.azuredevops.AzuredevopsFunctions;
import com.pulumi.azuredevops.inputs.GetGroupArgs;
import com.pulumi.azuredevops.Team;
import com.pulumi.azuredevops.TeamArgs;
import com.pulumi.azuredevops.TeamAdministrators;
import com.pulumi.azuredevops.TeamAdministratorsArgs;
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 exampleProject = new Project("exampleProject", ProjectArgs.builder()        
            .workItemTemplate("Agile")
            .versionControl("Git")
            .visibility("private")
            .description("Managed by Terraform")
            .build());

        final var example-project-contributors = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
            .projectId(exampleProject.id())
            .name("Contributors")
            .build());

        var exampleTeam = new Team("exampleTeam", TeamArgs.builder()        
            .projectId(exampleProject.id())
            .build());

        var example_team_administrators = new TeamAdministrators("example-team-administrators", TeamAdministratorsArgs.builder()        
            .projectId(exampleTeam.projectId())
            .teamId(exampleTeam.id())
            .mode("overwrite")
            .administrators(example_project_contributors.applyValue(example_project_contributors -> example_project_contributors.descriptor()))
            .build());

    }
}
import pulumi
import pulumi_azuredevops as azuredevops

example_project = azuredevops.Project("exampleProject",
    work_item_template="Agile",
    version_control="Git",
    visibility="private",
    description="Managed by Terraform")
example_project_contributors = azuredevops.get_group_output(project_id=example_project.id,
    name="Contributors")
example_team = azuredevops.Team("exampleTeam", project_id=example_project.id)
example_team_administrators = azuredevops.TeamAdministrators("example-team-administrators",
    project_id=example_team.project_id,
    team_id=example_team.id,
    mode="overwrite",
    administrators=[example_project_contributors.descriptor])
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const exampleProject = new azuredevops.Project("exampleProject", {
    workItemTemplate: "Agile",
    versionControl: "Git",
    visibility: "private",
    description: "Managed by Terraform",
});
const example-project-contributors = azuredevops.getGroupOutput({
    projectId: exampleProject.id,
    name: "Contributors",
});
const exampleTeam = new azuredevops.Team("exampleTeam", {projectId: exampleProject.id});
const example_team_administrators = new azuredevops.TeamAdministrators("example-team-administrators", {
    projectId: exampleTeam.projectId,
    teamId: exampleTeam.id,
    mode: "overwrite",
    administrators: [example_project_contributors.apply(example_project_contributors => example_project_contributors.descriptor)],
});
resources:
  exampleProject:
    type: azuredevops:Project
    properties:
      workItemTemplate: Agile
      versionControl: Git
      visibility: private
      description: Managed by Terraform
  exampleTeam:
    type: azuredevops:Team
    properties:
      projectId: ${exampleProject.id}
  example-team-administrators:
    type: azuredevops:TeamAdministrators
    properties:
      projectId: ${exampleTeam.projectId}
      teamId: ${exampleTeam.id}
      mode: overwrite
      administrators:
        - ${["example-project-contributors"].descriptor}
variables:
  example-project-contributors:
    fn::invoke:
      Function: azuredevops:getGroup
      Arguments:
        projectId: ${exampleProject.id}
        name: Contributors

Create TeamAdministrators Resource

new TeamAdministrators(name: string, args: TeamAdministratorsArgs, opts?: CustomResourceOptions);
@overload
def TeamAdministrators(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       administrators: Optional[Sequence[str]] = None,
                       mode: Optional[str] = None,
                       project_id: Optional[str] = None,
                       team_id: Optional[str] = None)
@overload
def TeamAdministrators(resource_name: str,
                       args: TeamAdministratorsArgs,
                       opts: Optional[ResourceOptions] = None)
func NewTeamAdministrators(ctx *Context, name string, args TeamAdministratorsArgs, opts ...ResourceOption) (*TeamAdministrators, error)
public TeamAdministrators(string name, TeamAdministratorsArgs args, CustomResourceOptions? opts = null)
public TeamAdministrators(String name, TeamAdministratorsArgs args)
public TeamAdministrators(String name, TeamAdministratorsArgs args, CustomResourceOptions options)
type: azuredevops:TeamAdministrators
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args TeamAdministratorsArgs
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 TeamAdministratorsArgs
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 TeamAdministratorsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TeamAdministratorsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args TeamAdministratorsArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

TeamAdministrators Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The TeamAdministrators resource accepts the following input properties:

Administrators List<string>

List of subject descriptors to define adminitrators of the team.

ProjectId string

The Project ID.

TeamId string

The ID of the Team.

Mode string

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
Administrators []string

List of subject descriptors to define adminitrators of the team.

ProjectId string

The Project ID.

TeamId string

The ID of the Team.

Mode string

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
administrators List<String>

List of subject descriptors to define adminitrators of the team.

projectId String

The Project ID.

teamId String

The ID of the Team.

mode String

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
administrators string[]

List of subject descriptors to define adminitrators of the team.

projectId string

The Project ID.

teamId string

The ID of the Team.

mode string

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
administrators Sequence[str]

List of subject descriptors to define adminitrators of the team.

project_id str

The Project ID.

team_id str

The ID of the Team.

mode str

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
administrators List<String>

List of subject descriptors to define adminitrators of the team.

projectId String

The Project ID.

teamId String

The ID of the Team.

mode String

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block

Outputs

All input properties are implicitly available as output properties. Additionally, the TeamAdministrators resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing TeamAdministrators Resource

Get an existing TeamAdministrators 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?: TeamAdministratorsState, opts?: CustomResourceOptions): TeamAdministrators
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        administrators: Optional[Sequence[str]] = None,
        mode: Optional[str] = None,
        project_id: Optional[str] = None,
        team_id: Optional[str] = None) -> TeamAdministrators
func GetTeamAdministrators(ctx *Context, name string, id IDInput, state *TeamAdministratorsState, opts ...ResourceOption) (*TeamAdministrators, error)
public static TeamAdministrators Get(string name, Input<string> id, TeamAdministratorsState? state, CustomResourceOptions? opts = null)
public static TeamAdministrators get(String name, Output<String> id, TeamAdministratorsState 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.
The following state arguments are supported:
Administrators List<string>

List of subject descriptors to define adminitrators of the team.

Mode string

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
ProjectId string

The Project ID.

TeamId string

The ID of the Team.

Administrators []string

List of subject descriptors to define adminitrators of the team.

Mode string

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
ProjectId string

The Project ID.

TeamId string

The ID of the Team.

administrators List<String>

List of subject descriptors to define adminitrators of the team.

mode String

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
projectId String

The Project ID.

teamId String

The ID of the Team.

administrators string[]

List of subject descriptors to define adminitrators of the team.

mode string

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
projectId string

The Project ID.

teamId string

The ID of the Team.

administrators Sequence[str]

List of subject descriptors to define adminitrators of the team.

mode str

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
project_id str

The Project ID.

team_id str

The ID of the Team.

administrators List<String>

List of subject descriptors to define adminitrators of the team.

mode String

The mode how the resource manages team administrators.

  • mode == add: the resource will ensure that all specified administrators will be part of the referenced team
  • mode == overwrite: the resource will replace all existing administrators with the administrators specified within the administrators block
projectId String

The Project ID.

teamId String

The ID of the Team.

Import

The resource does not support import.

Package Details

Repository
Azure DevOps pulumi/pulumi-azuredevops
License
Apache-2.0
Notes

This Pulumi package is based on the azuredevops Terraform Provider.