1. Packages
  2. Slack
  3. API Docs
  4. getUsergroup
Slack v0.4.7 published on Friday, Sep 20, 2024 by Pulumi

slack.getUsergroup

Explore with Pulumi AI

slack logo
Slack v0.4.7 published on Friday, Sep 20, 2024 by Pulumi

    Use this data source to get information about a usergroups for use in other resources. The data source returns enabled groups only.

    Required scopes

    This resource requires the following scopes:

    The Slack API methods used by the resource are:

    If you get missing_scope errors while using this resource check the scopes against the documentation for the methods above.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as slack from "@pulumi/slack";
    
    const byName = slack.getUsergroup({
        name: "my-usergroup",
    });
    const byId = slack.getUsergroup({
        usergroupId: "USERGROUP00",
    });
    
    import pulumi
    import pulumi_slack as slack
    
    by_name = slack.get_usergroup(name="my-usergroup")
    by_id = slack.get_usergroup(usergroup_id="USERGROUP00")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-slack/sdk/go/slack"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := slack.LookupUsergroup(ctx, &slack.LookupUsergroupArgs{
    			Name: pulumi.StringRef("my-usergroup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = slack.LookupUsergroup(ctx, &slack.LookupUsergroupArgs{
    			UsergroupId: pulumi.StringRef("USERGROUP00"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Slack = Pulumi.Slack;
    
    return await Deployment.RunAsync(() => 
    {
        var byName = Slack.GetUsergroup.Invoke(new()
        {
            Name = "my-usergroup",
        });
    
        var byId = Slack.GetUsergroup.Invoke(new()
        {
            UsergroupId = "USERGROUP00",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.slack.SlackFunctions;
    import com.pulumi.slack.inputs.GetUsergroupArgs;
    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 byName = SlackFunctions.getUsergroup(GetUsergroupArgs.builder()
                .name("my-usergroup")
                .build());
    
            final var byId = SlackFunctions.getUsergroup(GetUsergroupArgs.builder()
                .usergroupId("USERGROUP00")
                .build());
    
        }
    }
    
    variables:
      byName:
        fn::invoke:
          Function: slack:getUsergroup
          Arguments:
            name: my-usergroup
      byId:
        fn::invoke:
          Function: slack:getUsergroup
          Arguments:
            usergroupId: USERGROUP00
    

    Using getUsergroup

    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 getUsergroup(args: GetUsergroupArgs, opts?: InvokeOptions): Promise<GetUsergroupResult>
    function getUsergroupOutput(args: GetUsergroupOutputArgs, opts?: InvokeOptions): Output<GetUsergroupResult>
    def get_usergroup(name: Optional[str] = None,
                      usergroup_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetUsergroupResult
    def get_usergroup_output(name: Optional[pulumi.Input[str]] = None,
                      usergroup_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetUsergroupResult]
    func LookupUsergroup(ctx *Context, args *LookupUsergroupArgs, opts ...InvokeOption) (*LookupUsergroupResult, error)
    func LookupUsergroupOutput(ctx *Context, args *LookupUsergroupOutputArgs, opts ...InvokeOption) LookupUsergroupResultOutput

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

    public static class GetUsergroup 
    {
        public static Task<GetUsergroupResult> InvokeAsync(GetUsergroupArgs args, InvokeOptions? opts = null)
        public static Output<GetUsergroupResult> Invoke(GetUsergroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUsergroupResult> getUsergroup(GetUsergroupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: slack:index/getUsergroup:getUsergroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the usergroup
    UsergroupId string

    The id of the usergroup

    The data source expects exactly one of these fields, you can't set both.

    Name string
    The name of the usergroup
    UsergroupId string

    The id of the usergroup

    The data source expects exactly one of these fields, you can't set both.

    name String
    The name of the usergroup
    usergroupId String

    The id of the usergroup

    The data source expects exactly one of these fields, you can't set both.

    name string
    The name of the usergroup
    usergroupId string

    The id of the usergroup

    The data source expects exactly one of these fields, you can't set both.

    name str
    The name of the usergroup
    usergroup_id str

    The id of the usergroup

    The data source expects exactly one of these fields, you can't set both.

    name String
    The name of the usergroup
    usergroupId String

    The id of the usergroup

    The data source expects exactly one of these fields, you can't set both.

    getUsergroup Result

    The following output properties are available:

    Channels List<string>
    The channel IDs for which the User Group uses as a default.
    Description string
    The short description of the User Group.
    Handle string
    The mention handle.
    Id string
    The provider-assigned unique ID for this managed resource.
    Users List<string>
    The user IDs that represent the entire list of users for the User Group.
    Name string
    UsergroupId string
    Channels []string
    The channel IDs for which the User Group uses as a default.
    Description string
    The short description of the User Group.
    Handle string
    The mention handle.
    Id string
    The provider-assigned unique ID for this managed resource.
    Users []string
    The user IDs that represent the entire list of users for the User Group.
    Name string
    UsergroupId string
    channels List<String>
    The channel IDs for which the User Group uses as a default.
    description String
    The short description of the User Group.
    handle String
    The mention handle.
    id String
    The provider-assigned unique ID for this managed resource.
    users List<String>
    The user IDs that represent the entire list of users for the User Group.
    name String
    usergroupId String
    channels string[]
    The channel IDs for which the User Group uses as a default.
    description string
    The short description of the User Group.
    handle string
    The mention handle.
    id string
    The provider-assigned unique ID for this managed resource.
    users string[]
    The user IDs that represent the entire list of users for the User Group.
    name string
    usergroupId string
    channels Sequence[str]
    The channel IDs for which the User Group uses as a default.
    description str
    The short description of the User Group.
    handle str
    The mention handle.
    id str
    The provider-assigned unique ID for this managed resource.
    users Sequence[str]
    The user IDs that represent the entire list of users for the User Group.
    name str
    usergroup_id str
    channels List<String>
    The channel IDs for which the User Group uses as a default.
    description String
    The short description of the User Group.
    handle String
    The mention handle.
    id String
    The provider-assigned unique ID for this managed resource.
    users List<String>
    The user IDs that represent the entire list of users for the User Group.
    name String
    usergroupId String

    Package Details

    Repository
    slack pulumi/pulumi-slack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the slack Terraform Provider.
    slack logo
    Slack v0.4.7 published on Friday, Sep 20, 2024 by Pulumi