Skip to content

Commit e7333b8

Browse files
author
awstools
committed
feat(client-cloudtrail): Add ThrottlingException with error code 429 to handle CloudTrail Delegated Admin request rate exceeded on organization resources.
1 parent ae8e27c commit e7333b8

File tree

11 files changed

+152
-0
lines changed

11 files changed

+152
-0
lines changed

clients/client-cloudtrail/src/commands/CreateTrailCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,11 @@ export interface CreateTrailCommandOutput extends CreateTrailResponse, __Metadat
216216
* <p>The number of tags per trail, event data store, or channel has exceeded the permitted amount. Currently, the limit is
217217
* 50.</p>
218218
*
219+
* @throws {@link ThrottlingException} (client fault)
220+
* <p>
221+
* This exception is thrown when the request rate exceeds the limit.
222+
* </p>
223+
*
219224
* @throws {@link TrailAlreadyExistsException} (client fault)
220225
* <p>This exception is thrown when the specified trail already exists.</p>
221226
*

clients/client-cloudtrail/src/commands/DeleteTrailCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ export interface DeleteTrailCommandOutput extends DeleteTrailResponse, __Metadat
124124
* @throws {@link OperationNotPermittedException} (client fault)
125125
* <p>This exception is thrown when the requested operation is not permitted.</p>
126126
*
127+
* @throws {@link ThrottlingException} (client fault)
128+
* <p>
129+
* This exception is thrown when the request rate exceeds the limit.
130+
* </p>
131+
*
127132
* @throws {@link TrailNotFoundException} (client fault)
128133
* <p>This exception is thrown when the trail with the given name is not found.</p>
129134
*

clients/client-cloudtrail/src/commands/GetInsightSelectorsCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ export interface GetInsightSelectorsCommandOutput extends GetInsightSelectorsRes
120120
* @throws {@link OperationNotPermittedException} (client fault)
121121
* <p>This exception is thrown when the requested operation is not permitted.</p>
122122
*
123+
* @throws {@link ThrottlingException} (client fault)
124+
* <p>
125+
* This exception is thrown when the request rate exceeds the limit.
126+
* </p>
127+
*
123128
* @throws {@link TrailNotFoundException} (client fault)
124129
* <p>This exception is thrown when the trail with the given name is not found.</p>
125130
*

clients/client-cloudtrail/src/commands/PutEventSelectorsCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ export interface PutEventSelectorsCommandOutput extends PutEventSelectorsRespons
284284
* @throws {@link OperationNotPermittedException} (client fault)
285285
* <p>This exception is thrown when the requested operation is not permitted.</p>
286286
*
287+
* @throws {@link ThrottlingException} (client fault)
288+
* <p>
289+
* This exception is thrown when the request rate exceeds the limit.
290+
* </p>
291+
*
287292
* @throws {@link TrailNotFoundException} (client fault)
288293
* <p>This exception is thrown when the trail with the given name is not found.</p>
289294
*

clients/client-cloudtrail/src/commands/PutInsightSelectorsCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ export interface PutInsightSelectorsCommandOutput extends PutInsightSelectorsRes
152152
* @throws {@link S3BucketDoesNotExistException} (client fault)
153153
* <p>This exception is thrown when the specified S3 bucket does not exist.</p>
154154
*
155+
* @throws {@link ThrottlingException} (client fault)
156+
* <p>
157+
* This exception is thrown when the request rate exceeds the limit.
158+
* </p>
159+
*
155160
* @throws {@link TrailNotFoundException} (client fault)
156161
* <p>This exception is thrown when the trail with the given name is not found.</p>
157162
*

clients/client-cloudtrail/src/commands/StartLoggingCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ export interface StartLoggingCommandOutput extends StartLoggingResponse, __Metad
125125
* @throws {@link OperationNotPermittedException} (client fault)
126126
* <p>This exception is thrown when the requested operation is not permitted.</p>
127127
*
128+
* @throws {@link ThrottlingException} (client fault)
129+
* <p>
130+
* This exception is thrown when the request rate exceeds the limit.
131+
* </p>
132+
*
128133
* @throws {@link TrailNotFoundException} (client fault)
129134
* <p>This exception is thrown when the trail with the given name is not found.</p>
130135
*

clients/client-cloudtrail/src/commands/StopLoggingCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ export interface StopLoggingCommandOutput extends StopLoggingResponse, __Metadat
128128
* @throws {@link OperationNotPermittedException} (client fault)
129129
* <p>This exception is thrown when the requested operation is not permitted.</p>
130130
*
131+
* @throws {@link ThrottlingException} (client fault)
132+
* <p>
133+
* This exception is thrown when the request rate exceeds the limit.
134+
* </p>
135+
*
131136
* @throws {@link TrailNotFoundException} (client fault)
132137
* <p>This exception is thrown when the trail with the given name is not found.</p>
133138
*

clients/client-cloudtrail/src/commands/UpdateTrailCommand.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ export interface UpdateTrailCommandOutput extends UpdateTrailResponse, __Metadat
254254
* @throws {@link S3BucketDoesNotExistException} (client fault)
255255
* <p>This exception is thrown when the specified S3 bucket does not exist.</p>
256256
*
257+
* @throws {@link ThrottlingException} (client fault)
258+
* <p>
259+
* This exception is thrown when the request rate exceeds the limit.
260+
* </p>
261+
*
257262
* @throws {@link TrailNotFoundException} (client fault)
258263
* <p>This exception is thrown when the trail with the given name is not found.</p>
259264
*

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,6 +2747,34 @@ export class S3BucketDoesNotExistException extends __BaseException {
27472747
}
27482748
}
27492749

2750+
/**
2751+
* @public
2752+
* <p>
2753+
* This exception is thrown when the request rate exceeds the limit.
2754+
* </p>
2755+
*/
2756+
export class ThrottlingException extends __BaseException {
2757+
readonly name: "ThrottlingException" = "ThrottlingException";
2758+
readonly $fault: "client" = "client";
2759+
/**
2760+
* @public
2761+
* <p>Brief description of the exception returned by the request.</p>
2762+
*/
2763+
Message?: string;
2764+
/**
2765+
* @internal
2766+
*/
2767+
constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>) {
2768+
super({
2769+
name: "ThrottlingException",
2770+
$fault: "client",
2771+
...opts,
2772+
});
2773+
Object.setPrototypeOf(this, ThrottlingException.prototype);
2774+
this.Message = opts.Message;
2775+
}
2776+
}
2777+
27502778
/**
27512779
* @public
27522780
* <p>This exception is thrown when the specified trail already exists.</p>

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ import {
256256
StopLoggingRequest,
257257
Tag,
258258
TagsLimitExceededException,
259+
ThrottlingException,
259260
TrailAlreadyExistsException,
260261
TrailNotFoundException,
261262
TrailNotProvidedException,
@@ -1321,6 +1322,9 @@ const de_CreateTrailCommandError = async (
13211322
case "TagsLimitExceededException":
13221323
case "com.amazonaws.cloudtrail#TagsLimitExceededException":
13231324
throw await de_TagsLimitExceededExceptionRes(parsedOutput, context);
1325+
case "ThrottlingException":
1326+
case "com.amazonaws.cloudtrail#ThrottlingException":
1327+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
13241328
case "TrailAlreadyExistsException":
13251329
case "com.amazonaws.cloudtrail#TrailAlreadyExistsException":
13261330
throw await de_TrailAlreadyExistsExceptionRes(parsedOutput, context);
@@ -1592,6 +1596,9 @@ const de_DeleteTrailCommandError = async (
15921596
case "OperationNotPermittedException":
15931597
case "com.amazonaws.cloudtrail#OperationNotPermittedException":
15941598
throw await de_OperationNotPermittedExceptionRes(parsedOutput, context);
1599+
case "ThrottlingException":
1600+
case "com.amazonaws.cloudtrail#ThrottlingException":
1601+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
15951602
case "TrailNotFoundException":
15961603
case "com.amazonaws.cloudtrail#TrailNotFoundException":
15971604
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -2086,6 +2093,9 @@ const de_GetInsightSelectorsCommandError = async (
20862093
case "OperationNotPermittedException":
20872094
case "com.amazonaws.cloudtrail#OperationNotPermittedException":
20882095
throw await de_OperationNotPermittedExceptionRes(parsedOutput, context);
2096+
case "ThrottlingException":
2097+
case "com.amazonaws.cloudtrail#ThrottlingException":
2098+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
20892099
case "TrailNotFoundException":
20902100
case "com.amazonaws.cloudtrail#TrailNotFoundException":
20912101
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -2958,6 +2968,9 @@ const de_PutEventSelectorsCommandError = async (
29582968
case "OperationNotPermittedException":
29592969
case "com.amazonaws.cloudtrail#OperationNotPermittedException":
29602970
throw await de_OperationNotPermittedExceptionRes(parsedOutput, context);
2971+
case "ThrottlingException":
2972+
case "com.amazonaws.cloudtrail#ThrottlingException":
2973+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
29612974
case "TrailNotFoundException":
29622975
case "com.amazonaws.cloudtrail#TrailNotFoundException":
29632976
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -3040,6 +3053,9 @@ const de_PutInsightSelectorsCommandError = async (
30403053
case "S3BucketDoesNotExistException":
30413054
case "com.amazonaws.cloudtrail#S3BucketDoesNotExistException":
30423055
throw await de_S3BucketDoesNotExistExceptionRes(parsedOutput, context);
3056+
case "ThrottlingException":
3057+
case "com.amazonaws.cloudtrail#ThrottlingException":
3058+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
30433059
case "TrailNotFoundException":
30443060
case "com.amazonaws.cloudtrail#TrailNotFoundException":
30453061
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -3575,6 +3591,9 @@ const de_StartLoggingCommandError = async (
35753591
case "OperationNotPermittedException":
35763592
case "com.amazonaws.cloudtrail#OperationNotPermittedException":
35773593
throw await de_OperationNotPermittedExceptionRes(parsedOutput, context);
3594+
case "ThrottlingException":
3595+
case "com.amazonaws.cloudtrail#ThrottlingException":
3596+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
35783597
case "TrailNotFoundException":
35793598
case "com.amazonaws.cloudtrail#TrailNotFoundException":
35803599
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -3861,6 +3880,9 @@ const de_StopLoggingCommandError = async (
38613880
case "OperationNotPermittedException":
38623881
case "com.amazonaws.cloudtrail#OperationNotPermittedException":
38633882
throw await de_OperationNotPermittedExceptionRes(parsedOutput, context);
3883+
case "ThrottlingException":
3884+
case "com.amazonaws.cloudtrail#ThrottlingException":
3885+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
38643886
case "TrailNotFoundException":
38653887
case "com.amazonaws.cloudtrail#TrailNotFoundException":
38663888
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -4170,6 +4192,9 @@ const de_UpdateTrailCommandError = async (
41704192
case "S3BucketDoesNotExistException":
41714193
case "com.amazonaws.cloudtrail#S3BucketDoesNotExistException":
41724194
throw await de_S3BucketDoesNotExistExceptionRes(parsedOutput, context);
4195+
case "ThrottlingException":
4196+
case "com.amazonaws.cloudtrail#ThrottlingException":
4197+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
41734198
case "TrailNotFoundException":
41744199
case "com.amazonaws.cloudtrail#TrailNotFoundException":
41754200
throw await de_TrailNotFoundExceptionRes(parsedOutput, context);
@@ -5383,6 +5408,19 @@ const de_TagsLimitExceededExceptionRes = async (
53835408
return __decorateServiceException(exception, body);
53845409
};
53855410

5411+
/**
5412+
* deserializeAws_json1_1ThrottlingExceptionRes
5413+
*/
5414+
const de_ThrottlingExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise<ThrottlingException> => {
5415+
const body = parsedOutput.body;
5416+
const deserialized: any = _json(body);
5417+
const exception = new ThrottlingException({
5418+
$metadata: deserializeMetadata(parsedOutput),
5419+
...deserialized,
5420+
});
5421+
return __decorateServiceException(exception, body);
5422+
};
5423+
53865424
/**
53875425
* deserializeAws_json1_1TrailAlreadyExistsExceptionRes
53885426
*/
@@ -6307,6 +6345,8 @@ const de_StopImportResponse = (output: any, context: __SerdeContext): StopImport
63076345

63086346
// de_TagsList omitted.
63096347

6348+
// de_ThrottlingException omitted.
6349+
63106350
// de_Trail omitted.
63116351

63126352
// de_TrailAlreadyExistsException omitted.

codegen/sdk-codegen/aws-models/cloudtrail.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,9 @@
22722272
{
22732273
"target": "com.amazonaws.cloudtrail#TagsLimitExceededException"
22742274
},
2275+
{
2276+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
2277+
},
22752278
{
22762279
"target": "com.amazonaws.cloudtrail#TrailAlreadyExistsException"
22772280
},
@@ -2718,6 +2721,9 @@
27182721
{
27192722
"target": "com.amazonaws.cloudtrail#OperationNotPermittedException"
27202723
},
2724+
{
2725+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
2726+
},
27212727
{
27222728
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
27232729
},
@@ -3958,6 +3964,9 @@
39583964
{
39593965
"target": "com.amazonaws.cloudtrail#OperationNotPermittedException"
39603966
},
3967+
{
3968+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
3969+
},
39613970
{
39623971
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
39633972
},
@@ -6649,6 +6658,9 @@
66496658
{
66506659
"target": "com.amazonaws.cloudtrail#OperationNotPermittedException"
66516660
},
6661+
{
6662+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
6663+
},
66526664
{
66536665
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
66546666
},
@@ -6756,6 +6768,9 @@
67566768
{
67576769
"target": "com.amazonaws.cloudtrail#S3BucketDoesNotExistException"
67586770
},
6771+
{
6772+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
6773+
},
67596774
{
67606775
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
67616776
},
@@ -7973,6 +7988,9 @@
79737988
{
79747989
"target": "com.amazonaws.cloudtrail#OperationNotPermittedException"
79757990
},
7991+
{
7992+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
7993+
},
79767994
{
79777995
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
79787996
},
@@ -8314,6 +8332,9 @@
83148332
{
83158333
"target": "com.amazonaws.cloudtrail#OperationNotPermittedException"
83168334
},
8335+
{
8336+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
8337+
},
83178338
{
83188339
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
83198340
},
@@ -8428,6 +8449,26 @@
84288449
"com.amazonaws.cloudtrail#TerminationProtectionEnabled": {
84298450
"type": "boolean"
84308451
},
8452+
"com.amazonaws.cloudtrail#ThrottlingException": {
8453+
"type": "structure",
8454+
"members": {
8455+
"Message": {
8456+
"target": "com.amazonaws.cloudtrail#ErrorMessage",
8457+
"traits": {
8458+
"smithy.api#documentation": "<p>Brief description of the exception returned by the request.</p>"
8459+
}
8460+
}
8461+
},
8462+
"traits": {
8463+
"aws.protocols#awsQueryError": {
8464+
"code": "ThrottlingException",
8465+
"httpResponseCode": 429
8466+
},
8467+
"smithy.api#documentation": "<p>\n This exception is thrown when the request rate exceeds the limit. \n </p>",
8468+
"smithy.api#error": "client",
8469+
"smithy.api#httpError": 429
8470+
}
8471+
},
84318472
"com.amazonaws.cloudtrail#Trail": {
84328473
"type": "structure",
84338474
"members": {
@@ -9070,6 +9111,9 @@
90709111
{
90719112
"target": "com.amazonaws.cloudtrail#S3BucketDoesNotExistException"
90729113
},
9114+
{
9115+
"target": "com.amazonaws.cloudtrail#ThrottlingException"
9116+
},
90739117
{
90749118
"target": "com.amazonaws.cloudtrail#TrailNotFoundException"
90759119
},

0 commit comments

Comments
 (0)