AWS Resource Groups 2017-11-27
- Client: Aws\ResourceGroups\ResourceGroupsClient
- Service ID: resource-groups
- Version: 2017-11-27
This page describes the parameters and results for the operations of the AWS Resource Groups (2017-11-27), and shows how to use the Aws\ResourceGroups\ResourceGroupsClient object to call the described operations. This documentation is specific to the 2017-11-27 API version of the service.
Operation Summary
Each of the following operations can be created from a client using
$client->getCommand('CommandName')
, where "CommandName" is the
name of one of the following operations. Note: a command is a value that
encapsulates an operation and the parameters used to create an HTTP request.
You can also create and send a command immediately using the magic methods
available on a client object: $client->commandName(/* parameters */)
.
You can send the command asynchronously (returning a promise) by appending the
word "Async" to the operation name: $client->commandNameAsync(/* parameters */)
.
- CreateGroup ( array $params = [] )
Creates a resource group with the specified name and description.
- DeleteGroup ( array $params = [] )
Deletes the specified resource group.
- GetGroup ( array $params = [] )
Returns information about a specified resource group.
- GetGroupConfiguration ( array $params = [] )
Returns the service configuration associated with the specified resource group.
- GetGroupQuery ( array $params = [] )
Retrieves the resource query associated with the specified resource group.
- GetTags ( array $params = [] )
Returns a list of tags that are associated with a resource group, specified by an ARN.
- GroupResources ( array $params = [] )
Adds the specified resources to the specified group.
- ListGroupResources ( array $params = [] )
Returns a list of ARNs of the resources that are members of a specified resource group.
- ListGroups ( array $params = [] )
Returns a list of existing resource groups in your account.
- PutGroupConfiguration ( array $params = [] )
Attaches a service configuration to the specified group.
- SearchResources ( array $params = [] )
Returns a list of AWS resource identifiers that matches the specified query.
- Tag ( array $params = [] )
Adds tags to a resource group with the specified ARN.
- UngroupResources ( array $params = [] )
Removes the specified resources from the specified group.
- Untag ( array $params = [] )
Deletes tags from a specified resource group.
- UpdateGroup ( array $params = [] )
Updates the description for an existing group.
- UpdateGroupQuery ( array $params = [] )
Updates the resource query of a group.
Paginators
Paginators handle automatically iterating over paginated API results. Paginators are associated with specific API operations, and they accept the parameters that the corresponding API operation accepts. You can get a paginator from a client class using getPaginator($paginatorName, $operationParameters). This client supports the following paginators:
Operations
CreateGroup
$result = $client->createGroup
([/* ... */]); $promise = $client->createGroupAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->createGroup([ 'Configuration' => [ [ 'Parameters' => [ [ 'Name' => '<string>', // REQUIRED 'Values' => ['<string>', ...], ], // ... ], 'Type' => '<string>', // REQUIRED ], // ... ], 'Description' => '<string>', 'Name' => '<string>', // REQUIRED 'ResourceQuery' => [ 'Query' => '<string>', // REQUIRED 'Type' => 'TAG_FILTERS_1_0|CLOUDFORMATION_STACK_1_0', // REQUIRED ], 'Tags' => ['<string>', ...], ]);
Parameter Details
Members
- Configuration
-
- Type: Array of GroupConfigurationItem structures
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.
A resource group can contain either a
Configuration
or aResourceQuery
, but not both. - Description
-
- Type: string
The description of the resource group. Descriptions can consist of letters, numbers, hyphens, underscores, periods, and spaces.
- Name
-
- Required: Yes
- Type: string
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
oraws
; these are reserved. A resource group name must be unique within each AWS Region in your AWS account. - ResourceQuery
-
- Type: ResourceQuery structure
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.
A resource group can contain either a
ResourceQuery
or aConfiguration
, but not both. - Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
The tags to add to the group. A tag is key-value pair string.
Result Syntax
[ 'Group' => [ 'Description' => '<string>', 'GroupArn' => '<string>', 'Name' => '<string>', ], 'GroupConfiguration' => [ 'Configuration' => [ [ 'Parameters' => [ [ 'Name' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'Type' => '<string>', ], // ... ], 'FailureReason' => '<string>', 'ProposedConfiguration' => [ [ 'Parameters' => [ [ 'Name' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'Type' => '<string>', ], // ... ], 'Status' => 'UPDATING|UPDATE_COMPLETE|UPDATE_FAILED', ], 'ResourceQuery' => [ 'Query' => '<string>', 'Type' => 'TAG_FILTERS_1_0|CLOUDFORMATION_STACK_1_0', ], 'Tags' => ['<string>', ...], ]
Result Details
Members
- Group
-
- Type: Group structure
The description of the resource group.
- GroupConfiguration
-
- Type: GroupConfiguration structure
The service configuration associated with the resource group. For details about the syntax of a service configuration, see Service configurations for resource groups.
- ResourceQuery
-
- Type: ResourceQuery structure
The resource query associated with the group. For more information about resource queries, see Create a tag-based group in Resource Groups.
- Tags
-
- Type: Associative array of custom strings keys (TagKey) to strings
The tags associated with the group.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
DeleteGroup
$result = $client->deleteGroup
([/* ... */]); $promise = $client->deleteGroupAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->deleteGroup([ 'Group' => '<string>', 'GroupName' => '<string>', ]);
Parameter Details
Members
Result Syntax
[ 'Group' => [ 'Description' => '<string>', 'GroupArn' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Group
-
- Type: Group structure
A full description of the deleted resource group.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
GetGroup
$result = $client->getGroup
([/* ... */]); $promise = $client->getGroupAsync
([/* ... */]);
Returns information about a specified resource group.
Minimum permissions
To run this command, you must have the following permissions:
-
resource-groups:GetGroup
Parameter Syntax
$result = $client->getGroup([ 'Group' => '<string>', 'GroupName' => '<string>', ]);
Parameter Details
Members
Result Syntax
[ 'Group' => [ 'Description' => '<string>', 'GroupArn' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Group
-
- Type: Group structure
A full description of the resource group.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
GetGroupConfiguration
$result = $client->getGroupConfiguration
([/* ... */]); $promise = $client->getGroupConfigurationAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->getGroupConfiguration([ 'Group' => '<string>', ]);
Parameter Details
Result Syntax
[ 'GroupConfiguration' => [ 'Configuration' => [ [ 'Parameters' => [ [ 'Name' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'Type' => '<string>', ], // ... ], 'FailureReason' => '<string>', 'ProposedConfiguration' => [ [ 'Parameters' => [ [ 'Name' => '<string>', 'Values' => ['<string>', ...], ], // ... ], 'Type' => '<string>', ], // ... ], 'Status' => 'UPDATING|UPDATE_COMPLETE|UPDATE_FAILED', ], ]
Result Details
Members
- GroupConfiguration
-
- Type: GroupConfiguration structure
The service configuration associated with the specified group. For details about the service configuration syntax, see Service configurations for resource groups.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
GetGroupQuery
$result = $client->getGroupQuery
([/* ... */]); $promise = $client->getGroupQueryAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->getGroupQuery([ 'Group' => '<string>', 'GroupName' => '<string>', ]);
Parameter Details
Members
Result Syntax
[ 'GroupQuery' => [ 'GroupName' => '<string>', 'ResourceQuery' => [ 'Query' => '<string>', 'Type' => 'TAG_FILTERS_1_0|CLOUDFORMATION_STACK_1_0', ], ], ]
Result Details
Members
- GroupQuery
-
- Type: GroupQuery structure
The resource query associated with the specified group. For more information about resource queries, see Create a tag-based group in Resource Groups.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
GetTags
$result = $client->getTags
([/* ... */]); $promise = $client->getTagsAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->getTags([ 'Arn' => '<string>', // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Arn' => '<string>', 'Tags' => ['<string>', ...], ]
Result Details
Members
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
GroupResources
$result = $client->groupResources
([/* ... */]); $promise = $client->groupResourcesAsync
([/* ... */]);
Adds the specified resources to the specified group.
Minimum permissions
To run this command, you must have the following permissions:
-
resource-groups:GroupResources
Parameter Syntax
$result = $client->groupResources([ 'Group' => '<string>', // REQUIRED 'ResourceArns' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Failed' => [ [ 'ErrorCode' => '<string>', 'ErrorMessage' => '<string>', 'ResourceArn' => '<string>', ], // ... ], 'Pending' => [ [ 'ResourceArn' => '<string>', ], // ... ], 'Succeeded' => ['<string>', ...], ]
Result Details
Members
- Failed
-
- Type: Array of FailedResource structures
A list of ARNs of any resources that failed to be added to the group by this operation.
- Pending
-
- Type: Array of PendingResource structures
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 theResources
array in the response and theStatus
field of each object in that array. - Succeeded
-
- Type: Array of strings
A list of ARNs of resources that were successfully added to the group by this operation.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
ListGroupResources
$result = $client->listGroupResources
([/* ... */]); $promise = $client->listGroupResourcesAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->listGroupResources([ 'Filters' => [ [ 'Name' => 'resource-type', // REQUIRED 'Values' => ['<string>', ...], // REQUIRED ], // ... ], 'Group' => '<string>', 'GroupName' => '<string>', 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- Filters
-
- Type: Array of ResourceFilter structures
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 formatAWS::ServiceCode::ResourceType
. For example,AWS::EC2::Instance
, orAWS::S3::Bucket
.
When you specify a
resource-type
filter forListGroupResources
, 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 yourresource-type
filter includes EC2 instances, AWS Resource Groups does not filter for EC2 instances. In this case, aListGroupResources
request returns aBadRequestException
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). - Group
-
- Type: string
The name or the ARN of the resource group
- GroupName
-
- Type: string
Deprecated - don't use this parameter. Use the
Group
request field instead. - MaxResults
-
- Type: int
The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the
NextToken
response element is present and has a value (is not null). Include that value as theNextToken
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 checkNextToken
after every operation to ensure that you receive all of the results. - NextToken
-
- Type: string
The parameter for receiving additional results if you receive a
NextToken
response in a previous request. ANextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call'sNextToken
response to indicate where the output should continue from.
Result Syntax
[ 'NextToken' => '<string>', 'QueryErrors' => [ [ 'ErrorCode' => 'CLOUDFORMATION_STACK_INACTIVE|CLOUDFORMATION_STACK_NOT_EXISTING', 'Message' => '<string>', ], // ... ], 'ResourceIdentifiers' => [ [ 'ResourceArn' => '<string>', 'ResourceType' => '<string>', ], // ... ], 'Resources' => [ [ 'Identifier' => [ 'ResourceArn' => '<string>', 'ResourceType' => '<string>', ], 'Status' => [ 'Name' => 'PENDING', ], ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: 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 theNextToken
response element comes back asnull
. - QueryErrors
-
- Type: Array of QueryError structures
A list of
QueryError
objects. Each error is an object that containsErrorCode
andMessage
structures. Possible values forErrorCode
areCLOUDFORMATION_STACK_INACTIVE
andCLOUDFORMATION_STACK_NOT_EXISTING
. - ResourceIdentifiers
-
- Type: Array of ResourceIdentifier structures
Deprecated - don't use this parameter. Use the
Resources
response field instead. - Resources
-
- Type: Array of ListGroupResourcesItem structures
An array of resources from which you can determine each resource's identity, type, and group membership status.
Errors
-
The request was rejected because it doesn't have valid credentials for the target resource.
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
ListGroups
$result = $client->listGroups
([/* ... */]); $promise = $client->listGroupsAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->listGroups([ 'Filters' => [ [ 'Name' => 'resource-type|configuration-type', // REQUIRED 'Values' => ['<string>', ...], // REQUIRED ], // ... ], 'MaxResults' => <integer>, 'NextToken' => '<string>', ]);
Parameter Details
Members
- Filters
-
- Type: Array of GroupFilter structures
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 formatAWS::ServiceCode::ResourceType
. For example,AWS::EC2::Instance
, orAWS::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
-
- MaxResults
-
- Type: int
The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the
NextToken
response element is present and has a value (is not null). Include that value as theNextToken
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 checkNextToken
after every operation to ensure that you receive all of the results. - NextToken
-
- Type: string
The parameter for receiving additional results if you receive a
NextToken
response in a previous request. ANextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call'sNextToken
response to indicate where the output should continue from.
Result Syntax
[ 'GroupIdentifiers' => [ [ 'GroupArn' => '<string>', 'GroupName' => '<string>', ], // ... ], 'Groups' => [ [ 'Description' => '<string>', 'GroupArn' => '<string>', 'Name' => '<string>', ], // ... ], 'NextToken' => '<string>', ]
Result Details
Members
- GroupIdentifiers
-
- Type: Array of GroupIdentifier structures
A list of GroupIdentifier objects. Each identifier is an object that contains both the
Name
and theGroupArn
. - Groups
-
- Type: Array of Group structures
Deprecated - don't use this field. Use the
GroupIdentifiers
response field instead. - NextToken
-
- Type: 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 theNextToken
response element comes back asnull
.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
PutGroupConfiguration
$result = $client->putGroupConfiguration
([/* ... */]); $promise = $client->putGroupConfigurationAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->putGroupConfiguration([ 'Configuration' => [ [ 'Parameters' => [ [ 'Name' => '<string>', // REQUIRED 'Values' => ['<string>', ...], ], // ... ], 'Type' => '<string>', // REQUIRED ], // ... ], 'Group' => '<string>', ]);
Parameter Details
Members
- Configuration
-
- Type: Array of GroupConfigurationItem structures
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.
A resource group can contain either a
Configuration
or aResourceQuery
, but not both. - Group
-
- Type: string
The name or ARN of the resource group with the configuration that you want to update.
Result Syntax
[]
Result Details
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
SearchResources
$result = $client->searchResources
([/* ... */]); $promise = $client->searchResourcesAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->searchResources([ 'MaxResults' => <integer>, 'NextToken' => '<string>', 'ResourceQuery' => [ // REQUIRED 'Query' => '<string>', // REQUIRED 'Type' => 'TAG_FILTERS_1_0|CLOUDFORMATION_STACK_1_0', // REQUIRED ], ]);
Parameter Details
Members
- MaxResults
-
- Type: int
The total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the maximum you specify, the
NextToken
response element is present and has a value (is not null). Include that value as theNextToken
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 checkNextToken
after every operation to ensure that you receive all of the results. - NextToken
-
- Type: string
The parameter for receiving additional results if you receive a
NextToken
response in a previous request. ANextToken
response indicates that more output is available. Set this parameter to the value provided by a previous call'sNextToken
response to indicate where the output should continue from. - ResourceQuery
-
- Required: Yes
- Type: ResourceQuery structure
The search query, using the same formats that are supported for resource group definition. For more information, see CreateGroup.
Result Syntax
[ 'NextToken' => '<string>', 'QueryErrors' => [ [ 'ErrorCode' => 'CLOUDFORMATION_STACK_INACTIVE|CLOUDFORMATION_STACK_NOT_EXISTING', 'Message' => '<string>', ], // ... ], 'ResourceIdentifiers' => [ [ 'ResourceArn' => '<string>', 'ResourceType' => '<string>', ], // ... ], ]
Result Details
Members
- NextToken
-
- Type: 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 theNextToken
response element comes back asnull
. - QueryErrors
-
- Type: Array of QueryError structures
A list of
QueryError
objects. Each error is an object that containsErrorCode
andMessage
structures. Possible values forErrorCode
areCLOUDFORMATION_STACK_INACTIVE
andCLOUDFORMATION_STACK_NOT_EXISTING
. - ResourceIdentifiers
-
- Type: Array of ResourceIdentifier structures
The ARNs and resource types of resources that are members of the group that you specified.
Errors
-
The request was rejected because it doesn't have valid credentials for the target resource.
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
Tag
$result = $client->tag
([/* ... */]); $promise = $client->tagAsync
([/* ... */]);
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.
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
Parameter Syntax
$result = $client->tag([ 'Arn' => '<string>', // REQUIRED 'Tags' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Arn' => '<string>', 'Tags' => ['<string>', ...], ]
Result Details
Members
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
UngroupResources
$result = $client->ungroupResources
([/* ... */]); $promise = $client->ungroupResourcesAsync
([/* ... */]);
Removes the specified resources from the specified group.
Minimum permissions
To run this command, you must have the following permissions:
-
resource-groups:UngroupResources
Parameter Syntax
$result = $client->ungroupResources([ 'Group' => '<string>', // REQUIRED 'ResourceArns' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Failed' => [ [ 'ErrorCode' => '<string>', 'ErrorMessage' => '<string>', 'ResourceArn' => '<string>', ], // ... ], 'Pending' => [ [ 'ResourceArn' => '<string>', ], // ... ], 'Succeeded' => ['<string>', ...], ]
Result Details
Members
- Failed
-
- Type: Array of FailedResource structures
A list of any resources that failed to be removed from the group by this operation.
- Pending
-
- Type: Array of PendingResource structures
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. - Succeeded
-
- Type: Array of strings
A list of resources that were successfully removed from the group by this operation.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
Untag
$result = $client->untag
([/* ... */]); $promise = $client->untagAsync
([/* ... */]);
Deletes tags from a specified resource group.
Minimum permissions
To run this command, you must have the following permissions:
-
resource-groups:Untag
Parameter Syntax
$result = $client->untag([ 'Arn' => '<string>', // REQUIRED 'Keys' => ['<string>', ...], // REQUIRED ]);
Parameter Details
Members
Result Syntax
[ 'Arn' => '<string>', 'Keys' => ['<string>', ...], ]
Result Details
Members
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
UpdateGroup
$result = $client->updateGroup
([/* ... */]); $promise = $client->updateGroupAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->updateGroup([ 'Description' => '<string>', 'Group' => '<string>', 'GroupName' => '<string>', ]);
Parameter Details
Members
- Description
-
- Type: string
The new description that you want to update the resource group with. Descriptions can contain letters, numbers, hyphens, underscores, periods, and spaces.
- Group
-
- Type: string
The name or the ARN of the resource group to modify.
- GroupName
-
- Type: string
Don't use this parameter. Use
Group
instead.
Result Syntax
[ 'Group' => [ 'Description' => '<string>', 'GroupArn' => '<string>', 'Name' => '<string>', ], ]
Result Details
Members
- Group
-
- Type: Group structure
The update description of the resource group.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
UpdateGroupQuery
$result = $client->updateGroupQuery
([/* ... */]); $promise = $client->updateGroupQueryAsync
([/* ... */]);
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
Parameter Syntax
$result = $client->updateGroupQuery([ 'Group' => '<string>', 'GroupName' => '<string>', 'ResourceQuery' => [ // REQUIRED 'Query' => '<string>', // REQUIRED 'Type' => 'TAG_FILTERS_1_0|CLOUDFORMATION_STACK_1_0', // REQUIRED ], ]);
Parameter Details
Members
- Group
-
- Type: string
The name or the ARN of the resource group to query.
- GroupName
-
- Type: string
Don't use this parameter. Use
Group
instead. - ResourceQuery
-
- Required: Yes
- Type: ResourceQuery structure
The resource query to determine which AWS resources are members of this resource group.
A resource group can contain either a
Configuration
or aResourceQuery
, but not both.
Result Syntax
[ 'GroupQuery' => [ 'GroupName' => '<string>', 'ResourceQuery' => [ 'Query' => '<string>', 'Type' => 'TAG_FILTERS_1_0|CLOUDFORMATION_STACK_1_0', ], ], ]
Result Details
Members
- GroupQuery
-
- Type: GroupQuery structure
The updated resource query associated with the resource group after the update.
Errors
-
The request includes one or more parameters that violate validation rules.
-
The caller isn't authorized to make the request. Check permissions.
-
One or more of the specified resources don't exist.
-
The request uses an HTTP method that isn't allowed for the specified resource.
-
You've exceeded throttling limits by making too many requests in a period of time.
-
An internal error occurred while processing the request. Try again later.
Shapes
BadRequestException
Description
The request includes one or more parameters that violate validation rules.
Members
FailedResource
Description
A resource that failed to be added to or removed from a group.
Members
ForbiddenException
Description
The caller isn't authorized to make the request. Check permissions.
Members
Group
Description
A resource group that contains AWS resources. You can assign resources to the group by associating either of the following elements with the group:
-
ResourceQuery - Use a resource query to specify a set of tag keys and values. All resources in the same AWS Region and AWS account that have those keys with the same values are included in the group. You can add a resource query when you create the group, or later by using the PutGroupConfiguration operation.
-
GroupConfiguration - Use a service configuration to associate the group with an AWS service. The configuration specifies which resource types can be included in the group.
Members
GroupConfiguration
Description
A service configuration associated with a resource group. The configuration options are determined by the AWS service that defines the Type
, and specifies which resources can be included in the group. You can add a service configuration when you create the group by using CreateGroup, or later by using the PutGroupConfiguration operation. For details about group service configuration syntax, see Service configurations for resource groups.
Members
- Configuration
-
- Type: Array of GroupConfigurationItem structures
The configuration currently associated with the group and in effect.
- FailureReason
-
- Type: string
If present, the reason why a request to update the group configuration failed.
- ProposedConfiguration
-
- Type: Array of GroupConfigurationItem structures
If present, the new configuration that is in the process of being applied to the group.
- Status
-
- Type: string
The current status of an attempt to update the group configuration.
GroupConfigurationItem
Description
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.
Members
- Parameters
-
- Type: Array of GroupConfigurationParameter structures
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.
- Type
-
- Required: Yes
- 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.
GroupConfigurationParameter
Description
A parameter for a group configuration item. For details about group service configuration syntax, see Service configurations for resource groups.
Members
- Name
-
- Required: Yes
- Type: 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
-
- Type: Array of strings
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.
GroupFilter
Description
A filter collection that you can use to restrict the results from a List
operation to only those you want to include.
Members
GroupIdentifier
Description
The unique identifiers for a resource group.
Members
GroupQuery
Description
A mapping of a query attached to a resource group that determines the AWS resources that are members of the group.
Members
- GroupName
-
- Required: Yes
- Type: string
The name of the resource group that is associated with the specified resource query.
- ResourceQuery
-
- Required: Yes
- Type: ResourceQuery structure
The resource query that determines which AWS resources are members of the associated resource group.
InternalServerErrorException
Description
An internal error occurred while processing the request. Try again later.
Members
ListGroupResourcesItem
Description
A structure returned by the ListGroupResources operation that contains identity and group membership status information for one of the resources in the group.
Members
- Identifier
-
- Type: ResourceIdentifier structure
A structure that contains the ARN of a resource and its resource type.
- Status
-
- Type: ResourceStatus structure
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
.
MethodNotAllowedException
Description
The request uses an HTTP method that isn't allowed for the specified resource.
Members
NotFoundException
PendingResource
Description
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.
Members
QueryError
Description
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.
Members
- ErrorCode
-
- Type: string
Possible values are
CLOUDFORMATION_STACK_INACTIVE
andCLOUDFORMATION_STACK_NOT_EXISTING
. - Message
-
- Type: string
A message that explains the
ErrorCode
value. Messages might state that the specified CloudFormation stack does not exist (or no longer exists). ForCLOUDFORMATION_STACK_INACTIVE
, the message typically states that the CloudFormation stack has a status that is not (or no longer) active, such asCREATE_FAILED
.
ResourceFilter
Description
A filter name and value pair that is used to obtain more specific results from a list of resources.
Members
ResourceIdentifier
Description
A structure that contains the ARN of a resource and its resource type.
Members
ResourceQuery
Description
The query that is used to define a resource group or a search for resources. A query specifies both a query type and a query string as a JSON object. See the examples section for example JSON strings.
The examples that follow are shown as standard JSON strings. If you include such a string as a parameter to the AWS CLI or an SDK API, you might need to 'escape' the string into a single line. For example, see the Quoting strings in the AWS CLI User Guide.
Example 1
The following generic example shows a resource query JSON string that includes only resources that meet the following criteria:
-
The resource type must be either
resource_type1
orresource_type2
. -
The resource must have a tag
Key1
with a value of eitherValueA
orValueB
. -
The resource must have a tag
Key2
with a value of eitherValueC
orValueD
.
{ "Type": "TAG_FILTERS_1_0", "Query": { "ResourceTypeFilters": [ "resource_type1", "resource_type2"], "TagFilters": [ { "Key": "Key1", "Values": ["ValueA","ValueB"] }, { "Key":"Key2", "Values":["ValueC","ValueD"] } ] } }
This has the equivalent "shortcut" syntax of the following:
{ "Type": "TAG_FILTERS_1_0", "Query": { "ResourceTypeFilters": [ "resource_type1", "resource_type2"], "TagFilters": [ { "Key1": ["ValueA","ValueB"] }, { "Key2": ["ValueC","ValueD"] } ] } }
Example 2
The following example shows a resource query JSON string that includes only Amazon EC2 instances that are tagged Stage
with a value of Test
.
{ "Type": "TAG_FILTERS_1_0", "Query": "{ "ResourceTypeFilters": "AWS::EC2::Instance", "TagFilters": { "Stage": "Test" } } }
Example 3
The following example shows a resource query JSON string that includes resource of any supported type as long as it is tagged Stage
with a value of Prod
.
{ "Type": "TAG_FILTERS_1_0", "Query": { "ResourceTypeFilters": "AWS::AllSupported", "TagFilters": { "Stage": "Prod" } } }
Example 4
The following example shows a resource query JSON string that includes only Amazon EC2 instances and Amazon S3 buckets that are part of the specified AWS CloudFormation stack.
{ "Type": "CLOUDFORMATION_STACK_1_0", "Query": { "ResourceTypeFilters": [ "AWS::EC2::Instance", "AWS::S3::Bucket" ], "StackIdentifier": "arn:aws:cloudformation:us-west-2:123456789012:stack/AWStestuseraccount/fb0d5000-aba8-00e8-aa9e-50d5cEXAMPLE" } }
Members
- Query
-
- Required: Yes
- Type: string
The query that defines a group or a search.
- Type
-
- Required: Yes
- Type: string
The type of the query. You can use the following values:
-
CLOUDFORMATION_STACK_1_0:
Specifies that theQuery
contains an ARN for a CloudFormation stack. -
TAG_FILTERS_1_0:
Specifies that theQuery
parameter contains a JSON string that represents a collection of simple tag filters for resource types and tags. The JSON string uses a syntax similar to theGetResources
operation, but uses only theResourceTypeFilters
andTagFilters
fields. If you specify more than one tag key, only resources that match all tag keys, and at least one value of each specified tag key, are returned in your query. If you specify more than one value for a tag key, a resource matches the filter if it has a tag key value that matches any of the specified values.For example, consider the following sample query for resources that have two tags,
Stage
andVersion
, with two values each:[{"Stage":["Test","Deploy"]},{"Version":["1","2"]}]
The results of this query could include the following.
-
An EC2 instance that has the following two tags:
{"Stage":"Deploy"}
, and{"Version":"2"}
-
An S3 bucket that has the following two tags:
{"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.
-
ResourceStatus
Description
A structure that identifies the current group membership status for a resource. Adding a resource to a resource group is performed asynchronously as a background task. A PENDING
status indicates, for this resource, that the process isn't completed yet.
Members
TooManyRequestsException
Description
You've exceeded throttling limits by making too many requests in a period of time.