AWS Resource Groups
Welcome (API Version 2017-11-27)

CreateGroup

Creates a group with a specified name, description, and resource query.

Request Syntax

POST /groups HTTP/1.1 Content-type: application/json { "Description": "string", "Name": "string", "ResourceQuery": { "Query": "string", "Type": "string" }, "Tags": { "string" : "string" } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

Description

The description of the resource group. Descriptions can have a maximum of 511 characters, including letters, numbers, hyphens, underscores, punctuation, and spaces.

Type: String

Length Constraints: Maximum length of 512.

Pattern: [\sa-zA-Z0-9_\.-]*

Required: No

Name

The name of the group, which is the identifier of the group in other operations. A resource group name cannot be updated after it is created. A resource group name can have a maximum of 128 characters, including letters, numbers, hyphens, dots, and underscores. The name cannot start with AWS or aws; these are reserved. A resource group name must be unique within your account.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9_\.-]+

Required: Yes

ResourceQuery

The resource query that determines which AWS resources are members of this group.

Type: ResourceQuery object

Required: Yes

Tags

The tags to add to the group. A tag is a string-to-string map of key-value pairs. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Value Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "Group": { "Description": "string", "GroupArn": "string", "Name": "string" }, "ResourceQuery": { "Query": "string", "Type": "string" }, "Tags": { "string" : "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Group

A full description of the resource group after it is created.

Type: Group object

ResourceQuery

The resource query associated with the group.

Type: ResourceQuery object

Tags

The tags associated with the group.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Value Length Constraints: Minimum length of 0. Maximum length of 256.

Value Pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$

Errors

For information about the errors that are common to all actions, see Common Errors.

BadRequestException

The request does not comply with validation rules that are defined for the request parameters.

HTTP Status Code: 400

ForbiddenException

The caller is not authorized to make the request.

HTTP Status Code: 403

InternalServerErrorException

An internal error occurred while processing the request.

HTTP Status Code: 500

MethodNotAllowedException

The request uses an HTTP method which is not allowed for the specified resource.

HTTP Status Code: 405

TooManyRequestsException

The caller has exceeded throttling limits.

HTTP Status Code: 429

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: