Skip to main content

resources

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

Overview

Nameresources
TypeResource
Idaws.resource_groups.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
search_resourcesselectregionReturns a list of Amazon Web Services resource identifiers that matches the specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation. Minimum permissions To run this command, you must have the following permissions: resource-groups:SearchResources cloudformation:DescribeStacks cloudformation:ListStackResources tag:GetResources
ungroup_resourcesexecregion, Group, ResourceArnsRemoves the specified resources from the specified group. This operation works only with static groups that you populated using the GroupResources operation. It doesn't work with any resource groups that are automatically populated by tag-based or CloudFormation stack-based queries. Minimum permissions To run this command, you must have the following permissions: resource-groups:UngroupResources

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 Web Services resource identifiers that matches the specified query. The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery operation. Minimum permissions To run this command, you must have the following permissions: resource-groups:SearchResources cloudformation:DescribeStacks cloudformation:ListStackResources tag:GetResources

SELECT
resource_arn,
resource_type
FROM aws.resource_groups.resources
WHERE region = '{{ region }}' -- required
;

Lifecycle Methods

Removes the specified resources from the specified group. This operation works only with static groups that you populated using the GroupResources operation. It doesn't work with any resource groups that are automatically populated by tag-based or CloudFormation stack-based queries. Minimum permissions To run this command, you must have the following permissions: resource-groups:UngroupResources

EXEC aws.resource_groups.resources.ungroup_resources
@region='{{ region }}' --required
@@json=
'{
"Group": "{{ Group }}",
"ResourceArns": "{{ ResourceArns }}"
}'
;