Table of Contents
ResourceGroups.
Client
¶A low-level client representing AWS Resource Groups
AWS Resource Groups lets you organize AWS resources such as Amazon EC2 instances, Amazon Relational Database Service databases, and Amazon S3 buckets into groups using criteria that you define as tags. A resource group is a collection of resources that match the resource types specified in a query, and share one or more tags or portions of tags. You can create a group of resources based on their roles in your cloud infrastructure, lifecycle stages, regions, application layers, or virtually any criteria. Resource Groups enable you to automate management tasks, such as those in AWS Systems Manager Automation documents, on tag-related resources in AWS Systems Manager. Groups of tagged resources also let you quickly view a custom console in AWS Systems Manager that shows AWS Config compliance and other monitoring data about member resources.
To create a resource group, build a resource query, and specify tags that identify the criteria that members of the group have in common. Tags are key-value pairs.
For more information about Resource Groups, see the AWS Resource Groups User Guide .
AWS Resource Groups uses a REST-compliant API that you can use to perform the following types of operations.
import boto3
client = boto3.client('resource-groups')
These are the available methods:
can_paginate()
close()
create_group()
delete_group()
get_group()
get_group_configuration()
get_group_query()
get_paginator()
get_tags()
get_waiter()
group_resources()
list_group_resources()
list_groups()
put_group_configuration()
search_resources()
tag()
ungroup_resources()
untag()
update_group()
update_group_query()
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
create_group
(**kwargs)¶Creates a resource group with the specified name and description. You can optionally include a resource query, or a service configuration. For more information about constructing a resource query, see Create a tag-based group in Resource Groups . For more information about service configurations, see Service configurations for resource groups .
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:CreateGroup
See also: AWS API Documentation
Request Syntax
response = client.create_group(
Name='string',
Description='string',
ResourceQuery={
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
},
Tags={
'string': 'string'
},
Configuration=[
{
'Type': 'string',
'Parameters': [
{
'Name': 'string',
'Values': [
'string',
]
},
]
},
]
)
[REQUIRED]
The name of the group, which is the identifier of the group in other operations. You can't change the name of a resource group after you create it. A resource group name can consist of letters, numbers, hyphens, periods, and underscores. The name cannot start with AWS
or aws
; these are reserved. A resource group name must be unique within each AWS Region in your AWS account.
The resource query that determines which AWS resources are members of this group. For more information about resource queries, see Create a tag-based group in Resource Groups .
Note
A resource group can contain either a ResourceQuery
or a Configuration
, but not both.
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
The query that defines a group or a search.
The tags to add to the group. A tag is key-value pair string.
A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of GroupConfigurationItem elements. For details about the syntax of service configurations, see Service configurations for resource groups .
Note
A resource group can contain either a Configuration
or a ResourceQuery
, but not both.
An item in a group configuration. A group service configuration can have one or more items. For details about group service configuration syntax, see Service configurations for resource groups .
Specifies the type of group configuration item. Each item must have a unique value for type
. For the list of types that you can specify for a configuration item, see Supported resource types and parameters .
A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups .
The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters .
dict
Response Syntax
{
'Group': {
'GroupArn': 'string',
'Name': 'string',
'Description': 'string'
},
'ResourceQuery': {
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
},
'Tags': {
'string': 'string'
},
'GroupConfiguration': {
'Configuration': [
{
'Type': 'string',
'Parameters': [
{
'Name': 'string',
'Values': [
'string',
]
},
]
},
],
'ProposedConfiguration': [
{
'Type': 'string',
'Parameters': [
{
'Name': 'string',
'Values': [
'string',
]
},
]
},
],
'Status': 'UPDATING'|'UPDATE_COMPLETE'|'UPDATE_FAILED',
'FailureReason': 'string'
}
}
Response Structure
(dict) --
Group (dict) --
The description of the resource group.
GroupArn (string) --
The ARN of the resource group.
Name (string) --
The name of the resource group.
Description (string) --
The description of the resource group.
ResourceQuery (dict) --
The resource query associated with the group. For more information about resource queries, see Create a tag-based group in Resource Groups .
Type (string) --
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
Query (string) --
The query that defines a group or a search.
Tags (dict) --
The tags associated with the group.
GroupConfiguration (dict) --
The service configuration associated with the resource group. For details about the syntax of a service configuration, see Service configurations for resource groups .
Configuration (list) --
The configuration currently associated with the group and in effect.
(dict) --
An item in a group configuration. A group service configuration can have one or more items. For details about group service configuration syntax, see Service configurations for resource groups .
Type (string) --
Specifies the type of group configuration item. Each item must have a unique value for type
. For the list of types that you can specify for a configuration item, see Supported resource types and parameters .
Parameters (list) --
A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
(dict) --
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups .
Name (string) --
The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
Values (list) --
The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters .
ProposedConfiguration (list) --
If present, the new configuration that is in the process of being applied to the group.
(dict) --
An item in a group configuration. A group service configuration can have one or more items. For details about group service configuration syntax, see Service configurations for resource groups .
Type (string) --
Specifies the type of group configuration item. Each item must have a unique value for type
. For the list of types that you can specify for a configuration item, see Supported resource types and parameters .
Parameters (list) --
A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
(dict) --
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups .
Name (string) --
The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
Values (list) --
The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters .
Status (string) --
The current status of an attempt to update the group configuration.
FailureReason (string) --
If present, the reason why a request to update the group configuration failed.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
delete_group
(**kwargs)¶Deletes the specified resource group. Deleting a resource group does not delete any resources that are members of the group; it only deletes the group structure.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:DeleteGroup
See also: AWS API Documentation
Request Syntax
response = client.delete_group(
GroupName='string',
Group='string'
)
Group
instead.dict
Response Syntax
{
'Group': {
'GroupArn': 'string',
'Name': 'string',
'Description': 'string'
}
}
Response Structure
(dict) --
Group (dict) --
A full description of the deleted resource group.
GroupArn (string) --
The ARN of the resource group.
Name (string) --
The name of the resource group.
Description (string) --
The description of the resource group.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
get_group
(**kwargs)¶Returns information about a specified resource group.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:GetGroup
See also: AWS API Documentation
Request Syntax
response = client.get_group(
GroupName='string',
Group='string'
)
Group
instead.dict
Response Syntax
{
'Group': {
'GroupArn': 'string',
'Name': 'string',
'Description': 'string'
}
}
Response Structure
(dict) --
Group (dict) --
A full description of the resource group.
GroupArn (string) --
The ARN of the resource group.
Name (string) --
The name of the resource group.
Description (string) --
The description of the resource group.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
get_group_configuration
(**kwargs)¶Returns the service configuration associated with the specified resource group. For details about the service configuration syntax, see Service configurations for resource groups .
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:GetGroupConfiguration
See also: AWS API Documentation
Request Syntax
response = client.get_group_configuration(
Group='string'
)
{
'GroupConfiguration': {
'Configuration': [
{
'Type': 'string',
'Parameters': [
{
'Name': 'string',
'Values': [
'string',
]
},
]
},
],
'ProposedConfiguration': [
{
'Type': 'string',
'Parameters': [
{
'Name': 'string',
'Values': [
'string',
]
},
]
},
],
'Status': 'UPDATING'|'UPDATE_COMPLETE'|'UPDATE_FAILED',
'FailureReason': 'string'
}
}
Response Structure
The service configuration associated with the specified group. For details about the service configuration syntax, see Service configurations for resource groups .
The configuration currently associated with the group and in effect.
An item in a group configuration. A group service configuration can have one or more items. For details about group service configuration syntax, see Service configurations for resource groups .
Specifies the type of group configuration item. Each item must have a unique value for type
. For the list of types that you can specify for a configuration item, see Supported resource types and parameters .
A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups .
The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters .
If present, the new configuration that is in the process of being applied to the group.
An item in a group configuration. A group service configuration can have one or more items. For details about group service configuration syntax, see Service configurations for resource groups .
Specifies the type of group configuration item. Each item must have a unique value for type
. For the list of types that you can specify for a configuration item, see Supported resource types and parameters .
A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups .
The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters .
The current status of an attempt to update the group configuration.
If present, the reason why a request to update the group configuration failed.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
get_group_query
(**kwargs)¶Retrieves the resource query associated with the specified resource group. For more information about resource queries, see Create a tag-based group in Resource Groups .
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:GetGroupQuery
See also: AWS API Documentation
Request Syntax
response = client.get_group_query(
GroupName='string',
Group='string'
)
Group
instead.dict
Response Syntax
{
'GroupQuery': {
'GroupName': 'string',
'ResourceQuery': {
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
}
}
}
Response Structure
(dict) --
GroupQuery (dict) --
The resource query associated with the specified group. For more information about resource queries, see Create a tag-based group in Resource Groups .
GroupName (string) --
The name of the resource group that is associated with the specified resource query.
ResourceQuery (dict) --
The resource query that determines which AWS resources are members of the associated resource group.
Type (string) --
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
Query (string) --
The query that defines a group or a search.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.Returns a list of tags that are associated with a resource group, specified by an ARN.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:GetTags
See also: AWS API Documentation
Request Syntax
response = client.get_tags(
Arn='string'
)
[REQUIRED]
The ARN of the resource group whose tags you want to retrieve.
{
'Arn': 'string',
'Tags': {
'string': 'string'
}
}
Response Structure
The ARN of the tagged resource group.
The tags associated with the specified resource group.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
group_resources
(**kwargs)¶Adds the specified resources to the specified group.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:GroupResources
See also: AWS API Documentation
Request Syntax
response = client.group_resources(
Group='string',
ResourceArns=[
'string',
]
)
[REQUIRED]
The name or the ARN of the resource group to add resources to.
[REQUIRED]
The list of ARNs for resources to be added to the group.
dict
Response Syntax
{
'Succeeded': [
'string',
],
'Failed': [
{
'ResourceArn': 'string',
'ErrorMessage': 'string',
'ErrorCode': 'string'
},
],
'Pending': [
{
'ResourceArn': 'string'
},
]
}
Response Structure
(dict) --
Succeeded (list) --
A list of ARNs of resources that were successfully added to the group by this operation.
Failed (list) --
A list of ARNs of any resources that failed to be added to the group by this operation.
(dict) --
A resource that failed to be added to or removed from a group.
ResourceArn (string) --
The ARN of the resource that failed to be added or removed.
ErrorMessage (string) --
The error message text associated with the failure.
ErrorCode (string) --
The error code associated with the failure.
Pending (list) --
A list of ARNs of any resources that are still in the process of being added to the group by this operation. These pending additions continue asynchronously. You can check the status of pending additions by using the `` ListGroupResources `` operation, and checking the Resources
array in the response and the Status
field of each object in that array.
(dict) --
A structure that identifies a resource that is currently pending addition to the group as a member. Adding a resource to a resource group happens asynchronously as a background task and this one isn't completed yet.
ResourceArn (string) --
The Amazon resource name (ARN) of the resource that's in a pending state.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
list_group_resources
(**kwargs)¶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
See also: AWS API Documentation
Request Syntax
response = client.list_group_resources(
GroupName='string',
Group='string',
Filters=[
{
'Name': 'resource-type',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
Warning
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
, AWS 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 AWS CloudFormation stack-based queries).
A filter name and value pair that is used to obtain more specific results from a list of resources.
The name of the filter. Filter names are case-sensitive.
One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.
NextToken
response element is present and has a value (is not null). Include that value as the NextToken
request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken
after every operation to ensure that you receive all of the results.NextToken
response in a previous request. A NextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken
response to indicate where the output should continue from.dict
Response Syntax
{
'Resources': [
{
'Identifier': {
'ResourceArn': 'string',
'ResourceType': 'string'
},
'Status': {
'Name': 'PENDING'
}
},
],
'ResourceIdentifiers': [
{
'ResourceArn': 'string',
'ResourceType': 'string'
},
],
'NextToken': 'string',
'QueryErrors': [
{
'ErrorCode': 'CLOUDFORMATION_STACK_INACTIVE'|'CLOUDFORMATION_STACK_NOT_EXISTING',
'Message': 'string'
},
]
}
Response Structure
(dict) --
Resources (list) --
An array of resources from which you can determine each resource's identity, type, and group membership status.
(dict) --
A structure returned by the ListGroupResources operation that contains identity and group membership status information for one of the resources in the group.
Identifier (dict) --
A structure that contains the ARN of a resource and its resource type.
ResourceArn (string) --
The ARN of a resource.
ResourceType (string) --
The resource type of a resource, such as AWS::EC2::Instance
.
Status (dict) --
A structure that contains the status of this resource's membership in the group.
Note
This field is present in the response only if the group is of type AWS::EC2::HostManagement
.
Name (string) --
The current status.
ResourceIdentifiers (list) --
Warning
** Deprecated - don't use this parameter. Use the ``Resources`` response field instead. **
(dict) --
A structure that contains the ARN of a resource and its resource type.
ResourceArn (string) --
The ARN of a resource.
ResourceType (string) --
The resource type of a resource, such as AWS::EC2::Instance
.
NextToken (string) --
If present, indicates that more output is available than is included in the current response. Use this value in the NextToken
request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken
response element comes back as null
.
QueryErrors (list) --
A list of QueryError
objects. Each error is an object that contains ErrorCode
and Message
structures. Possible values for ErrorCode
are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
(dict) --
A two-part error structure that can occur in ListGroupResources
or SearchResources
operations on CloudFormation stack-based queries. The error occurs if the CloudFormation stack on which the query is based either does not exist, or has a status that renders the stack inactive. A QueryError
occurrence does not necessarily mean that AWS Resource Groups could not complete the operation, but the resulting group might have no member resources.
ErrorCode (string) --
Possible values are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
Message (string) --
A message that explains the ErrorCode
value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE
, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED
.
Exceptions
ResourceGroups.Client.exceptions.UnauthorizedException
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
list_groups
(**kwargs)¶Returns a list of existing resource groups in your account.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:ListGroups
See also: AWS API Documentation
Request Syntax
response = client.list_groups(
Filters=[
{
'Name': 'resource-type'|'configuration-type',
'Values': [
'string',
]
},
],
MaxResults=123,
NextToken='string'
)
Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups
operation.
resource-type
- Filter the results to include only those of the specified resource types. Specify up to five resource types in the format AWS::*ServiceCode* ::*ResourceType* `` . For example, ``AWS::EC2::Instance
, or AWS::S3::Bucket
.configuration-type
- Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:AWS:EC2::CapacityReservationPool
AWS:EC2::HostManagement
A filter collection that you can use to restrict the results from a List
operation to only those you want to include.
The name of the filter. Filter names are case-sensitive.
One or more filter values. Allowed filter values vary by group filter name, and are case-sensitive.
NextToken
response element is present and has a value (is not null). Include that value as the NextToken
request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken
after every operation to ensure that you receive all of the results.NextToken
response in a previous request. A NextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken
response to indicate where the output should continue from.dict
Response Syntax
{
'GroupIdentifiers': [
{
'GroupName': 'string',
'GroupArn': 'string'
},
],
'Groups': [
{
'GroupArn': 'string',
'Name': 'string',
'Description': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
GroupIdentifiers (list) --
A list of GroupIdentifier objects. Each identifier is an object that contains both the Name
and the GroupArn
.
(dict) --
The unique identifiers for a resource group.
GroupName (string) --
The name of the resource group.
GroupArn (string) --
The ARN of the resource group.
Groups (list) --
Warning
(dict) --
A resource group that contains AWS resources. You can assign resources to the group by associating either of the following elements with the group:
GroupArn (string) --
The ARN of the resource group.
Name (string) --
The name of the resource group.
Description (string) --
The description of the resource group.
NextToken (string) --
If present, indicates that more output is available than is included in the current response. Use this value in the NextToken
request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken
response element comes back as null
.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
put_group_configuration
(**kwargs)¶Attaches a service configuration to the specified group. This occurs asynchronously, and can take time to complete. You can use GetGroupConfiguration to check the status of the update.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:PutGroupConfiguration
See also: AWS API Documentation
Request Syntax
response = client.put_group_configuration(
Group='string',
Configuration=[
{
'Type': 'string',
'Parameters': [
{
'Name': 'string',
'Values': [
'string',
]
},
]
},
]
)
The new configuration to associate with the specified group. A configuration associates the resource group with an AWS service and specifies how the service can interact with the resources in the group. A configuration is an array of GroupConfigurationItem elements.
For information about the syntax of a service configuration, see Service configurations for resource groups .
Note
A resource group can contain either a Configuration
or a ResourceQuery
, but not both.
An item in a group configuration. A group service configuration can have one or more items. For details about group service configuration syntax, see Service configurations for resource groups .
Specifies the type of group configuration item. Each item must have a unique value for type
. For the list of types that you can specify for a configuration item, see Supported resource types and parameters .
A collection of parameters for this group configuration item. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups .
The name of the group configuration parameter. For the list of parameters that you can use with each configuration item type, see Supported resource types and parameters .
The value or values to be used for the specified parameter. For the list of values you can use with each parameter, see Supported resource types and parameters .
dict
Response Syntax
{}
Response Structure
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
search_resources
(**kwargs)¶Returns a list of AWS 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
See also: AWS API Documentation
Request Syntax
response = client.search_resources(
ResourceQuery={
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
},
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The search query, using the same formats that are supported for resource group definition. For more information, see CreateGroup .
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
The query that defines a group or a search.
NextToken
response element is present and has a value (is not null). Include that value as the NextToken
request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken
after every operation to ensure that you receive all of the results.NextToken
response in a previous request. A NextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call's NextToken
response to indicate where the output should continue from.dict
Response Syntax
{
'ResourceIdentifiers': [
{
'ResourceArn': 'string',
'ResourceType': 'string'
},
],
'NextToken': 'string',
'QueryErrors': [
{
'ErrorCode': 'CLOUDFORMATION_STACK_INACTIVE'|'CLOUDFORMATION_STACK_NOT_EXISTING',
'Message': 'string'
},
]
}
Response Structure
(dict) --
ResourceIdentifiers (list) --
The ARNs and resource types of resources that are members of the group that you specified.
(dict) --
A structure that contains the ARN of a resource and its resource type.
ResourceArn (string) --
The ARN of a resource.
ResourceType (string) --
The resource type of a resource, such as AWS::EC2::Instance
.
NextToken (string) --
If present, indicates that more output is available than is included in the current response. Use this value in the NextToken
request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken
response element comes back as null
.
QueryErrors (list) --
A list of QueryError
objects. Each error is an object that contains ErrorCode
and Message
structures. Possible values for ErrorCode
are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
(dict) --
A two-part error structure that can occur in ListGroupResources
or SearchResources
operations on CloudFormation stack-based queries. The error occurs if the CloudFormation stack on which the query is based either does not exist, or has a status that renders the stack inactive. A QueryError
occurrence does not necessarily mean that AWS Resource Groups could not complete the operation, but the resulting group might have no member resources.
ErrorCode (string) --
Possible values are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
Message (string) --
A message that explains the ErrorCode
value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE
, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED
.
Exceptions
ResourceGroups.Client.exceptions.UnauthorizedException
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
tag
(**kwargs)¶Adds tags to a resource group with the specified ARN. Existing tags on a resource group are not changed if they are not specified in the request parameters.
Warning
Do not store personally identifiable information (PII) or other confidential or sensitive information in tags. We use tags to provide you with billing and administration services. Tags are not intended to be used for private or sensitive data.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:Tag
See also: AWS API Documentation
Request Syntax
response = client.tag(
Arn='string',
Tags={
'string': 'string'
}
)
[REQUIRED]
The ARN of the resource group to which to add tags.
[REQUIRED]
The tags to add to the specified resource group. A tag is a string-to-string map of key-value pairs.
dict
Response Syntax
{
'Arn': 'string',
'Tags': {
'string': 'string'
}
}
Response Structure
(dict) --
Arn (string) --
The ARN of the tagged resource.
Tags (dict) --
The tags that have been added to the specified resource group.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
ungroup_resources
(**kwargs)¶Removes the specified resources from the specified group.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:UngroupResources
See also: AWS API Documentation
Request Syntax
response = client.ungroup_resources(
Group='string',
ResourceArns=[
'string',
]
)
[REQUIRED]
The name or the ARN of the resource group from which to remove the resources.
[REQUIRED]
The ARNs of the resources to be removed from the group.
dict
Response Syntax
{
'Succeeded': [
'string',
],
'Failed': [
{
'ResourceArn': 'string',
'ErrorMessage': 'string',
'ErrorCode': 'string'
},
],
'Pending': [
{
'ResourceArn': 'string'
},
]
}
Response Structure
(dict) --
Succeeded (list) --
A list of resources that were successfully removed from the group by this operation.
Failed (list) --
A list of any resources that failed to be removed from the group by this operation.
(dict) --
A resource that failed to be added to or removed from a group.
ResourceArn (string) --
The ARN of the resource that failed to be added or removed.
ErrorMessage (string) --
The error message text associated with the failure.
ErrorCode (string) --
The error code associated with the failure.
Pending (list) --
A list of any resources that are still in the process of being removed from the group by this operation. These pending removals continue asynchronously. You can check the status of pending removals by using the `` ListGroupResources `` operation. After the resource is successfully removed, it no longer appears in the response.
(dict) --
A structure that identifies a resource that is currently pending addition to the group as a member. Adding a resource to a resource group happens asynchronously as a background task and this one isn't completed yet.
ResourceArn (string) --
The Amazon resource name (ARN) of the resource that's in a pending state.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
untag
(**kwargs)¶Deletes tags from a specified resource group.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:Untag
See also: AWS API Documentation
Request Syntax
response = client.untag(
Arn='string',
Keys=[
'string',
]
)
[REQUIRED]
The ARN of the resource group from which to remove tags. The command removed both the specified keys and any values associated with those keys.
[REQUIRED]
The keys of the tags to be removed.
dict
Response Syntax
{
'Arn': 'string',
'Keys': [
'string',
]
}
Response Structure
(dict) --
Arn (string) --
The ARN of the resource group from which tags have been removed.
Keys (list) --
The keys of the tags that were removed.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
update_group
(**kwargs)¶Updates the description for an existing group. You cannot update the name of a resource group.
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:UpdateGroup
See also: AWS API Documentation
Request Syntax
response = client.update_group(
GroupName='string',
Group='string',
Description='string'
)
Group
instead.dict
Response Syntax
{
'Group': {
'GroupArn': 'string',
'Name': 'string',
'Description': 'string'
}
}
Response Structure
(dict) --
Group (dict) --
The update description of the resource group.
GroupArn (string) --
The ARN of the resource group.
Name (string) --
The name of the resource group.
Description (string) --
The description of the resource group.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
update_group_query
(**kwargs)¶Updates the resource query of a group. For more information about resource queries, see Create a tag-based group in Resource Groups .
Minimum permissions
To run this command, you must have the following permissions:
resource-groups:UpdateGroupQuery
See also: AWS API Documentation
Request Syntax
response = client.update_group_query(
GroupName='string',
Group='string',
ResourceQuery={
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
}
)
Group
instead.[REQUIRED]
The resource query to determine which AWS resources are members of this resource group.
Note
A resource group can contain either a Configuration
or a ResourceQuery
, but not both.
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
The query that defines a group or a search.
dict
Response Syntax
{
'GroupQuery': {
'GroupName': 'string',
'ResourceQuery': {
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
}
}
}
Response Structure
(dict) --
GroupQuery (dict) --
The updated resource query associated with the resource group after the update.
GroupName (string) --
The name of the resource group that is associated with the specified resource query.
ResourceQuery (dict) --
The resource query that determines which AWS resources are members of the associated resource group.
Type (string) --
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
Query (string) --
The query that defines a group or a search.
Exceptions
ResourceGroups.Client.exceptions.BadRequestException
ResourceGroups.Client.exceptions.ForbiddenException
ResourceGroups.Client.exceptions.NotFoundException
ResourceGroups.Client.exceptions.MethodNotAllowedException
ResourceGroups.Client.exceptions.TooManyRequestsException
ResourceGroups.Client.exceptions.InternalServerErrorException
The available paginators are:
ResourceGroups.Paginator.ListGroupResources
ResourceGroups.Paginator.ListGroups
ResourceGroups.Paginator.SearchResources
ResourceGroups.Paginator.
ListGroupResources
¶paginator = client.get_paginator('list_group_resources')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from ResourceGroups.Client.list_group_resources()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
GroupName='string',
Group='string',
Filters=[
{
'Name': 'resource-type',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Warning
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
, AWS 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 AWS CloudFormation stack-based queries).
A filter name and value pair that is used to obtain more specific results from a list of resources.
The name of the filter. Filter names are case-sensitive.
One or more filter values. Allowed filter values vary by resource filter name, and are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'Resources': [
{
'Identifier': {
'ResourceArn': 'string',
'ResourceType': 'string'
},
'Status': {
'Name': 'PENDING'
}
},
],
'ResourceIdentifiers': [
{
'ResourceArn': 'string',
'ResourceType': 'string'
},
],
'QueryErrors': [
{
'ErrorCode': 'CLOUDFORMATION_STACK_INACTIVE'|'CLOUDFORMATION_STACK_NOT_EXISTING',
'Message': 'string'
},
]
}
Response Structure
(dict) --
Resources (list) --
An array of resources from which you can determine each resource's identity, type, and group membership status.
(dict) --
A structure returned by the ListGroupResources operation that contains identity and group membership status information for one of the resources in the group.
Identifier (dict) --
A structure that contains the ARN of a resource and its resource type.
ResourceArn (string) --
The ARN of a resource.
ResourceType (string) --
The resource type of a resource, such as AWS::EC2::Instance
.
Status (dict) --
A structure that contains the status of this resource's membership in the group.
Note
This field is present in the response only if the group is of type AWS::EC2::HostManagement
.
Name (string) --
The current status.
ResourceIdentifiers (list) --
Warning
** Deprecated - don't use this parameter. Use the ``Resources`` response field instead. **
(dict) --
A structure that contains the ARN of a resource and its resource type.
ResourceArn (string) --
The ARN of a resource.
ResourceType (string) --
The resource type of a resource, such as AWS::EC2::Instance
.
QueryErrors (list) --
A list of QueryError
objects. Each error is an object that contains ErrorCode
and Message
structures. Possible values for ErrorCode
are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
(dict) --
A two-part error structure that can occur in ListGroupResources
or SearchResources
operations on CloudFormation stack-based queries. The error occurs if the CloudFormation stack on which the query is based either does not exist, or has a status that renders the stack inactive. A QueryError
occurrence does not necessarily mean that AWS Resource Groups could not complete the operation, but the resulting group might have no member resources.
ErrorCode (string) --
Possible values are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
Message (string) --
A message that explains the ErrorCode
value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE
, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED
.
ResourceGroups.Paginator.
ListGroups
¶paginator = client.get_paginator('list_groups')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from ResourceGroups.Client.list_groups()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
Filters=[
{
'Name': 'resource-type'|'configuration-type',
'Values': [
'string',
]
},
],
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
Filters, formatted as GroupFilter objects, that you want to apply to a ListGroups
operation.
resource-type
- Filter the results to include only those of the specified resource types. Specify up to five resource types in the format AWS::*ServiceCode* ::*ResourceType* `` . For example, ``AWS::EC2::Instance
, or AWS::S3::Bucket
.configuration-type
- Filter the results to include only those groups that have the specified configuration types attached. The current supported values are:AWS:EC2::CapacityReservationPool
AWS:EC2::HostManagement
A filter collection that you can use to restrict the results from a List
operation to only those you want to include.
The name of the filter. Filter names are case-sensitive.
One or more filter values. Allowed filter values vary by group filter name, and are case-sensitive.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'GroupIdentifiers': [
{
'GroupName': 'string',
'GroupArn': 'string'
},
],
'Groups': [
{
'GroupArn': 'string',
'Name': 'string',
'Description': 'string'
},
],
}
Response Structure
(dict) --
GroupIdentifiers (list) --
A list of GroupIdentifier objects. Each identifier is an object that contains both the Name
and the GroupArn
.
(dict) --
The unique identifiers for a resource group.
GroupName (string) --
The name of the resource group.
GroupArn (string) --
The ARN of the resource group.
Groups (list) --
Warning
(dict) --
A resource group that contains AWS resources. You can assign resources to the group by associating either of the following elements with the group:
GroupArn (string) --
The ARN of the resource group.
Name (string) --
The name of the resource group.
Description (string) --
The description of the resource group.
ResourceGroups.Paginator.
SearchResources
¶paginator = client.get_paginator('search_resources')
paginate
(**kwargs)¶Creates an iterator that will paginate through responses from ResourceGroups.Client.search_resources()
.
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ResourceQuery={
'Type': 'TAG_FILTERS_1_0'|'CLOUDFORMATION_STACK_1_0',
'Query': 'string'
},
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The search query, using the same formats that are supported for resource group definition. For more information, see CreateGroup .
The type of the query. You can use the following values:
CLOUDFORMATION_STACK_1_0:
* Specifies that the Query
contains an ARN for a CloudFormation stack.Stage
and Version
, with two values each: [{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.{"Stage":"Deploy"}
, and {"Version":"2"}
{"Stage":"Test"}
, and {"Version":"1"}
The query would not include the following items in the results, however.
- An EC2 instance that has only the following tag:
{"Stage":"Deploy"}
. The instance does not have all of the tag keys specified in the filter, so it is excluded from the results.- An RDS database that has the following two tags:
{"Stage":"Archived"}
and{"Version":"4"}
The database has all of the tag keys, but none of those keys has an associated value that matches at least one of the specified values in the filter.
The query that defines a group or a search.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken
will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken
from a previous response.
dict
Response Syntax
{
'ResourceIdentifiers': [
{
'ResourceArn': 'string',
'ResourceType': 'string'
},
],
'QueryErrors': [
{
'ErrorCode': 'CLOUDFORMATION_STACK_INACTIVE'|'CLOUDFORMATION_STACK_NOT_EXISTING',
'Message': 'string'
},
]
}
Response Structure
(dict) --
ResourceIdentifiers (list) --
The ARNs and resource types of resources that are members of the group that you specified.
(dict) --
A structure that contains the ARN of a resource and its resource type.
ResourceArn (string) --
The ARN of a resource.
ResourceType (string) --
The resource type of a resource, such as AWS::EC2::Instance
.
QueryErrors (list) --
A list of QueryError
objects. Each error is an object that contains ErrorCode
and Message
structures. Possible values for ErrorCode
are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
(dict) --
A two-part error structure that can occur in ListGroupResources
or SearchResources
operations on CloudFormation stack-based queries. The error occurs if the CloudFormation stack on which the query is based either does not exist, or has a status that renders the stack inactive. A QueryError
occurrence does not necessarily mean that AWS Resource Groups could not complete the operation, but the resulting group might have no member resources.
ErrorCode (string) --
Possible values are CLOUDFORMATION_STACK_INACTIVE
and CLOUDFORMATION_STACK_NOT_EXISTING
.
Message (string) --
A message that explains the ErrorCode
value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). For CLOUDFORMATION_STACK_INACTIVE
, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such as CREATE_FAILED
.