groups
Creates, updates, deletes, gets or lists a groups resource.
Overview
| Name | groups |
| Type | Resource |
| Id | aws.greengrass.groups |
Fields
The following fields are returned by SELECT queries:
- get_group
- list_groups
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the definition. |
creation_timestamp | string | The time, in milliseconds since the epoch, when the definition was created. |
id | string | The ID of the definition. |
last_updated_timestamp | string | The time, in milliseconds since the epoch, when the definition was last updated. |
latest_version | string | The ID of the latest version associated with the definition. |
latest_version_arn | string | The ARN of the latest version associated with the definition. |
name | string | The name of the definition. |
tags | object | Tag(s) attached to the resource arn. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The ARN of the group. |
creation_timestamp | string | The time, in milliseconds since the epoch, when the group was created. |
id | string | The ID of the group. |
last_updated_timestamp | string | The time, in milliseconds since the epoch, when the group was last updated. |
latest_version | string | The ID of the latest version associated with the group. |
latest_version_arn | string | The ARN of the latest version associated with the group. |
name | string | The name of the group. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_group | select | group_id, region | Retrieves information about a group. | |
list_groups | select | region | MaxResults, NextToken | Retrieves a list of groups. |
create_group | insert | region | X-Amzn-Client-Token | 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. |
associate_role_to_group | update | group_id, region, RoleArn | 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_group | update | group_id, region | Updates a group. | |
delete_group | delete | group_id, region | Deletes a group. | |
disassociate_role_from_group | exec | group_id, region | Disassociates 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.
| Name | Datatype | Description |
|---|---|---|
group_id | string | The ID of the Greengrass group. |
region | string | AWS region (default: us-east-1) |
MaxResults | string | The maximum number of results to be returned per request. |
NextToken | string | The token for the next set of results, or ''null'' if there are no additional results. |
X-Amzn-Client-Token | string | A client token used to correlate requests and responses. |
SELECT examples
- get_group
- list_groups
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
;
Retrieves a list of groups.
SELECT
arn,
creation_timestamp,
id,
last_updated_timestamp,
latest_version,
latest_version_arn,
name
FROM aws.greengrass.groups
WHERE region = '{{ region }}' -- required
AND MaxResults = '{{ MaxResults }}'
AND NextToken = '{{ NextToken }}'
;
INSERT examples
- create_group
- Manifest
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
;
# Description fields are for documentation purposes
- name: groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the groups resource.
- name: InitialVersion
description: |
Information about a group version.
value:
ConnectorDefinitionVersionArn: "{{ ConnectorDefinitionVersionArn }}"
CoreDefinitionVersionArn: "{{ CoreDefinitionVersionArn }}"
DeviceDefinitionVersionArn: "{{ DeviceDefinitionVersionArn }}"
FunctionDefinitionVersionArn: "{{ FunctionDefinitionVersionArn }}"
LoggerDefinitionVersionArn: "{{ LoggerDefinitionVersionArn }}"
ResourceDefinitionVersionArn: "{{ ResourceDefinitionVersionArn }}"
SubscriptionDefinitionVersionArn: "{{ SubscriptionDefinitionVersionArn }}"
- name: Name
value: "{{ Name }}"
- name: tags
value: "{{ tags }}"
description: |
The key-value pair for the resource tag.
- name: X-Amzn-Client-Token
value: "{{ X-Amzn-Client-Token }}"
description: A client token used to correlate requests and responses.
description: A client token used to correlate requests and responses.
UPDATE examples
- associate_role_to_group
- update_group
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;
Updates a group.
UPDATE aws.greengrass.groups
SET
Name = '{{ Name }}'
WHERE
group_id = '{{ group_id }}' --required
AND region = '{{ region }}' --required;
DELETE examples
- delete_group
Deletes a group.
DELETE FROM aws.greengrass.groups
WHERE group_id = '{{ group_id }}' --required
AND region = '{{ region }}' --required
;
Lifecycle Methods
- disassociate_role_from_group
Disassociates the role from a group.
EXEC aws.greengrass.groups.disassociate_role_from_group
@group_id='{{ group_id }}' --required,
@region='{{ region }}' --required
;