Skip to main content

resource_groups

Creates, updates, deletes, gets or lists a resource_groups resource.

Overview

Nameresource_groups
TypeResource
Idcloudflare.iam.resource_groups

Fields

The following fields are returned by SELECT queries:

Resource Group Details response

NameDatatypeDescription
idstringIdentifier of the resource group. (example: 6d7f2f5f5b1d4a0e9081fdc98d432fd1)
namestringName of the resource group. (example: com.cloudflare.api.account.eb78d65290b24279ba6f44721b3ea3c4)
metaobjectAttributes associated to the resource group.
scopearrayThe scope associated to the resource group

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectaccount_id, resource_group_idGet information about a specific resource group in an account.
listselectaccount_idid, nameList all the resource groups for an account.
createinsertaccount_id, name, scopeCreate a new Resource Group under the specified account.
updatereplaceaccount_id, resource_group_idModify an existing resource group.
deletedeleteaccount_id, resource_group_idRemove 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
resource_group_idstring
idstring
namestring

SELECT examples

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
;

INSERT examples

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
;

REPLACE examples

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

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
;