Skip to content

Commit 360bf1c

Browse files
author
awstools
committed
feat(client-budgets): Adds support for billing views. Billing views let you control access to cost and usage data through an AWS resource, streamlining the process of sharing cost and usage data across account boundaries. With this release, you can now create and view budgets based on billing views.
1 parent aa76eb4 commit 360bf1c

File tree

8 files changed

+276
-29
lines changed

8 files changed

+276
-29
lines changed

clients/client-budgets/src/commands/CreateBudgetCommand.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
174174
* Metrics: [ // Metrics
175175
* "BlendedCost" || "UnblendedCost" || "AmortizedCost" || "NetUnblendedCost" || "NetAmortizedCost" || "UsageQuantity" || "NormalizedUsageAmount" || "Hours",
176176
* ],
177+
* BillingViewArn: "STRING_VALUE",
178+
* HealthStatus: { // HealthStatus
179+
* Status: "HEALTHY" || "UNHEALTHY",
180+
* StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
181+
* LastUpdatedTime: new Date("TIMESTAMP"),
182+
* },
177183
* },
178184
* NotificationsWithSubscribers: [ // NotificationWithSubscribersList
179185
* { // NotificationWithSubscribers
@@ -226,6 +232,9 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
226232
* @throws {@link InvalidParameterException} (client fault)
227233
* <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
228234
*
235+
* @throws {@link NotFoundException} (client fault)
236+
* <p>We can’t locate the resource that you specified.</p>
237+
*
229238
* @throws {@link ServiceQuotaExceededException} (client fault)
230239
* <p>You've reached the limit on the number of tags you can associate with a resource.</p>
231240
*

clients/client-budgets/src/commands/DescribeBudgetCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,12 @@ export interface DescribeBudgetCommandOutput extends DescribeBudgetResponse, __M
172172
* // Metrics: [ // Metrics
173173
* // "BlendedCost" || "UnblendedCost" || "AmortizedCost" || "NetUnblendedCost" || "NetAmortizedCost" || "UsageQuantity" || "NormalizedUsageAmount" || "Hours",
174174
* // ],
175+
* // BillingViewArn: "STRING_VALUE",
176+
* // HealthStatus: { // HealthStatus
177+
* // Status: "HEALTHY" || "UNHEALTHY",
178+
* // StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
179+
* // LastUpdatedTime: new Date("TIMESTAMP"),
180+
* // },
175181
* // },
176182
* // };
177183
*

clients/client-budgets/src/commands/DescribeBudgetPerformanceHistoryCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ export interface DescribeBudgetPerformanceHistoryCommandOutput
7575
* // UseAmortized: true || false,
7676
* // },
7777
* // TimeUnit: "DAILY" || "MONTHLY" || "QUARTERLY" || "ANNUALLY",
78+
* // BillingViewArn: "STRING_VALUE",
7879
* // BudgetedAndActualAmountsList: [ // BudgetedAndActualAmountsList
7980
* // { // BudgetedAndActualAmounts
8081
* // BudgetedAmount: { // Spend

clients/client-budgets/src/commands/DescribeBudgetsCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ export interface DescribeBudgetsCommandOutput extends DescribeBudgetsResponse, _
174174
* // Metrics: [ // Metrics
175175
* // "BlendedCost" || "UnblendedCost" || "AmortizedCost" || "NetUnblendedCost" || "NetAmortizedCost" || "UsageQuantity" || "NormalizedUsageAmount" || "Hours",
176176
* // ],
177+
* // BillingViewArn: "STRING_VALUE",
178+
* // HealthStatus: { // HealthStatus
179+
* // Status: "HEALTHY" || "UNHEALTHY",
180+
* // StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
181+
* // LastUpdatedTime: new Date("TIMESTAMP"),
182+
* // },
177183
* // },
178184
* // ],
179185
* // NextToken: "STRING_VALUE",

clients/client-budgets/src/commands/UpdateBudgetCommand.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ export interface UpdateBudgetCommandOutput extends UpdateBudgetResponse, __Metad
174174
* Metrics: [ // Metrics
175175
* "BlendedCost" || "UnblendedCost" || "AmortizedCost" || "NetUnblendedCost" || "NetAmortizedCost" || "UsageQuantity" || "NormalizedUsageAmount" || "Hours",
176176
* ],
177+
* BillingViewArn: "STRING_VALUE",
178+
* HealthStatus: { // HealthStatus
179+
* Status: "HEALTHY" || "UNHEALTHY",
180+
* StatusReason: "BILLING_VIEW_NO_ACCESS" || "BILLING_VIEW_UNHEALTHY" || "FILTER_INVALID",
181+
* LastUpdatedTime: new Date("TIMESTAMP"),
182+
* },
177183
* },
178184
* };
179185
* const command = new UpdateBudgetCommand(input);

clients/client-budgets/src/models/models_0.ts

Lines changed: 123 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,77 @@ export interface TagValues {
824824
MatchOptions?: MatchOption[] | undefined;
825825
}
826826

827+
/**
828+
* @public
829+
* @enum
830+
*/
831+
export const HealthStatusValue = {
832+
HEALTHY: "HEALTHY",
833+
UNHEALTHY: "UNHEALTHY",
834+
} as const;
835+
836+
/**
837+
* @public
838+
*/
839+
export type HealthStatusValue = (typeof HealthStatusValue)[keyof typeof HealthStatusValue];
840+
841+
/**
842+
* @public
843+
* @enum
844+
*/
845+
export const HealthStatusReason = {
846+
BILLING_VIEW_NO_ACCESS: "BILLING_VIEW_NO_ACCESS",
847+
BILLING_VIEW_UNHEALTHY: "BILLING_VIEW_UNHEALTHY",
848+
FILTER_INVALID: "FILTER_INVALID",
849+
} as const;
850+
851+
/**
852+
* @public
853+
*/
854+
export type HealthStatusReason = (typeof HealthStatusReason)[keyof typeof HealthStatusReason];
855+
856+
/**
857+
* <p>Provides information about the current operational state of a billing view resource,
858+
* including its ability to access and update based on its associated billing view.</p>
859+
* @public
860+
*/
861+
export interface HealthStatus {
862+
/**
863+
* <p>The current status of the billing view resource.</p>
864+
* @public
865+
*/
866+
Status?: HealthStatusValue | undefined;
867+
868+
/**
869+
* <p>The reason for the current status.</p>
870+
* <ul>
871+
* <li>
872+
* <p>
873+
* <code>BILLING_VIEW_NO_ACCESS</code>: The billing view resource does not grant
874+
* <code>billing:GetBillingViewData</code> permission to this account.</p>
875+
* </li>
876+
* <li>
877+
* <p>
878+
* <code>BILLING_VIEW_UNHEALTHY</code>: The billing view associated with the
879+
* budget is unhealthy.</p>
880+
* </li>
881+
* <li>
882+
* <p>
883+
* <code>FILTER_INVALID</code>: The filter contains reference to an account you
884+
* do not have access to.</p>
885+
* </li>
886+
* </ul>
887+
* @public
888+
*/
889+
StatusReason?: HealthStatusReason | undefined;
890+
891+
/**
892+
* <p> A generic time stamp. In Java, it's transformed to a <code>Date</code> object.</p>
893+
* @public
894+
*/
895+
LastUpdatedTime?: Date | undefined;
896+
}
897+
827898
/**
828899
* @public
829900
* @enum
@@ -1139,6 +1210,32 @@ export class InvalidParameterException extends __BaseException {
11391210
}
11401211
}
11411212

1213+
/**
1214+
* <p>We can’t locate the resource that you specified.</p>
1215+
* @public
1216+
*/
1217+
export class NotFoundException extends __BaseException {
1218+
readonly name: "NotFoundException" = "NotFoundException";
1219+
readonly $fault: "client" = "client";
1220+
/**
1221+
* <p>The error message the exception carries.</p>
1222+
* @public
1223+
*/
1224+
Message?: string | undefined;
1225+
/**
1226+
* @internal
1227+
*/
1228+
constructor(opts: __ExceptionOptionType<NotFoundException, __BaseException>) {
1229+
super({
1230+
name: "NotFoundException",
1231+
$fault: "client",
1232+
...opts,
1233+
});
1234+
Object.setPrototypeOf(this, NotFoundException.prototype);
1235+
this.Message = opts.Message;
1236+
}
1237+
}
1238+
11421239
/**
11431240
* <p>You've reached the limit on the number of tags you can associate with a resource.</p>
11441241
* @public
@@ -1291,32 +1388,6 @@ export interface CreateBudgetActionResponse {
12911388
ActionId: string | undefined;
12921389
}
12931390

1294-
/**
1295-
* <p>We can’t locate the resource that you specified.</p>
1296-
* @public
1297-
*/
1298-
export class NotFoundException extends __BaseException {
1299-
readonly name: "NotFoundException" = "NotFoundException";
1300-
readonly $fault: "client" = "client";
1301-
/**
1302-
* <p>The error message the exception carries.</p>
1303-
* @public
1304-
*/
1305-
Message?: string | undefined;
1306-
/**
1307-
* @internal
1308-
*/
1309-
constructor(opts: __ExceptionOptionType<NotFoundException, __BaseException>) {
1310-
super({
1311-
name: "NotFoundException",
1312-
$fault: "client",
1313-
...opts,
1314-
});
1315-
Object.setPrototypeOf(this, NotFoundException.prototype);
1316-
this.Message = opts.Message;
1317-
}
1318-
}
1319-
13201391
/**
13211392
* <p> Request of CreateNotification </p>
13221393
* @public
@@ -2010,6 +2081,16 @@ export interface BudgetPerformanceHistory {
20102081
*/
20112082
TimeUnit?: TimeUnit | undefined;
20122083

2084+
/**
2085+
* <p>The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is
2086+
* used to specify which particular billing view you want to interact with or retrieve
2087+
* information from when making API calls related to Amazon Web Services Billing and Cost
2088+
* Management features. The BillingViewArn can be retrieved by calling the ListBillingViews
2089+
* API.</p>
2090+
* @public
2091+
*/
2092+
BillingViewArn?: string | undefined;
2093+
20132094
/**
20142095
* <p>A list of amounts of cost or usage that you created budgets for, which are compared to
20152096
* your actual costs or usage.</p>
@@ -2715,6 +2796,22 @@ export interface Budget {
27152796
* @public
27162797
*/
27172798
Metrics?: Metric[] | undefined;
2799+
2800+
/**
2801+
* <p>The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is
2802+
* used to specify which particular billing view you want to interact with or retrieve
2803+
* information from when making API calls related to Amazon Web Services Billing and Cost
2804+
* Management features. The BillingViewArn can be retrieved by calling the ListBillingViews
2805+
* API.</p>
2806+
* @public
2807+
*/
2808+
BillingViewArn?: string | undefined;
2809+
2810+
/**
2811+
* <p>The current operational state of a Billing View derived resource.</p>
2812+
* @public
2813+
*/
2814+
HealthStatus?: HealthStatus | undefined;
27182815
}
27192816

27202817
/**

clients/client-budgets/src/protocols/Aws_json1_1.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ import {
127127
ExpiredNextTokenException,
128128
Expression,
129129
ExpressionDimensionValues,
130+
HealthStatus,
130131
HistoricalOptions,
131132
IamActionDefinition,
132133
InternalErrorException,
@@ -1040,15 +1041,15 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
10401041
case "InvalidParameterException":
10411042
case "com.amazonaws.budgets#InvalidParameterException":
10421043
throw await de_InvalidParameterExceptionRes(parsedOutput, context);
1044+
case "NotFoundException":
1045+
case "com.amazonaws.budgets#NotFoundException":
1046+
throw await de_NotFoundExceptionRes(parsedOutput, context);
10431047
case "ServiceQuotaExceededException":
10441048
case "com.amazonaws.budgets#ServiceQuotaExceededException":
10451049
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
10461050
case "ThrottlingException":
10471051
case "com.amazonaws.budgets#ThrottlingException":
10481052
throw await de_ThrottlingExceptionRes(parsedOutput, context);
1049-
case "NotFoundException":
1050-
case "com.amazonaws.budgets#NotFoundException":
1051-
throw await de_NotFoundExceptionRes(parsedOutput, context);
10521053
case "ResourceLockedException":
10531054
case "com.amazonaws.budgets#ResourceLockedException":
10541055
throw await de_ResourceLockedExceptionRes(parsedOutput, context);
@@ -1265,13 +1266,15 @@ const se_AutoAdjustData = (input: AutoAdjustData, context: __SerdeContext): any
12651266
const se_Budget = (input: Budget, context: __SerdeContext): any => {
12661267
return take(input, {
12671268
AutoAdjustData: (_) => se_AutoAdjustData(_, context),
1269+
BillingViewArn: [],
12681270
BudgetLimit: _json,
12691271
BudgetName: [],
12701272
BudgetType: [],
12711273
CalculatedSpend: _json,
12721274
CostFilters: _json,
12731275
CostTypes: _json,
12741276
FilterExpression: (_) => se_Expression(_, context),
1277+
HealthStatus: (_) => se_HealthStatus(_, context),
12751278
LastUpdatedTime: (_) => _.getTime() / 1_000,
12761279
Metrics: _json,
12771280
PlannedBudgetLimits: _json,
@@ -1467,6 +1470,17 @@ const se_Expressions = (input: Expression[], context: __SerdeContext): any => {
14671470

14681471
// se_Groups omitted.
14691472

1473+
/**
1474+
* serializeAws_json1_1HealthStatus
1475+
*/
1476+
const se_HealthStatus = (input: HealthStatus, context: __SerdeContext): any => {
1477+
return take(input, {
1478+
LastUpdatedTime: (_) => _.getTime() / 1_000,
1479+
Status: [],
1480+
StatusReason: [],
1481+
});
1482+
};
1483+
14701484
// se_HistoricalOptions omitted.
14711485

14721486
// se_IamActionDefinition omitted.
@@ -1700,13 +1714,15 @@ const de_AutoAdjustData = (output: any, context: __SerdeContext): AutoAdjustData
17001714
const de_Budget = (output: any, context: __SerdeContext): Budget => {
17011715
return take(output, {
17021716
AutoAdjustData: (_: any) => de_AutoAdjustData(_, context),
1717+
BillingViewArn: __expectString,
17031718
BudgetLimit: _json,
17041719
BudgetName: __expectString,
17051720
BudgetType: __expectString,
17061721
CalculatedSpend: _json,
17071722
CostFilters: _json,
17081723
CostTypes: _json,
17091724
FilterExpression: (_: any) => de_Expression(_, context),
1725+
HealthStatus: (_: any) => de_HealthStatus(_, context),
17101726
LastUpdatedTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
17111727
Metrics: _json,
17121728
PlannedBudgetLimits: _json,
@@ -1768,6 +1784,7 @@ const de_BudgetNotificationsForAccountList = (
17681784
*/
17691785
const de_BudgetPerformanceHistory = (output: any, context: __SerdeContext): BudgetPerformanceHistory => {
17701786
return take(output, {
1787+
BillingViewArn: __expectString,
17711788
BudgetName: __expectString,
17721789
BudgetType: __expectString,
17731790
BudgetedAndActualAmountsList: (_: any) => de_BudgetedAndActualAmountsList(_, context),
@@ -1974,6 +1991,17 @@ const de_Expressions = (output: any, context: __SerdeContext): Expression[] => {
19741991

19751992
// de_Groups omitted.
19761993

1994+
/**
1995+
* deserializeAws_json1_1HealthStatus
1996+
*/
1997+
const de_HealthStatus = (output: any, context: __SerdeContext): HealthStatus => {
1998+
return take(output, {
1999+
LastUpdatedTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
2000+
Status: __expectString,
2001+
StatusReason: __expectString,
2002+
}) as any;
2003+
};
2004+
19772005
// de_HistoricalOptions omitted.
19782006

19792007
// de_IamActionDefinition omitted.

0 commit comments

Comments
 (0)