View a markdown version of this page

ListRequiredTags - Resource Groups Tagging API
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ListRequiredTags

Lists the required tags for supported resource types in an Amazon Web Services account.

Request Syntax

{ "MaxResults": number, "NextToken": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

MaxResults

The maximum number of required tags.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 200.

Required: No

NextToken

A token for requesting another page of required tags if the NextToken response element indicates that more required tags are available. Use the value of the returned NextToken element in your request until the token comes back as null. Pass null if this is the first call.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: [\s\S]*

Required: No

Response Syntax

{ "NextToken": "string", "RequiredTags": [ { "CloudFormationResourceTypes": [ "string" ], "ReportingTagKeys": [ "string" ], "ResourceType": "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.

NextToken

A token for requesting another page of required tags if the NextToken response element indicates that more required tags are available. Use the value of the returned NextToken element in your request until the token comes back as null. Pass null if this is the first call.

Type: String

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: [\s\S]*

RequiredTags

The required tags.

Type: Array of RequiredTag objects

Errors

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

InternalServiceException

The request processing failed because of an unknown error, exception, or failure. You can retry the request.

HTTP Status Code: 500

InvalidParameterException

The request failed because of one of the following reasons:

  • A required parameter is missing.

  • A provided string parameter is malformed.

  • An provided parameter value is out of range.

  • The target ID is invalid, unsupported, or doesn't exist.

  • You can't access the Amazon S3 bucket for report storage. For more information, see Amazon S3 bucket policy for report storage in the Tagging Amazon resources and Tag Editor user guide.

  • The partition specified in an ARN parameter in the request doesn't match the partition where you invoked the operation. The partition is specified by the second field of the ARN.

HTTP Status Code: 400

PaginationTokenExpiredException

The request failed because the specified PaginationToken has expired. A PaginationToken is valid for a maximum of 15 minutes.

HTTP Status Code: 400

ThrottledException

The request failed because it exceeded the allowed frequency of submitted requests.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of ListRequiredTags.

Sample Request

POST / HTTP/1.1 Host: tagging.us-east-1.amazonaws.com Accept-Encoding: identity Content-Length: 20 X-Amz-Target: ResourceGroupsTaggingAPI_20170126.ListRequiredTags X-Amz-Date: 20191201T214524Z User-Agent: aws-cli/1.11.79 Python/2.7.9 Windows/7 botocore/1.5.42 Content-Type: application/x-amz-json-1.1 Authorization: AUTHPARAMS {}

Sample Response

HTTP/1.1 200 OK x-amzn-RequestID: d3cf21f0-26db-11e7-a532-75e05382c8b1 Content-Type: application/x-amz-json-1.1 Date: Sun, 1 Dec 2019 21:45:25 GMT { "RequiredTags": [ { "ResourceType": "ec2:instance", "CloudFormationResourceTypes": ["AWS::EC2::Instance"], "ReportingTagKeys": ["example_tag_key"] }, { "ResourceType": "s3:bucket", "CloudFormationResourceTypes": ["AWS::S3:Bucket"], "ReportingTagKeys": ["example_tag_key"] } ] }

See Also

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