Skip to main content

group_resources

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

Overview

Namegroup_resources
TypeResource
Idaws.resource_groups.group_resources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
resource_arnstringThe 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_typestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
list_group_resourcesselectregionReturns 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_resourcesexecregion, Group, ResourceArnsAdds 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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

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 }}"
}'
;