resources
Creates, updates, deletes, gets or lists a resources resource.
Overview
| Name | resources |
| Type | Resource |
| Id | aws.resource_groups.resources |
Fields
The following fields are returned by SELECT queries:
- search_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 |
|---|---|---|---|---|
search_resources | select | region | 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 | |
ungroup_resources | exec | region, Group, ResourceArns | 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 |
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
- search_resources
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
- ungroup_resources
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 }}"
}'
;