1. Packages
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. getUserGroups
Viewing docs for Cloudflare v6.15.0
published on Saturday, May 2, 2026 by Pulumi
cloudflare logo
Viewing docs for Cloudflare v6.15.0
published on Saturday, May 2, 2026 by Pulumi

    Accepted Permissions

    • Account Settings Read
    • Account Settings Write
    • SCIM Provisioning

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleUserGroups = cloudflare.getUserGroups({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        id: "023e105f4ecef8ad9ca31a8372d0c353",
        fuzzyName: "Foo",
        name: "NameOfTheUserGroup",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_user_groups = cloudflare.get_user_groups(account_id="023e105f4ecef8ad9ca31a8372d0c353",
        id="023e105f4ecef8ad9ca31a8372d0c353",
        fuzzy_name="Foo",
        name="NameOfTheUserGroup")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.GetUserGroups(ctx, &cloudflare.LookupUserGroupsArgs{
    			AccountId: "023e105f4ecef8ad9ca31a8372d0c353",
    			Id:        pulumi.StringRef("023e105f4ecef8ad9ca31a8372d0c353"),
    			FuzzyName: pulumi.StringRef("Foo"),
    			Name:      pulumi.StringRef("NameOfTheUserGroup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleUserGroups = Cloudflare.Index.GetUserGroups.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            Id = "023e105f4ecef8ad9ca31a8372d0c353",
            FuzzyName = "Foo",
            Name = "NameOfTheUserGroup",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.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 exampleUserGroups = CloudflareFunctions.getUserGroups(GetUserGroupsArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .id("023e105f4ecef8ad9ca31a8372d0c353")
                .fuzzyName("Foo")
                .name("NameOfTheUserGroup")
                .build());
    
        }
    }
    
    variables:
      exampleUserGroups:
        fn::invoke:
          function: cloudflare:getUserGroups
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
            id: 023e105f4ecef8ad9ca31a8372d0c353
            fuzzyName: Foo
            name: NameOfTheUserGroup
    

    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(account_id: Optional[str] = None,
                        direction: Optional[str] = None,
                        fuzzy_name: Optional[str] = None,
                        id: Optional[str] = None,
                        max_items: Optional[int] = None,
                        name: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetUserGroupsResult
    def get_user_groups_output(account_id: Optional[pulumi.Input[str]] = None,
                        direction: Optional[pulumi.Input[str]] = None,
                        fuzzy_name: Optional[pulumi.Input[str]] = None,
                        id: Optional[pulumi.Input[str]] = None,
                        max_items: Optional[pulumi.Input[int]] = None,
                        name: Optional[pulumi.Input[str]] = 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: cloudflare:index/getUserGroups:getUserGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account identifier tag.
    Direction string
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    FuzzyName string
    A string used for searching for user groups containing that substring.
    Id string
    ID of the user group to be fetched.
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the user group to be fetched.
    AccountId string
    Account identifier tag.
    Direction string
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    FuzzyName string
    A string used for searching for user groups containing that substring.
    Id string
    ID of the user group to be fetched.
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the user group to be fetched.
    accountId String
    Account identifier tag.
    direction String
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    fuzzyName String
    A string used for searching for user groups containing that substring.
    id String
    ID of the user group to be fetched.
    maxItems Integer
    Max items to fetch, default: 1000
    name String
    Name of the user group to be fetched.
    accountId string
    Account identifier tag.
    direction string
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    fuzzyName string
    A string used for searching for user groups containing that substring.
    id string
    ID of the user group to be fetched.
    maxItems number
    Max items to fetch, default: 1000
    name string
    Name of the user group to be fetched.
    account_id str
    Account identifier tag.
    direction str
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    fuzzy_name str
    A string used for searching for user groups containing that substring.
    id str
    ID of the user group to be fetched.
    max_items int
    Max items to fetch, default: 1000
    name str
    Name of the user group to be fetched.
    accountId String
    Account identifier tag.
    direction String
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    fuzzyName String
    A string used for searching for user groups containing that substring.
    id String
    ID of the user group to be fetched.
    maxItems Number
    Max items to fetch, default: 1000
    name String
    Name of the user group to be fetched.

    getUserGroups Result

    The following output properties are available:

    AccountId string
    Account identifier tag.
    Direction string
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    Results List<GetUserGroupsResult>
    The items returned by the data source
    FuzzyName string
    A string used for searching for user groups containing that substring.
    Id string
    ID of the user group to be fetched.
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the user group to be fetched.
    AccountId string
    Account identifier tag.
    Direction string
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    Results []GetUserGroupsResult
    The items returned by the data source
    FuzzyName string
    A string used for searching for user groups containing that substring.
    Id string
    ID of the user group to be fetched.
    MaxItems int
    Max items to fetch, default: 1000
    Name string
    Name of the user group to be fetched.
    accountId String
    Account identifier tag.
    direction String
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    results List<GetUserGroupsResult>
    The items returned by the data source
    fuzzyName String
    A string used for searching for user groups containing that substring.
    id String
    ID of the user group to be fetched.
    maxItems Integer
    Max items to fetch, default: 1000
    name String
    Name of the user group to be fetched.
    accountId string
    Account identifier tag.
    direction string
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    results GetUserGroupsResult[]
    The items returned by the data source
    fuzzyName string
    A string used for searching for user groups containing that substring.
    id string
    ID of the user group to be fetched.
    maxItems number
    Max items to fetch, default: 1000
    name string
    Name of the user group to be fetched.
    account_id str
    Account identifier tag.
    direction str
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    results Sequence[GetUserGroupsResult]
    The items returned by the data source
    fuzzy_name str
    A string used for searching for user groups containing that substring.
    id str
    ID of the user group to be fetched.
    max_items int
    Max items to fetch, default: 1000
    name str
    Name of the user group to be fetched.
    accountId String
    Account identifier tag.
    direction String
    The sort order of returned user groups by name (ascending or descending). Available values: "asc", "desc".
    results List<Property Map>
    The items returned by the data source
    fuzzyName String
    A string used for searching for user groups containing that substring.
    id String
    ID of the user group to be fetched.
    maxItems Number
    Max items to fetch, default: 1000
    name String
    Name of the user group to be fetched.

    Supporting Types

    GetUserGroupsResult

    CreatedOn string
    Timestamp for the creation of the user group
    Id string
    User Group identifier tag.
    ModifiedOn string
    Last time the user group was modified.
    Name string
    Name of the user group.
    Policies List<GetUserGroupsResultPolicy>
    Policies attached to the User group
    CreatedOn string
    Timestamp for the creation of the user group
    Id string
    User Group identifier tag.
    ModifiedOn string
    Last time the user group was modified.
    Name string
    Name of the user group.
    Policies []GetUserGroupsResultPolicy
    Policies attached to the User group
    createdOn String
    Timestamp for the creation of the user group
    id String
    User Group identifier tag.
    modifiedOn String
    Last time the user group was modified.
    name String
    Name of the user group.
    policies List<GetUserGroupsResultPolicy>
    Policies attached to the User group
    createdOn string
    Timestamp for the creation of the user group
    id string
    User Group identifier tag.
    modifiedOn string
    Last time the user group was modified.
    name string
    Name of the user group.
    policies GetUserGroupsResultPolicy[]
    Policies attached to the User group
    created_on str
    Timestamp for the creation of the user group
    id str
    User Group identifier tag.
    modified_on str
    Last time the user group was modified.
    name str
    Name of the user group.
    policies Sequence[GetUserGroupsResultPolicy]
    Policies attached to the User group
    createdOn String
    Timestamp for the creation of the user group
    id String
    User Group identifier tag.
    modifiedOn String
    Last time the user group was modified.
    name String
    Name of the user group.
    policies List<Property Map>
    Policies attached to the User group

    GetUserGroupsResultPolicy

    Access string
    Allow or deny operations against the resources. Available values: "allow", "deny".
    Id string
    Policy identifier.
    PermissionGroups List<GetUserGroupsResultPolicyPermissionGroup>
    A set of permission groups that are specified to the policy.
    ResourceGroups List<GetUserGroupsResultPolicyResourceGroup>
    A list of resource groups that the policy applies to.
    Access string
    Allow or deny operations against the resources. Available values: "allow", "deny".
    Id string
    Policy identifier.
    PermissionGroups []GetUserGroupsResultPolicyPermissionGroup
    A set of permission groups that are specified to the policy.
    ResourceGroups []GetUserGroupsResultPolicyResourceGroup
    A list of resource groups that the policy applies to.
    access String
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id String
    Policy identifier.
    permissionGroups List<GetUserGroupsResultPolicyPermissionGroup>
    A set of permission groups that are specified to the policy.
    resourceGroups List<GetUserGroupsResultPolicyResourceGroup>
    A list of resource groups that the policy applies to.
    access string
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id string
    Policy identifier.
    permissionGroups GetUserGroupsResultPolicyPermissionGroup[]
    A set of permission groups that are specified to the policy.
    resourceGroups GetUserGroupsResultPolicyResourceGroup[]
    A list of resource groups that the policy applies to.
    access str
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id str
    Policy identifier.
    permission_groups Sequence[GetUserGroupsResultPolicyPermissionGroup]
    A set of permission groups that are specified to the policy.
    resource_groups Sequence[GetUserGroupsResultPolicyResourceGroup]
    A list of resource groups that the policy applies to.
    access String
    Allow or deny operations against the resources. Available values: "allow", "deny".
    id String
    Policy identifier.
    permissionGroups List<Property Map>
    A set of permission groups that are specified to the policy.
    resourceGroups List<Property Map>
    A list of resource groups that the policy applies to.

    GetUserGroupsResultPolicyPermissionGroup

    Id string
    Identifier of the permission group.
    Meta GetUserGroupsResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    Name string
    Name of the permission group.
    Id string
    Identifier of the permission group.
    Meta GetUserGroupsResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    Name string
    Name of the permission group.
    id String
    Identifier of the permission group.
    meta GetUserGroupsResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    name String
    Name of the permission group.
    id string
    Identifier of the permission group.
    meta GetUserGroupsResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    name string
    Name of the permission group.
    id str
    Identifier of the permission group.
    meta GetUserGroupsResultPolicyPermissionGroupMeta
    Attributes associated to the permission group.
    name str
    Name of the permission group.
    id String
    Identifier of the permission group.
    meta Property Map
    Attributes associated to the permission group.
    name String
    Name of the permission group.

    GetUserGroupsResultPolicyPermissionGroupMeta

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    GetUserGroupsResultPolicyResourceGroup

    Id string
    Identifier of the resource group.
    Meta GetUserGroupsResultPolicyResourceGroupMeta
    Attributes associated to the resource group.
    Name string
    Name of the resource group.
    Scopes List<GetUserGroupsResultPolicyResourceGroupScope>
    The scope associated to the resource group
    Id string
    Identifier of the resource group.
    Meta GetUserGroupsResultPolicyResourceGroupMeta
    Attributes associated to the resource group.
    Name string
    Name of the resource group.
    Scopes []GetUserGroupsResultPolicyResourceGroupScope
    The scope associated to the resource group
    id String
    Identifier of the resource group.
    meta GetUserGroupsResultPolicyResourceGroupMeta
    Attributes associated to the resource group.
    name String
    Name of the resource group.
    scopes List<GetUserGroupsResultPolicyResourceGroupScope>
    The scope associated to the resource group
    id string
    Identifier of the resource group.
    meta GetUserGroupsResultPolicyResourceGroupMeta
    Attributes associated to the resource group.
    name string
    Name of the resource group.
    scopes GetUserGroupsResultPolicyResourceGroupScope[]
    The scope associated to the resource group
    id str
    Identifier of the resource group.
    meta GetUserGroupsResultPolicyResourceGroupMeta
    Attributes associated to the resource group.
    name str
    Name of the resource group.
    scopes Sequence[GetUserGroupsResultPolicyResourceGroupScope]
    The scope associated to the resource group
    id String
    Identifier of the resource group.
    meta Property Map
    Attributes associated to the resource group.
    name String
    Name of the resource group.
    scopes List<Property Map>
    The scope associated to the resource group

    GetUserGroupsResultPolicyResourceGroupMeta

    Key string
    Value string
    Key string
    Value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    GetUserGroupsResultPolicyResourceGroupScope

    Key string
    This is a combination of pre-defined resource name and identifier (like Account ID etc.)
    Objects List<GetUserGroupsResultPolicyResourceGroupScopeObject>
    A list of scope objects for additional context.
    Key string
    This is a combination of pre-defined resource name and identifier (like Account ID etc.)
    Objects []GetUserGroupsResultPolicyResourceGroupScopeObject
    A list of scope objects for additional context.
    key String
    This is a combination of pre-defined resource name and identifier (like Account ID etc.)
    objects List<GetUserGroupsResultPolicyResourceGroupScopeObject>
    A list of scope objects for additional context.
    key string
    This is a combination of pre-defined resource name and identifier (like Account ID etc.)
    objects GetUserGroupsResultPolicyResourceGroupScopeObject[]
    A list of scope objects for additional context.
    key str
    This is a combination of pre-defined resource name and identifier (like Account ID etc.)
    objects Sequence[GetUserGroupsResultPolicyResourceGroupScopeObject]
    A list of scope objects for additional context.
    key String
    This is a combination of pre-defined resource name and identifier (like Account ID etc.)
    objects List<Property Map>
    A list of scope objects for additional context.

    GetUserGroupsResultPolicyResourceGroupScopeObject

    Key string
    This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
    Key string
    This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
    key String
    This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
    key string
    This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
    key str
    This is a combination of pre-defined resource name and identifier (like Zone ID etc.)
    key String
    This is a combination of pre-defined resource name and identifier (like Zone ID etc.)

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Viewing docs for Cloudflare v6.15.0
    published on Saturday, May 2, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.