Skip to main content

groups

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

Overview

Namegroups
TypeResource
Idaws.greengrass.groups

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe ARN of the definition.
creation_timestampstringThe time, in milliseconds since the epoch, when the definition was created.
idstringThe ID of the definition.
last_updated_timestampstringThe time, in milliseconds since the epoch, when the definition was last updated.
latest_versionstringThe ID of the latest version associated with the definition.
latest_version_arnstringThe ARN of the latest version associated with the definition.
namestringThe name of the definition.
tagsobjectTag(s) attached to the resource arn.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_groupselectgroup_id, regionRetrieves information about a group.
list_groupsselectregionMaxResults, NextTokenRetrieves a list of groups.
create_groupinsertregionX-Amzn-Client-TokenCreates a group. You may provide the initial version of the group or use ''CreateGroupVersion'' at a later time. Tip: You can use the ''gg_group_setup'' package (https:​//github.com/awslabs/aws-greengrass-group-setup) as a library or command-line application to create and deploy Greengrass groups.
associate_role_to_groupupdategroup_id, region, RoleArnAssociates a role with a group. Your Greengrass core will use the role to access AWS cloud services. The role's permissions should allow Greengrass core Lambda functions to perform actions against the cloud.
update_groupupdategroup_id, regionUpdates a group.
delete_groupdeletegroup_id, regionDeletes a group.
disassociate_role_from_groupexecgroup_id, regionDisassociates the role from a group.

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
group_idstringThe ID of the Greengrass group.
regionstringAWS region (default: us-east-1)
MaxResultsstringThe maximum number of results to be returned per request.
NextTokenstringThe token for the next set of results, or ''null'' if there are no additional results.
X-Amzn-Client-TokenstringA client token used to correlate requests and responses.

SELECT examples

Retrieves information about a group.

SELECT
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name,
tags
FROM aws.greengrass.groups
WHERE group_id = '{{ group_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a group. You may provide the initial version of the group or use ''CreateGroupVersion'' at a later time. Tip: You can use the ''gg_group_setup'' package (https://github.com/awslabs/aws-greengrass-group-setup) as a library or command-line application to create and deploy Greengrass groups.

INSERT INTO aws.greengrass.groups (
InitialVersion,
Name,
tags,
region,
`X-Amzn-Client-Token`
)
SELECT
'{{ InitialVersion }}',
'{{ Name }}',
'{{ tags }}',
'{{ region }}',
'{{ X-Amzn-Client-Token }}'
RETURNING
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name
;

UPDATE examples

Associates a role with a group. Your Greengrass core will use the role to access AWS cloud services. The role's permissions should allow Greengrass core Lambda functions to perform actions against the cloud.

UPDATE aws.greengrass.groups
SET
RoleArn = '{{ RoleArn }}'
WHERE
group_id = '{{ group_id }}' --required
AND region = '{{ region }}' --required
AND RoleArn = '{{ RoleArn }}' --required
RETURNING
associated_at;

DELETE examples

Deletes a group.

DELETE FROM aws.greengrass.groups
WHERE group_id = '{{ group_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Disassociates the role from a group.

EXEC aws.greengrass.groups.disassociate_role_from_group
@group_id='{{ group_id }}' --required,
@region='{{ region }}' --required
;