user_groups
Creates, updates, deletes, gets or lists a user_groups resource.
Overview
| Name | user_groups |
| Type | Resource |
| Id | cloudflare.iam.user_groups |
Fields
The following fields are returned by SELECT queries:
- get
- list
User Group Details response
| Name | Datatype | Description |
|---|---|---|
id | string | User Group identifier tag. (title: User Group Identifier, example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | Name of the user group. (example: My New User Group) |
created_on | string (date-time) | Timestamp for the creation of the user group (example: 2024-03-01T12:21:02.0000Z) |
modified_on | string (date-time) | Last time the user group was modified. (example: 2024-03-01T12:21:02.0000Z) |
policies | array | Policies attached to the User group (title: User Group Policies) |
List User Group response
| Name | Datatype | Description |
|---|---|---|
id | string | User Group identifier tag. (title: User Group Identifier, example: 023e105f4ecef8ad9ca31a8372d0c353) |
name | string | Name of the user group. (example: My New User Group) |
created_on | string (date-time) | Timestamp for the creation of the user group (example: 2024-03-01T12:21:02.0000Z) |
modified_on | string (date-time) | Last time the user group was modified. (example: 2024-03-01T12:21:02.0000Z) |
policies | array | Policies attached to the User group (title: User Group Policies) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, user_group_id | Get information about a specific user group in an account. | |
list | select | account_id | id, name, fuzzyName, page, per_page, direction | List all the user groups for an account. |
create | insert | account_id, name | Create a new user group under the specified account. | |
update | replace | account_id, user_group_id | Modify an existing user group. | |
delete | delete | account_id, user_group_id | Remove a user group from an account. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
user_group_id | string | |
direction | string | |
fuzzyName | string | |
id | string | ID of the user group to be fetched. |
name | string | |
page | number | |
per_page | number |
SELECT examples
- get
- list
Get information about a specific user group in an account.
SELECT
id,
name,
created_on,
modified_on,
policies
FROM cloudflare.iam.user_groups
WHERE account_id = '{{ account_id }}' -- required
AND user_group_id = '{{ user_group_id }}' -- required
;
List all the user groups for an account.
SELECT
id,
name,
created_on,
modified_on,
policies
FROM cloudflare.iam.user_groups
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}'
AND name = '{{ name }}'
AND fuzzyName = '{{ fuzzyName }}'
AND page = '{{ page }}'
AND per_page = '{{ per_page }}'
AND direction = '{{ direction }}'
;
INSERT examples
- create
- Manifest
Create a new user group under the specified account.
INSERT INTO cloudflare.iam.user_groups (
name,
policies,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ policies }}',
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: user_groups
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the user_groups resource.
- name: name
value: "{{ name }}"
description: |
Name of the User group.
- name: policies
description: |
Policies attached to the User group
value:
- access: "{{ access }}"
permission_groups: "{{ permission_groups }}"
resource_groups: "{{ resource_groups }}"
REPLACE examples
- update
Modify an existing user group.
REPLACE cloudflare.iam.user_groups
SET
name = '{{ name }}',
policies = '{{ policies }}'
WHERE
account_id = '{{ account_id }}' --required
AND user_group_id = '{{ user_group_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Remove a user group from an account.
DELETE FROM cloudflare.iam.user_groups
WHERE account_id = '{{ account_id }}' --required
AND user_group_id = '{{ user_group_id }}' --required
;