group_resources
Creates, updates, deletes, gets or lists a group_resources resource.
Overview
| Name | group_resources |
| Type | Resource |
| Id | aws.resource_groups.group_resources |
Fields
The following fields are returned by SELECT queries:
- list_group_resources
| Name | Datatype | Description |
|---|---|---|
resource_arn | string | The Amazon resource name (ARN) of a resource. (pattern: <code>arn:aws(-[a-z]+):[a-z0-9-]:([a-z]{2}(-[a-z]+)+-\d{1})?:([0-9]{12})?:.+</code>) |
resource_type | string | The resource type of a resource, such as AWS::EC2::Instance. (pattern: <code>AWS::[a-zA-Z0-9]+::\w+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_group_resources | select | region | Returns a list of Amazon resource names (ARNs) of the resources that are members of a specified resource group. Minimum permissions To run this command, you must have the following permissions: resource-groups:ListGroupResources cloudformation:DescribeStacks cloudformation:ListStackResources tag:GetResources | |
group_resources | exec | region, Group, ResourceArns | Adds the specified resources to the specified group. You can only use this operation with the following groups: AWS::EC2::HostManagement AWS::EC2::CapacityReservationPool AWS::ResourceGroups::ApplicationGroup Other resource group types and resource types are not currently supported by this operation. Minimum permissions To run this command, you must have the following permissions: resource-groups:GroupResources |
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) |
SELECT examples
- list_group_resources
Returns a list of Amazon resource names (ARNs) of the resources that are members of a specified resource group. Minimum permissions To run this command, you must have the following permissions: resource-groups:ListGroupResources cloudformation:DescribeStacks cloudformation:ListStackResources tag:GetResources
SELECT
resource_arn,
resource_type
FROM aws.resource_groups.group_resources
WHERE region = '{{ region }}' -- required
;
Lifecycle Methods
- group_resources
Adds the specified resources to the specified group. You can only use this operation with the following groups: AWS::EC2::HostManagement AWS::EC2::CapacityReservationPool AWS::ResourceGroups::ApplicationGroup Other resource group types and resource types are not currently supported by this operation. Minimum permissions To run this command, you must have the following permissions: resource-groups:GroupResources
EXEC aws.resource_groups.group_resources.group_resources
@region='{{ region }}' --required
@@json=
'{
"Group": "{{ Group }}",
"ResourceArns": "{{ ResourceArns }}"
}'
;