1. Packages
  2. AzureDevOps
  3. API Docs
  4. getGroup
Azure DevOps v2.14.0 published on Tuesday, Oct 31, 2023 by Pulumi

azuredevops.getGroup

Explore with Pulumi AI

azuredevops logo
Azure DevOps v2.14.0 published on Tuesday, Oct 31, 2023 by Pulumi

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

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleProject = AzureDevOps.GetProject.Invoke(new()
        {
            Name = "Example Project",
        });
    
        var exampleGroup = AzureDevOps.GetGroup.Invoke(new()
        {
            ProjectId = exampleProject.Apply(getProjectResult => getProjectResult.Id),
            Name = "Example Group",
        });
    
        var example_collection_group = AzureDevOps.GetGroup.Invoke(new()
        {
            Name = "Project Collection Administrators",
        });
    
        return new Dictionary<string, object?>
        {
            ["groupId"] = exampleGroup.Apply(getGroupResult => getGroupResult.Id),
            ["groupDescriptor"] = exampleGroup.Apply(getGroupResult => getGroupResult.Descriptor),
            ["collectionGroupId"] = exampleGroup.Apply(getGroupResult => getGroupResult.Id),
            ["collectionGroupDescriptor"] = exampleGroup.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.LookupProject(ctx, &azuredevops.LookupProjectArgs{
    			Name: pulumi.StringRef("Example Project"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		exampleGroup, err := azuredevops.LookupGroup(ctx, &azuredevops.LookupGroupArgs{
    			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, &azuredevops.LookupGroupArgs{
    			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.inputs.GetProjectArgs;
    import com.pulumi.azuredevops.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
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the azuredevops Terraform Provider.

    azuredevops logo
    Azure DevOps v2.14.0 published on Tuesday, Oct 31, 2023 by Pulumi