resource_groups
Creates, updates, deletes, gets or lists a resource_groups resource.
Overview
| Name | resource_groups |
| Type | Resource |
| Id | cloudflare.iam.resource_groups |
Fields
The following fields are returned by SELECT queries:
- get
- list
Resource Group Details response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier of the resource group. (example: 6d7f2f5f5b1d4a0e9081fdc98d432fd1) |
name | string | Name of the resource group. (example: com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4) |
meta | object | Attributes associated to the resource group. |
scope | array | The scope associated to the resource group |
List Resource Groups response
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier of the resource group. (example: 6d7f2f5f5b1d4a0e9081fdc98d432fd1) |
name | string | Name of the resource group. (example: com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4) |
meta | object | Attributes associated to the resource group. |
scope | array | The scope associated to the resource group |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | account_id, resource_group_id | Get information about a specific resource group in an account. | |
list | select | account_id | id, name | List all the resource groups for an account. |
create | insert | account_id, name, scope | Create a new Resource Group under the specified account. | |
update | replace | account_id, resource_group_id | Modify an existing resource group. | |
delete | delete | account_id, resource_group_id | Remove a resource 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. |
resource_group_id | string | |
id | string | |
name | string |
SELECT examples
- get
- list
Get information about a specific resource group in an account.
SELECT
id,
name,
meta,
scope
FROM cloudflare.iam.resource_groups
WHERE account_id = '{{ account_id }}' -- required
AND resource_group_id = '{{ resource_group_id }}' -- required
;
List all the resource groups for an account.
SELECT
id,
name,
meta,
scope
FROM cloudflare.iam.resource_groups
WHERE account_id = '{{ account_id }}' -- required
AND id = '{{ id }}'
AND name = '{{ name }}'
;
INSERT examples
- create
- Manifest
Create a new Resource Group under the specified account.
INSERT INTO cloudflare.iam.resource_groups (
name,
scope,
account_id
)
SELECT
'{{ name }}' /* required */,
'{{ scope }}' /* required */,
'{{ account_id }}'
RETURNING
errors,
messages,
result,
success
;
# Description fields are for documentation purposes
- name: resource_groups
props:
- name: account_id
value: "{{ account_id }}"
description: Required parameter for the resource_groups resource.
- name: name
value: "{{ name }}"
description: |
Name of the resource group
- name: scope
description: |
A scope is a combination of scope objects which provides additional context.
value:
key: "{{ key }}"
objects:
- key: "{{ key }}"
REPLACE examples
- update
Modify an existing resource group.
REPLACE cloudflare.iam.resource_groups
SET
name = '{{ name }}',
scope = '{{ scope }}'
WHERE
account_id = '{{ account_id }}' --required
AND resource_group_id = '{{ resource_group_id }}' --required
RETURNING
errors,
messages,
result,
success;
DELETE examples
- delete
Remove a resource group from an account.
DELETE FROM cloudflare.iam.resource_groups
WHERE account_id = '{{ account_id }}' --required
AND resource_group_id = '{{ resource_group_id }}' --required
;