Skip to content

Commit 011b4f6

Browse files
author
awstools
committed
feat(client-cost-explorer): Add support for Cost Category resource associations including filtering by resource type on ListCostCategoryDefinitions and new ListCostCategoryResourceAssociations API.
1 parent 18c203b commit 011b4f6

20 files changed

+602
-117
lines changed

clients/client-cost-explorer/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,14 @@ ListCostCategoryDefinitions
489489

490490
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cost-explorer/command/ListCostCategoryDefinitionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cost-explorer/Interface/ListCostCategoryDefinitionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cost-explorer/Interface/ListCostCategoryDefinitionsCommandOutput/)
491491

492+
</details>
493+
<details>
494+
<summary>
495+
ListCostCategoryResourceAssociations
496+
</summary>
497+
498+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cost-explorer/command/ListCostCategoryResourceAssociationsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cost-explorer/Interface/ListCostCategoryResourceAssociationsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cost-explorer/Interface/ListCostCategoryResourceAssociationsCommandOutput/)
499+
492500
</details>
493501
<details>
494502
<summary>

clients/client-cost-explorer/src/CostExplorer.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ import {
168168
ListCostCategoryDefinitionsCommandInput,
169169
ListCostCategoryDefinitionsCommandOutput,
170170
} from "./commands/ListCostCategoryDefinitionsCommand";
171+
import {
172+
ListCostCategoryResourceAssociationsCommand,
173+
ListCostCategoryResourceAssociationsCommandInput,
174+
ListCostCategoryResourceAssociationsCommandOutput,
175+
} from "./commands/ListCostCategoryResourceAssociationsCommand";
171176
import {
172177
ListSavingsPlansPurchaseRecommendationGenerationCommand,
173178
ListSavingsPlansPurchaseRecommendationGenerationCommandInput,
@@ -261,6 +266,7 @@ const commands = {
261266
ListCostAllocationTagBackfillHistoryCommand,
262267
ListCostAllocationTagsCommand,
263268
ListCostCategoryDefinitionsCommand,
269+
ListCostCategoryResourceAssociationsCommand,
264270
ListSavingsPlansPurchaseRecommendationGenerationCommand,
265271
ListTagsForResourceCommand,
266272
ProvideAnomalyFeedbackCommand,
@@ -842,6 +848,24 @@ export interface CostExplorer {
842848
cb: (err: any, data?: ListCostCategoryDefinitionsCommandOutput) => void
843849
): void;
844850

851+
/**
852+
* @see {@link ListCostCategoryResourceAssociationsCommand}
853+
*/
854+
listCostCategoryResourceAssociations(): Promise<ListCostCategoryResourceAssociationsCommandOutput>;
855+
listCostCategoryResourceAssociations(
856+
args: ListCostCategoryResourceAssociationsCommandInput,
857+
options?: __HttpHandlerOptions
858+
): Promise<ListCostCategoryResourceAssociationsCommandOutput>;
859+
listCostCategoryResourceAssociations(
860+
args: ListCostCategoryResourceAssociationsCommandInput,
861+
cb: (err: any, data?: ListCostCategoryResourceAssociationsCommandOutput) => void
862+
): void;
863+
listCostCategoryResourceAssociations(
864+
args: ListCostCategoryResourceAssociationsCommandInput,
865+
options: __HttpHandlerOptions,
866+
cb: (err: any, data?: ListCostCategoryResourceAssociationsCommandOutput) => void
867+
): void;
868+
845869
/**
846870
* @see {@link ListSavingsPlansPurchaseRecommendationGenerationCommand}
847871
*/

clients/client-cost-explorer/src/CostExplorerClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ import {
178178
ListCostCategoryDefinitionsCommandInput,
179179
ListCostCategoryDefinitionsCommandOutput,
180180
} from "./commands/ListCostCategoryDefinitionsCommand";
181+
import {
182+
ListCostCategoryResourceAssociationsCommandInput,
183+
ListCostCategoryResourceAssociationsCommandOutput,
184+
} from "./commands/ListCostCategoryResourceAssociationsCommand";
181185
import {
182186
ListSavingsPlansPurchaseRecommendationGenerationCommandInput,
183187
ListSavingsPlansPurchaseRecommendationGenerationCommandOutput,
@@ -269,6 +273,7 @@ export type ServiceInputTypes =
269273
| ListCostAllocationTagBackfillHistoryCommandInput
270274
| ListCostAllocationTagsCommandInput
271275
| ListCostCategoryDefinitionsCommandInput
276+
| ListCostCategoryResourceAssociationsCommandInput
272277
| ListSavingsPlansPurchaseRecommendationGenerationCommandInput
273278
| ListTagsForResourceCommandInput
274279
| ProvideAnomalyFeedbackCommandInput
@@ -320,6 +325,7 @@ export type ServiceOutputTypes =
320325
| ListCostAllocationTagBackfillHistoryCommandOutput
321326
| ListCostAllocationTagsCommandOutput
322327
| ListCostCategoryDefinitionsCommandOutput
328+
| ListCostCategoryResourceAssociationsCommandOutput
323329
| ListSavingsPlansPurchaseRecommendationGenerationCommandOutput
324330
| ListTagsForResourceCommandOutput
325331
| ProvideAnomalyFeedbackCommandOutput

clients/client-cost-explorer/src/commands/CreateCostCategoryDefinitionCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface CreateCostCategoryDefinitionCommandOutput
2929
__MetadataBearer {}
3030

3131
/**
32-
* <p>Creates a new Cost Category with the requested name and rules.</p>
32+
* <p>Creates a new cost category with the requested name and rules.</p>
3333
* @example
3434
* Use a bare-bones client and the command you need to make an API call.
3535
* ```javascript

clients/client-cost-explorer/src/commands/DeleteCostCategoryDefinitionCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export interface DeleteCostCategoryDefinitionCommandOutput
2929
__MetadataBearer {}
3030

3131
/**
32-
* <p>Deletes a Cost Category. Expenses from this month going forward will no longer be
33-
* categorized with this Cost Category.</p>
32+
* <p>Deletes a cost category. Expenses from this month going forward will no longer be
33+
* categorized with this cost category.</p>
3434
* @example
3535
* Use a bare-bones client and the command you need to make an API call.
3636
* ```javascript

clients/client-cost-explorer/src/commands/DescribeCostCategoryDefinitionCommand.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export interface DescribeCostCategoryDefinitionCommandOutput
3030

3131
/**
3232
* <p>Returns the name, Amazon Resource Name (ARN), rules, definition, and effective dates of a
33-
* Cost Category that's defined in the account.</p>
34-
* <p>You have the option to use <code>EffectiveOn</code> to return a Cost Category that's
33+
* cost category that's defined in the account.</p>
34+
* <p>You have the option to use <code>EffectiveOn</code> to return a cost category that's
3535
* active on a specific date. If there's no <code>EffectiveOn</code> specified, you see a Cost
36-
* Category that's effective on the current date. If Cost Category is still effective,
36+
* Category that's effective on the current date. If cost category is still effective,
3737
* <code>EffectiveEnd</code> is omitted in the response. </p>
3838
* @example
3939
* Use a bare-bones client and the command you need to make an API call.

clients/client-cost-explorer/src/commands/GetCostCategoriesCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export interface GetCostCategoriesCommandInput extends GetCostCategoriesRequest
2727
export interface GetCostCategoriesCommandOutput extends GetCostCategoriesResponse, __MetadataBearer {}
2828

2929
/**
30-
* <p>Retrieves an array of Cost Category names and values incurred cost.</p>
30+
* <p>Retrieves an array of cost category names and values incurred cost.</p>
3131
* <note>
32-
* <p>If some Cost Category names and values are not associated with any cost, they will not
32+
* <p>If some cost category names and values are not associated with any cost, they will not
3333
* be returned by this API.</p>
3434
* </note>
3535
* @example

clients/client-cost-explorer/src/commands/GetReservationCoverageCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface GetReservationCoverageCommandOutput extends GetReservationCover
3030
* <p>Retrieves the reservation coverage for your account, which you can use to see how much
3131
* of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon Relational Database Service,
3232
* or Amazon Redshift usage is covered by a reservation. An organization's management account can
33-
* see the coverage of the associated member accounts. This supports dimensions, Cost Categories,
33+
* see the coverage of the associated member accounts. This supports dimensions, cost categories,
3434
* and nested expressions. For any time period, you can filter data about reservation usage by
3535
* the following dimensions:</p>
3636
* <ul>

clients/client-cost-explorer/src/commands/GetSavingsPlansCoverageCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface GetSavingsPlansCoverageCommandOutput extends GetSavingsPlansCov
2929
/**
3030
* <p>Retrieves the Savings Plans covered for your account. This enables you to see how much of
3131
* your cost is covered by a Savings Plan. An organization’s management account can see the
32-
* coverage of the associated member accounts. This supports dimensions, Cost Categories, and
32+
* coverage of the associated member accounts. This supports dimensions, cost categories, and
3333
* nested expressions. For any time period, you can filter data for Savings Plans usage with the
3434
* following dimensions:</p>
3535
* <ul>

clients/client-cost-explorer/src/commands/ListCostCategoryDefinitionsCommand.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ export interface ListCostCategoryDefinitionsCommandOutput
3030

3131
/**
3232
* <p>Returns the name, Amazon Resource Name (ARN), <code>NumberOfRules</code> and effective
33-
* dates of all Cost Categories defined in the account. You have the option to use
34-
* <code>EffectiveOn</code> to return a list of Cost Categories that were active on a specific
35-
* date. If there is no <code>EffectiveOn</code> specified, you’ll see Cost Categories that are
36-
* effective on the current date. If Cost Category is still effective, <code>EffectiveEnd</code>
33+
* dates of all cost categories defined in the account. You have the option to use
34+
* <code>EffectiveOn</code> and <code>SupportedResourceTypes</code> to return a list of cost categories that were active on a specific
35+
* date. If there is no <code>EffectiveOn</code> specified, you’ll see cost categories that are
36+
* effective on the current date. If cost category is still effective, <code>EffectiveEnd</code>
3737
* is omitted in the response. <code>ListCostCategoryDefinitions</code> supports pagination. The
3838
* request can have a <code>MaxResults</code> range up to 100.</p>
3939
* @example
@@ -48,6 +48,9 @@ export interface ListCostCategoryDefinitionsCommandOutput
4848
* EffectiveOn: "STRING_VALUE",
4949
* NextToken: "STRING_VALUE",
5050
* MaxResults: Number("int"),
51+
* SupportedResourceTypes: [ // ResourceTypesFilterInput
52+
* "STRING_VALUE",
53+
* ],
5154
* };
5255
* const command = new ListCostCategoryDefinitionsCommand(input);
5356
* const response = await client.send(command);
@@ -69,6 +72,9 @@ export interface ListCostCategoryDefinitionsCommandOutput
6972
* // "STRING_VALUE",
7073
* // ],
7174
* // DefaultValue: "STRING_VALUE",
75+
* // SupportedResourceTypes: [ // ResourceTypes
76+
* // "STRING_VALUE",
77+
* // ],
7278
* // },
7379
* // ],
7480
* // NextToken: "STRING_VALUE",

0 commit comments

Comments
 (0)