AzureDevOps

Pulumi Official
Package maintained by Pulumi
v2.5.0 published on Monday, Jul 25, 2022 by Pulumi

getGroup

Use this data source to access information about an existing Group within Azure DevOps

Example Usage

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleProject = Output.Create(AzureDevOps.GetProject.InvokeAsync(new AzureDevOps.GetProjectArgs
        {
            Name = "Example Project",
        }));
        var exampleGroup = exampleProject.Apply(exampleProject => Output.Create(AzureDevOps.GetGroup.InvokeAsync(new AzureDevOps.GetGroupArgs
        {
            ProjectId = exampleProject.Id,
            Name = "Example Group",
        })));
        this.GroupId = exampleGroup.Apply(exampleGroup => exampleGroup.Id);
        this.GroupDescriptor = exampleGroup.Apply(exampleGroup => exampleGroup.Descriptor);
        var example_collection_group = Output.Create(AzureDevOps.GetGroup.InvokeAsync(new AzureDevOps.GetGroupArgs
        {
            Name = "Project Collection Administrators",
        }));
        this.CollectionGroupId = exampleGroup.Apply(exampleGroup => exampleGroup.Id);
        this.CollectionGroupDescriptor = exampleGroup.Apply(exampleGroup => exampleGroup.Descriptor);
    }

    [Output("groupId")]
    public Output<string> GroupId { get; set; }
    [Output("groupDescriptor")]
    public Output<string> GroupDescriptor { get; set; }
    [Output("collectionGroupId")]
    public Output<string> CollectionGroupId { get; set; }
    [Output("collectionGroupDescriptor")]
    public Output<string> CollectionGroupDescriptor { get; set; }
}
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.LookupProject(ctx, &GetProjectArgs{
			Name: pulumi.StringRef("Example Project"),
		}, nil)
		if err != nil {
			return err
		}
		exampleGroup, err := azuredevops.LookupGroup(ctx, &GetGroupArgs{
			ProjectId: pulumi.StringRef(exampleProject.Id),
			Name:      "Example Group",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("groupId", exampleGroup.Id)
		ctx.Export("groupDescriptor", exampleGroup.Descriptor)
		_, err = azuredevops.LookupGroup(ctx, &GetGroupArgs{
			Name: "Project Collection Administrators",
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("collectionGroupId", exampleGroup.Id)
		ctx.Export("collectionGroupDescriptor", exampleGroup.Descriptor)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azuredevops.AzuredevopsFunctions;
import com.pulumi.azuredevops.Core.inputs.GetProjectArgs;
import com.pulumi.azuredevops.Identities.inputs.GetGroupArgs;
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) {
        final var exampleProject = AzuredevopsFunctions.getProject(GetProjectArgs.builder()
            .name("Example Project")
            .build());

        final var exampleGroup = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
            .projectId(exampleProject.applyValue(getProjectResult -> getProjectResult.id()))
            .name("Example Group")
            .build());

        ctx.export("groupId", exampleGroup.applyValue(getGroupResult -> getGroupResult.id()));
        ctx.export("groupDescriptor", exampleGroup.applyValue(getGroupResult -> getGroupResult.descriptor()));
        final var example-collection-group = AzuredevopsFunctions.getGroup(GetGroupArgs.builder()
            .name("Project Collection Administrators")
            .build());

        ctx.export("collectionGroupId", exampleGroup.applyValue(getGroupResult -> getGroupResult.id()));
        ctx.export("collectionGroupDescriptor", exampleGroup.applyValue(getGroupResult -> getGroupResult.descriptor()));
    }
}
import pulumi
import pulumi_azuredevops as azuredevops

example_project = azuredevops.get_project(name="Example Project")
example_group = azuredevops.get_group(project_id=example_project.id,
    name="Example Group")
pulumi.export("groupId", example_group.id)
pulumi.export("groupDescriptor", example_group.descriptor)
example_collection_group = azuredevops.get_group(name="Project Collection Administrators")
pulumi.export("collectionGroupId", example_group.id)
pulumi.export("collectionGroupDescriptor", example_group.descriptor)
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const exampleProject = azuredevops.getProject({
    name: "Example Project",
});
const exampleGroup = exampleProject.then(exampleProject => azuredevops.getGroup({
    projectId: exampleProject.id,
    name: "Example Group",
}));
export const groupId = exampleGroup.then(exampleGroup => exampleGroup.id);
export const groupDescriptor = exampleGroup.then(exampleGroup => exampleGroup.descriptor);
const example-collection-group = azuredevops.getGroup({
    name: "Project Collection Administrators",
});
export const collectionGroupId = exampleGroup.then(exampleGroup => exampleGroup.id);
export const collectionGroupDescriptor = exampleGroup.then(exampleGroup => exampleGroup.descriptor);
variables:
  exampleProject:
    Fn::Invoke:
      Function: azuredevops:getProject
      Arguments:
        name: Example Project
  exampleGroup:
    Fn::Invoke:
      Function: azuredevops:getGroup
      Arguments:
        projectId: ${exampleProject.id}
        name: Example Group
  example-collection-group:
    Fn::Invoke:
      Function: azuredevops:getGroup
      Arguments:
        name: Project Collection Administrators
outputs:
  groupId: ${exampleGroup.id}
  groupDescriptor: ${exampleGroup.descriptor}
  collectionGroupId: ${exampleGroup.id}
  collectionGroupDescriptor: ${exampleGroup.descriptor}

Using getGroup

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getGroup(args: GetGroupArgs, opts?: InvokeOptions): Promise<GetGroupResult>
function getGroupOutput(args: GetGroupOutputArgs, opts?: InvokeOptions): Output<GetGroupResult>
def get_group(name: Optional[str] = None,
              project_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetGroupResult
def get_group_output(name: Optional[pulumi.Input[str]] = None,
              project_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetGroupResult]
func LookupGroup(ctx *Context, args *LookupGroupArgs, opts ...InvokeOption) (*LookupGroupResult, error)
func LookupGroupOutput(ctx *Context, args *LookupGroupOutputArgs, opts ...InvokeOption) LookupGroupResultOutput

> Note: This function is named LookupGroup in the Go SDK.

public static class GetGroup 
{
    public static Task<GetGroupResult> InvokeAsync(GetGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetGroupResult> Invoke(GetGroupInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetGroupResult> getGroup(GetGroupArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: azuredevops:index/getGroup:getGroup
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

The Group Name.

ProjectId string

The Project ID. If no project ID is specified the project collection groups will be searched.

Name string

The Group Name.

ProjectId string

The Project ID. If no project ID is specified the project collection groups will be searched.

name String

The Group Name.

projectId String

The Project ID. If no project ID is specified the project collection groups will be searched.

name string

The Group Name.

projectId string

The Project ID. If no project ID is specified the project collection groups will be searched.

name str

The Group Name.

project_id str

The Project ID. If no project ID is specified the project collection groups will be searched.

name String

The Group Name.

projectId String

The Project ID. If no project ID is specified the project collection groups will be searched.

getGroup Result

The following output properties are available:

Descriptor string

The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Origin string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

OriginId string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

ProjectId string
Descriptor string

The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.

Id string

The provider-assigned unique ID for this managed resource.

Name string
Origin string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

OriginId string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

ProjectId string
descriptor String

The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.

id String

The provider-assigned unique ID for this managed resource.

name String
origin String

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId String

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

projectId String
descriptor string

The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.

id string

The provider-assigned unique ID for this managed resource.

name string
origin string

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId string

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

projectId string
descriptor str

The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.

id str

The provider-assigned unique ID for this managed resource.

name str
origin str

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

origin_id str

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

project_id str
descriptor String

The Descriptor is the primary way to reference the graph subject. This field will uniquely identify the same graph subject across both Accounts and Organizations.

id String

The provider-assigned unique ID for this managed resource.

name String
origin String

The type of source provider for the origin identifier (ex:AD, AAD, MSA)

originId String

The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider.

projectId String

Package Details

Repository
https://github.com/pulumi/pulumi-azuredevops
License
Apache-2.0
Notes

This Pulumi package is based on the azuredevops Terraform Provider.