Skip to content

aws.resource_groups.list_group_resources

Example SQL Queries

SELECT * FROM
aws.resource_groups.list_group_resources;

Description

Returns a list of 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

Table Definition

Column NameColumn Data Type
filters Input Column

Filters, formatted as ResourceFilter objects, that you want to apply to a ListGroupResources operation. Filters the results to include only those of the specified resource types.

  • resource-type - Filter resources by their type. Specify up to five resource types in the format AWS::ServiceCode::ResourceType. For example, AWS::EC2::Instance, or AWS::S3::Bucket.

When you specify a resource-type filter for ListGroupResources, Resource Groups validates your filter resource types against the types that are defined in the query associated with the group. For example, if a group contains only S3 buckets because its query specifies only that resource type, but your resource-type filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, a ListGroupResources request returns a BadRequestException error with a message similar to the following:

The resource types specified as filters in the request are not valid.

The error includes a list of resource types that failed the validation because they are not part of the query associated with the group. This validation doesn't occur when the group query specifies AWS::AllSupported, because a group based on such a query can contain any of the allowed resource types for the query type (tag-based or Amazon CloudFront stack-based queries).

STRUCT(
"name" VARCHAR,
"values" VARCHAR[]
)[]
Show child fields
filters[]
Show child fields
filters[].name

The name of the filter. Filter names are case-sensitive.

filters[].values[]
group Input Column

The name or the ARN of the resource group

VARCHAR
group_name Input Column

Deprecated - don't use this parameter. Use the Group request field instead.

VARCHAR
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
query_errors

A list of QueryError objects. Each error contains an ErrorCode and Message. Possible values for ErrorCode are CLOUDFORMATION_STACK_INACTIVE, CLOUDFORMATION_STACK_NOT_EXISTING, CLOUDFORMATION_STACK_UNASSUMABLE_ROLE and RESOURCE_TYPE_NOT_SUPPORTED.

STRUCT(
"error_code" VARCHAR,
"message" VARCHAR
)[]
Show child fields
query_errors[]
Show child fields
query_errors[].error_code

Specifies the error code that was raised.

query_errors[].message

A message that explains the ErrorCode.

resource_identifiers

Deprecated - don't use this parameter. Use the Resources response field instead.

STRUCT(
"resource_arn" VARCHAR,
"resource_type" VARCHAR
)[]
Show child fields
resource_identifiers[]
Show child fields
resource_identifiers[].resource_arn

The ARN of a resource.

resource_identifiers[].resource_type

The resource type of a resource, such as AWS::EC2::Instance.

resources

An array of resources from which you can determine each resource's identity, type, and group membership status.

STRUCT(
"identifier" STRUCT(
"resource_arn" VARCHAR,
"resource_type" VARCHAR
),
"status" STRUCT(
"name" VARCHAR
)
)[]
Show child fields
resources[]
Show child fields
resources[].identifier

A structure that contains the ARN of a resource and its resource type.

Show child fields
resources[].identifier.resource_arn

The ARN of a resource.

resources[].identifier.resource_type

The resource type of a resource, such as AWS::EC2::Instance.

resources[].status

A structure that contains the status of this resource's membership in the group.

This field is present in the response only if the group is of type AWS::EC2::HostManagement.

Show child fields
resources[].status.name

The current status.