groups
Creates, updates, deletes, gets or lists a groups resource.
Overview
| Name | groups |
| Type | Resource |
| Id | aws.resource_groups.groups |
Fields
The following fields are returned by SELECT queries:
- get_group
- list_groups
| Name | Datatype | Description |
|---|---|---|
application_tag | object | A tag that defines the application group membership. This tag is only supported for application groups. |
criticality | integer | The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical. |
description | string | The description of the resource group. (pattern: <code>[\sa-zA-Z0-9_.-]*</code>) |
display_name | string | The name of the application group, which you can change at any time. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
group_arn | string | The Amazon resource name (ARN) of the resource group. (pattern: <code>arn:aws(-[a-z]+)*:resource-groups:[a-z]{2}(-[a-z]+)+-\d{1}:[0-9]{12}:group/([a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26})</code>) |
name | string | The name of the resource group. (pattern: <code>[a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26}</code>) |
owner | string | A name, email address or other identifier for the person or group who is considered as the owner of this application group within your organization. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
| Name | Datatype | Description |
|---|---|---|
criticality | integer | The critical rank of the application group on a scale of 1 to 10, with a rank of 1 being the most critical, and a rank of 10 being least critical. |
description | string | The description of the application group. (pattern: <code>[\sa-zA-Z0-9_.-]*</code>) |
display_name | string | The name of the application group, which you can change at any time. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
group_arn | string | The Amazon resource name (ARN) of the resource group. (pattern: <code>arn:aws(-[a-z]+)*:resource-groups:[a-z]{2}(-[a-z]+)+-\d{1}:[0-9]{12}:group/([a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26})</code>) |
group_name | string | The name of the resource group. (pattern: <code>[a-zA-Z0-9_.-]{1,300}|[a-zA-Z0-9_.-]{1,150}/[a-z0-9]{26}</code>) |
owner | string | A name, email address or other identifier for the person or group who is considered as the owner of this group within your organization. (pattern: <code>^([\p{L}\p{Z}\p{N}_.:/=+-@]*)$</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_group | select | region | Returns information about a specified resource group. Minimum permissions To run this command, you must have the following permissions: resource-groups:GetGroup | |
list_groups | select | region | maxResults, nextToken | Returns a list of existing Resource Groups in your account. Minimum permissions To run this command, you must have the following permissions: resource-groups:ListGroups |
create_group | insert | region, Name | Creates a resource group with the specified name and description. You can optionally include either a resource query or a service configuration. For more information about constructing a resource query, see Build queries and groups in Resource Groups in the Resource Groups User Guide. For more information about service-linked groups and service configurations, see Service configurations for Resource Groups. Minimum permissions To run this command, you must have the following permissions: resource-groups:CreateGroup | |
update_group | update | region | Updates the description for an existing group. You cannot update the name of a resource group. Minimum permissions To run this command, you must have the following permissions: resource-groups:UpdateGroup | |
delete_group | delete | region | Deletes the specified resource group. Deleting a resource group does not delete any resources that are members of the group; it only deletes the group structure. Minimum permissions To run this command, you must have the following permissions: resource-groups:DeleteGroup |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
maxResults | integer | The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the NextToken response element is present and has a value (is not null). Include that value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results. |
nextToken | string | The parameter for receiving additional results if you receive a NextToken response in a previous request. A NextToken response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken response to indicate where the output should continue from. |
SELECT examples
- get_group
- list_groups
Returns information about a specified resource group. Minimum permissions To run this command, you must have the following permissions: resource-groups:GetGroup
SELECT
application_tag,
criticality,
description,
display_name,
group_arn,
name,
owner
FROM aws.resource_groups.groups
WHERE region = '{{ region }}' -- required
;
Returns a list of existing Resource Groups in your account. Minimum permissions To run this command, you must have the following permissions: resource-groups:ListGroups
SELECT
criticality,
description,
display_name,
group_arn,
group_name,
owner
FROM aws.resource_groups.groups
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_group
- Manifest
Creates a resource group with the specified name and description. You can optionally include either a resource query or a service configuration. For more information about constructing a resource query, see Build queries and groups in Resource Groups in the Resource Groups User Guide. For more information about service-linked groups and service configurations, see Service configurations for Resource Groups. Minimum permissions To run this command, you must have the following permissions: resource-groups:CreateGroup
INSERT INTO aws.resource_groups.groups (
Name,
Description,
ResourceQuery,
Tags,
Configuration,
Criticality,
Owner,
DisplayName,
region
)
SELECT
'{{ Name }}' /* required */,
'{{ Description }}',
'{{ ResourceQuery }}',
'{{ Tags }}',
'{{ Configuration }}',
{{ Criticality }},
'{{ Owner }}',
'{{ DisplayName }}',
'{{ region }}'
RETURNING
group,
group_configuration,
resource_query,
tags
;
# Description fields are for documentation purposes
- name: groups
props:
- name: region
value: "{{ region }}"
description: Required parameter for the groups resource.
- name: Name
value: "{{ Name }}"
- name: Description
value: "{{ Description }}"
- name: ResourceQuery
description: |
The query you can use to define a resource group or a search for resources. A ResourceQuery specifies both a query Type and a Query string as JSON string objects. See the examples section for example JSON strings. For more information about creating a resource group with a resource query, see Build queries and groups in Resource Groups in the Resource Groups User Guide When you combine all of the elements together into a single string, any double quotes that are embedded inside another double quote pair must be escaped by preceding the embedded double quote with a backslash character (). For example, a complete ResourceQuery parameter must be formatted like the following CLI parameter example: --resource-query '{"Type":"TAG_FILTERS_1_0","Query":"{"ResourceTypeFilters":["AWS::AllSupported"],"TagFilters":[{"Key":"Stage","Values":["Test"]}]}"}' In the preceding example, all of the double quote characters in the value part of the Query element must be escaped because the value itself is surrounded by double quotes. For more information, see Quoting strings in the Command Line Interface User Guide. For the complete list of resource types that you can use in the array value for ResourceTypeFilters, see Resources you can use with Resource Groups and Tag Editor in the Resource Groups User Guide. For example: "ResourceTypeFilters":["AWS::S3::Bucket", "AWS::EC2::Instance"]
value:
Type: "{{ Type }}"
Query: "{{ Query }}"
- name: Tags
value: "{{ Tags }}"
- name: Configuration
value:
- Type: "{{ Type }}"
Parameters: "{{ Parameters }}"
- name: Criticality
value: {{ Criticality }}
- name: Owner
value: "{{ Owner }}"
- name: DisplayName
value: "{{ DisplayName }}"
UPDATE examples
- update_group
Updates the description for an existing group. You cannot update the name of a resource group. Minimum permissions To run this command, you must have the following permissions: resource-groups:UpdateGroup
UPDATE aws.resource_groups.groups
SET
GroupName = '{{ GroupName }}',
Group = '{{ Group }}',
Description = '{{ Description }}',
Criticality = {{ Criticality }},
Owner = '{{ Owner }}',
DisplayName = '{{ DisplayName }}'
WHERE
region = '{{ region }}' --required
RETURNING
group;
DELETE examples
- delete_group
Deletes the specified resource group. Deleting a resource group does not delete any resources that are members of the group; it only deletes the group structure. Minimum permissions To run this command, you must have the following permissions: resource-groups:DeleteGroup
DELETE FROM aws.resource_groups.groups
WHERE region = '{{ region }}' --required
;