1. Packages
  2. dbt Cloud Provider
  3. API Docs
  4. getUserGroups
dbt Cloud v1.0.2 published on Tuesday, Jun 24, 2025 by Pulumi

dbtcloud.getUserGroups

Explore with Pulumi AI

dbtcloud logo
dbt Cloud v1.0.2 published on Tuesday, Jun 24, 2025 by Pulumi

    Gets information about a specific dbt Cloud user’s groups.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dbtcloud from "@pulumi/dbtcloud";
    
    const myUserGroups = dbtcloud.getUserGroups({
        userId: 12345,
    });
    
    import pulumi
    import pulumi_dbtcloud as dbtcloud
    
    my_user_groups = dbtcloud.get_user_groups(user_id=12345)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-dbtcloud/sdk/go/dbtcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbtcloud.LookupUserGroups(ctx, &dbtcloud.LookupUserGroupsArgs{
    			UserId: 12345,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DbtCloud = Pulumi.DbtCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var myUserGroups = DbtCloud.GetUserGroups.Invoke(new()
        {
            UserId = 12345,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dbtcloud.DbtcloudFunctions;
    import com.pulumi.dbtcloud.inputs.GetUserGroupsArgs;
    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 myUserGroups = DbtcloudFunctions.getUserGroups(GetUserGroupsArgs.builder()
                .userId(12345)
                .build());
    
        }
    }
    
    variables:
      myUserGroups:
        fn::invoke:
          function: dbtcloud:getUserGroups
          arguments:
            userId: 12345
    

    Using getUserGroups

    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 getUserGroups(args: GetUserGroupsArgs, opts?: InvokeOptions): Promise<GetUserGroupsResult>
    function getUserGroupsOutput(args: GetUserGroupsOutputArgs, opts?: InvokeOptions): Output<GetUserGroupsResult>
    def get_user_groups(user_id: Optional[int] = None,
                        opts: Optional[InvokeOptions] = None) -> GetUserGroupsResult
    def get_user_groups_output(user_id: Optional[pulumi.Input[int]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetUserGroupsResult]
    func LookupUserGroups(ctx *Context, args *LookupUserGroupsArgs, opts ...InvokeOption) (*LookupUserGroupsResult, error)
    func LookupUserGroupsOutput(ctx *Context, args *LookupUserGroupsOutputArgs, opts ...InvokeOption) LookupUserGroupsResultOutput

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

    public static class GetUserGroups 
    {
        public static Task<GetUserGroupsResult> InvokeAsync(GetUserGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetUserGroupsResult> Invoke(GetUserGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserGroupsResult> getUserGroups(GetUserGroupsArgs args, InvokeOptions options)
    public static Output<GetUserGroupsResult> getUserGroups(GetUserGroupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: dbtcloud:index/getUserGroups:getUserGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UserId int
    The internal ID of a dbt Cloud user.
    UserId int
    The internal ID of a dbt Cloud user.
    userId Integer
    The internal ID of a dbt Cloud user.
    userId number
    The internal ID of a dbt Cloud user.
    user_id int
    The internal ID of a dbt Cloud user.
    userId Number
    The internal ID of a dbt Cloud user.

    getUserGroups Result

    The following output properties are available:

    GroupIds List<int>
    IDs of the groups assigned to the user.
    Id string
    The ID of this resource. It is the same as the user_id.
    UserId int
    The internal ID of a dbt Cloud user.
    GroupIds []int
    IDs of the groups assigned to the user.
    Id string
    The ID of this resource. It is the same as the user_id.
    UserId int
    The internal ID of a dbt Cloud user.
    groupIds List<Integer>
    IDs of the groups assigned to the user.
    id String
    The ID of this resource. It is the same as the user_id.
    userId Integer
    The internal ID of a dbt Cloud user.
    groupIds number[]
    IDs of the groups assigned to the user.
    id string
    The ID of this resource. It is the same as the user_id.
    userId number
    The internal ID of a dbt Cloud user.
    group_ids Sequence[int]
    IDs of the groups assigned to the user.
    id str
    The ID of this resource. It is the same as the user_id.
    user_id int
    The internal ID of a dbt Cloud user.
    groupIds List<Number>
    IDs of the groups assigned to the user.
    id String
    The ID of this resource. It is the same as the user_id.
    userId Number
    The internal ID of a dbt Cloud user.

    Package Details

    Repository
    dbtcloud pulumi/pulumi-dbtcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dbtcloud Terraform Provider.
    dbtcloud logo
    dbt Cloud v1.0.2 published on Tuesday, Jun 24, 2025 by Pulumi