ListCostCategoryResourceAssociations - AWS Billing and Cost Management

ListCostCategoryResourceAssociations

Returns resource associations of all cost categories defined in the account. You have the option to use CostCategoryArn to get the association for a specific cost category. ListCostCategoryResourceAssociations supports pagination. The request can have a MaxResults range up to 100.

Request Syntax

{ "CostCategoryArn": "string", "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.

CostCategoryArn

The unique identifier for your cost category.

Type: String

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

Pattern: arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+

Required: No

MaxResults

The number of entries a paginated response contains.

Type: Integer

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

Required: No

NextToken

The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Type: String

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

Pattern: [\S\s]*

Required: No

Response Syntax

{ "CostCategoryResourceAssociations": [ { "CostCategoryArn": "string", "CostCategoryName": "string", "ResourceArn": "string" } ], "NextToken": "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.

CostCategoryResourceAssociations

A reference to a cost category association that contains information on an associated resource.

Type: Array of CostCategoryResourceAssociation objects

NextToken

The token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Type: String

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

Pattern: [\S\s]*

Errors

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

LimitExceededException

You made too many calls in a short period of time. Try again later.

HTTP Status Code: 400

ResourceNotFoundException

The specified ARN in the request doesn't exist.

HTTP Status Code: 400

Examples

The following is a sample response of the ListCostCategoryResourceAssociations operation that you can use to retrieve all associated cost categories and corresponding associated resources.

Example

This example illustrates one usage of ListCostCategoryResourceAssociations.

Sample Response

{ "CostCategoryResourceAssociations": [ { "CostCategoryArn": "arn:aws:ce::111122223333:costcategory/f595cb52-91ec-4575-b99f-15829f405ba3", "CostCategoryName": "MyCostCategory", "ResourceArn": "arn:aws:billing::111122223333:rispgroupsharing/111122223333" } ] }

See Also

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