published on Saturday, May 2, 2026 by Pulumi
published on Saturday, May 2, 2026 by Pulumi
Accepted Permissions
Account Settings ReadAccount Settings WriteSCIM Provisioning
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleUserGroup = new cloudflare.UserGroup("example_user_group", {
accountId: "023e105f4ecef8ad9ca31a8372d0c353",
name: "My New User Group",
policies: [{
access: "allow",
permissionGroups: [
{
id: "c8fed203ed3043cba015a93ad1616f1f",
},
{
id: "82e64a83756745bbbb1c9c2701bf816b",
},
],
resourceGroups: [{
id: "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
}],
}],
});
import pulumi
import pulumi_cloudflare as cloudflare
example_user_group = cloudflare.UserGroup("example_user_group",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
name="My New User Group",
policies=[{
"access": "allow",
"permission_groups": [
{
"id": "c8fed203ed3043cba015a93ad1616f1f",
},
{
"id": "82e64a83756745bbbb1c9c2701bf816b",
},
],
"resource_groups": [{
"id": "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
}],
}])
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.NewUserGroup(ctx, "example_user_group", &cloudflare.UserGroupArgs{
AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
Name: pulumi.String("My New User Group"),
Policies: cloudflare.UserGroupPolicyArray{
&cloudflare.UserGroupPolicyArgs{
Access: pulumi.String("allow"),
PermissionGroups: cloudflare.UserGroupPolicyPermissionGroupArray{
&cloudflare.UserGroupPolicyPermissionGroupArgs{
Id: pulumi.String("c8fed203ed3043cba015a93ad1616f1f"),
},
&cloudflare.UserGroupPolicyPermissionGroupArgs{
Id: pulumi.String("82e64a83756745bbbb1c9c2701bf816b"),
},
},
ResourceGroups: cloudflare.UserGroupPolicyResourceGroupArray{
&cloudflare.UserGroupPolicyResourceGroupArgs{
Id: pulumi.String("6d7f2f5f5b1d4a0e9081fdc98d432fd1"),
},
},
},
},
})
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 exampleUserGroup = new Cloudflare.Index.UserGroup("example_user_group", new()
{
AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
Name = "My New User Group",
Policies = new[]
{
new Cloudflare.Inputs.UserGroupPolicyArgs
{
Access = "allow",
PermissionGroups = new[]
{
new Cloudflare.Inputs.UserGroupPolicyPermissionGroupArgs
{
Id = "c8fed203ed3043cba015a93ad1616f1f",
},
new Cloudflare.Inputs.UserGroupPolicyPermissionGroupArgs
{
Id = "82e64a83756745bbbb1c9c2701bf816b",
},
},
ResourceGroups = new[]
{
new Cloudflare.Inputs.UserGroupPolicyResourceGroupArgs
{
Id = "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.UserGroup;
import com.pulumi.cloudflare.UserGroupArgs;
import com.pulumi.cloudflare.inputs.UserGroupPolicyArgs;
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) {
var exampleUserGroup = new UserGroup("exampleUserGroup", UserGroupArgs.builder()
.accountId("023e105f4ecef8ad9ca31a8372d0c353")
.name("My New User Group")
.policies(UserGroupPolicyArgs.builder()
.access("allow")
.permissionGroups(
UserGroupPolicyPermissionGroupArgs.builder()
.id("c8fed203ed3043cba015a93ad1616f1f")
.build(),
UserGroupPolicyPermissionGroupArgs.builder()
.id("82e64a83756745bbbb1c9c2701bf816b")
.build())
.resourceGroups(UserGroupPolicyResourceGroupArgs.builder()
.id("6d7f2f5f5b1d4a0e9081fdc98d432fd1")
.build())
.build())
.build());
}
}
resources:
exampleUserGroup:
type: cloudflare:UserGroup
name: example_user_group
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
name: My New User Group
policies:
- access: allow
permissionGroups:
- id: c8fed203ed3043cba015a93ad1616f1f
- id: 82e64a83756745bbbb1c9c2701bf816b
resourceGroups:
- id: 6d7f2f5f5b1d4a0e9081fdc98d432fd1
Create UserGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new UserGroup(name: string, args: UserGroupArgs, opts?: CustomResourceOptions);@overload
def UserGroup(resource_name: str,
args: UserGroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def UserGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
name: Optional[str] = None,
policies: Optional[Sequence[UserGroupPolicyArgs]] = None)func NewUserGroup(ctx *Context, name string, args UserGroupArgs, opts ...ResourceOption) (*UserGroup, error)public UserGroup(string name, UserGroupArgs args, CustomResourceOptions? opts = null)
public UserGroup(String name, UserGroupArgs args)
public UserGroup(String name, UserGroupArgs args, CustomResourceOptions options)
type: cloudflare:UserGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args UserGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args UserGroupArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserGroupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var userGroupResource = new Cloudflare.UserGroup("userGroupResource", new()
{
AccountId = "string",
Name = "string",
Policies = new[]
{
new Cloudflare.Inputs.UserGroupPolicyArgs
{
Access = "string",
PermissionGroups = new[]
{
new Cloudflare.Inputs.UserGroupPolicyPermissionGroupArgs
{
Id = "string",
},
},
ResourceGroups = new[]
{
new Cloudflare.Inputs.UserGroupPolicyResourceGroupArgs
{
Id = "string",
},
},
},
},
});
example, err := cloudflare.NewUserGroup(ctx, "userGroupResource", &cloudflare.UserGroupArgs{
AccountId: pulumi.String("string"),
Name: pulumi.String("string"),
Policies: cloudflare.UserGroupPolicyArray{
&cloudflare.UserGroupPolicyArgs{
Access: pulumi.String("string"),
PermissionGroups: cloudflare.UserGroupPolicyPermissionGroupArray{
&cloudflare.UserGroupPolicyPermissionGroupArgs{
Id: pulumi.String("string"),
},
},
ResourceGroups: cloudflare.UserGroupPolicyResourceGroupArray{
&cloudflare.UserGroupPolicyResourceGroupArgs{
Id: pulumi.String("string"),
},
},
},
},
})
var userGroupResource = new UserGroup("userGroupResource", UserGroupArgs.builder()
.accountId("string")
.name("string")
.policies(UserGroupPolicyArgs.builder()
.access("string")
.permissionGroups(UserGroupPolicyPermissionGroupArgs.builder()
.id("string")
.build())
.resourceGroups(UserGroupPolicyResourceGroupArgs.builder()
.id("string")
.build())
.build())
.build());
user_group_resource = cloudflare.UserGroup("userGroupResource",
account_id="string",
name="string",
policies=[{
"access": "string",
"permission_groups": [{
"id": "string",
}],
"resource_groups": [{
"id": "string",
}],
}])
const userGroupResource = new cloudflare.UserGroup("userGroupResource", {
accountId: "string",
name: "string",
policies: [{
access: "string",
permissionGroups: [{
id: "string",
}],
resourceGroups: [{
id: "string",
}],
}],
});
type: cloudflare:UserGroup
properties:
accountId: string
name: string
policies:
- access: string
permissionGroups:
- id: string
resourceGroups:
- id: string
UserGroup Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The UserGroup resource accepts the following input properties:
- Account
Id string - Account identifier tag.
- Name string
- Name of the User group.
- Policies
List<User
Group Policy> - Policies attached to the User group
- Account
Id string - Account identifier tag.
- Name string
- Name of the User group.
- Policies
[]User
Group Policy Args - Policies attached to the User group
- account
Id String - Account identifier tag.
- name String
- Name of the User group.
- policies
List<User
Group Policy> - Policies attached to the User group
- account
Id string - Account identifier tag.
- name string
- Name of the User group.
- policies
User
Group Policy[] - Policies attached to the User group
- account_
id str - Account identifier tag.
- name str
- Name of the User group.
- policies
Sequence[User
Group Policy Args] - Policies attached to the User group
- account
Id String - Account identifier tag.
- name String
- Name of the User group.
- policies List<Property Map>
- Policies attached to the User group
Outputs
All input properties are implicitly available as output properties. Additionally, the UserGroup resource produces the following output properties:
- Created
On string - Timestamp for the creation of the user group
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - Last time the user group was modified.
- Created
On string - Timestamp for the creation of the user group
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - Last time the user group was modified.
- created
On String - Timestamp for the creation of the user group
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - Last time the user group was modified.
- created
On string - Timestamp for the creation of the user group
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On string - Last time the user group was modified.
- created_
on str - Timestamp for the creation of the user group
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
on str - Last time the user group was modified.
- created
On String - Timestamp for the creation of the user group
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - Last time the user group was modified.
Look up Existing UserGroup Resource
Get an existing UserGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserGroupState, opts?: CustomResourceOptions): UserGroup@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
created_on: Optional[str] = None,
modified_on: Optional[str] = None,
name: Optional[str] = None,
policies: Optional[Sequence[UserGroupPolicyArgs]] = None) -> UserGroupfunc GetUserGroup(ctx *Context, name string, id IDInput, state *UserGroupState, opts ...ResourceOption) (*UserGroup, error)public static UserGroup Get(string name, Input<string> id, UserGroupState? state, CustomResourceOptions? opts = null)public static UserGroup get(String name, Output<String> id, UserGroupState state, CustomResourceOptions options)resources: _: type: cloudflare:UserGroup get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Account
Id string - Account identifier tag.
- Created
On string - Timestamp for the creation of the user group
- Modified
On string - Last time the user group was modified.
- Name string
- Name of the User group.
- Policies
List<User
Group Policy> - Policies attached to the User group
- Account
Id string - Account identifier tag.
- Created
On string - Timestamp for the creation of the user group
- Modified
On string - Last time the user group was modified.
- Name string
- Name of the User group.
- Policies
[]User
Group Policy Args - Policies attached to the User group
- account
Id String - Account identifier tag.
- created
On String - Timestamp for the creation of the user group
- modified
On String - Last time the user group was modified.
- name String
- Name of the User group.
- policies
List<User
Group Policy> - Policies attached to the User group
- account
Id string - Account identifier tag.
- created
On string - Timestamp for the creation of the user group
- modified
On string - Last time the user group was modified.
- name string
- Name of the User group.
- policies
User
Group Policy[] - Policies attached to the User group
- account_
id str - Account identifier tag.
- created_
on str - Timestamp for the creation of the user group
- modified_
on str - Last time the user group was modified.
- name str
- Name of the User group.
- policies
Sequence[User
Group Policy Args] - Policies attached to the User group
- account
Id String - Account identifier tag.
- created
On String - Timestamp for the creation of the user group
- modified
On 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
Supporting Types
UserGroupPolicy, UserGroupPolicyArgs
- Access string
- Allow or deny operations against the resources. Available values: "allow", "deny".
- Permission
Groups List<UserGroup Policy Permission Group> - A set of permission groups that are specified to the policy.
- Resource
Groups List<UserGroup Policy Resource Group> - A set of resource groups that are specified to the policy.
- Access string
- Allow or deny operations against the resources. Available values: "allow", "deny".
- Permission
Groups []UserGroup Policy Permission Group - A set of permission groups that are specified to the policy.
- Resource
Groups []UserGroup Policy Resource Group - A set of resource groups that are specified to the policy.
- access String
- Allow or deny operations against the resources. Available values: "allow", "deny".
- permission
Groups List<UserGroup Policy Permission Group> - A set of permission groups that are specified to the policy.
- resource
Groups List<UserGroup Policy Resource Group> - A set of resource groups that are specified to the policy.
- access string
- Allow or deny operations against the resources. Available values: "allow", "deny".
- permission
Groups UserGroup Policy Permission Group[] - A set of permission groups that are specified to the policy.
- resource
Groups UserGroup Policy Resource Group[] - A set of resource groups that are specified to the policy.
- access str
- Allow or deny operations against the resources. Available values: "allow", "deny".
- permission_
groups Sequence[UserGroup Policy Permission Group] - A set of permission groups that are specified to the policy.
- resource_
groups Sequence[UserGroup Policy Resource Group] - A set of resource groups that are specified to the policy.
- access String
- Allow or deny operations against the resources. Available values: "allow", "deny".
- permission
Groups List<Property Map> - A set of permission groups that are specified to the policy.
- resource
Groups List<Property Map> - A set of resource groups that are specified to the policy.
UserGroupPolicyPermissionGroup, UserGroupPolicyPermissionGroupArgs
- Id string
- Permission Group identifier tag.
- Id string
- Permission Group identifier tag.
- id String
- Permission Group identifier tag.
- id string
- Permission Group identifier tag.
- id str
- Permission Group identifier tag.
- id String
- Permission Group identifier tag.
UserGroupPolicyResourceGroup, UserGroupPolicyResourceGroupArgs
- Id string
- Resource Group identifier tag.
- Id string
- Resource Group identifier tag.
- id String
- Resource Group identifier tag.
- id string
- Resource Group identifier tag.
- id str
- Resource Group identifier tag.
- id String
- Resource Group identifier tag.
Import
$ pulumi import cloudflare:index/userGroup:UserGroup example '<account_id>/<user_group_id>'
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Cloudflare pulumi/pulumi-cloudflare
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
cloudflareTerraform Provider.
published on Saturday, May 2, 2026 by Pulumi
