Skip to content

Commit 30b277c

Browse files
author
awstools
committed
feat(client-lambda): Release Lambda FunctionRecursiveConfig, enabling customers to turn recursive loop detection on or off on individual functions. This release adds two new APIs, GetFunctionRecursionConfig and PutFunctionRecursionConfig.
1 parent d9a4bcc commit 30b277c

17 files changed

+793
-46
lines changed

clients/client-lambda/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,14 @@ GetFunctionEventInvokeConfig
475475

476476
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/GetFunctionEventInvokeConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetFunctionEventInvokeConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetFunctionEventInvokeConfigCommandOutput/)
477477

478+
</details>
479+
<details>
480+
<summary>
481+
GetFunctionRecursionConfig
482+
</summary>
483+
484+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/GetFunctionRecursionConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetFunctionRecursionConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/GetFunctionRecursionConfigCommandOutput/)
485+
478486
</details>
479487
<details>
480488
<summary>
@@ -691,6 +699,14 @@ PutFunctionEventInvokeConfig
691699

692700
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/PutFunctionEventInvokeConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutFunctionEventInvokeConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutFunctionEventInvokeConfigCommandOutput/)
693701

702+
</details>
703+
<details>
704+
<summary>
705+
PutFunctionRecursionConfig
706+
</summary>
707+
708+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lambda/command/PutFunctionRecursionConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutFunctionRecursionConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lambda/Interface/PutFunctionRecursionConfigCommandOutput/)
709+
694710
</details>
695711
<details>
696712
<summary>

clients/client-lambda/src/Lambda.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ import {
116116
GetFunctionEventInvokeConfigCommandInput,
117117
GetFunctionEventInvokeConfigCommandOutput,
118118
} from "./commands/GetFunctionEventInvokeConfigCommand";
119+
import {
120+
GetFunctionRecursionConfigCommand,
121+
GetFunctionRecursionConfigCommandInput,
122+
GetFunctionRecursionConfigCommandOutput,
123+
} from "./commands/GetFunctionRecursionConfigCommand";
119124
import {
120125
GetFunctionUrlConfigCommand,
121126
GetFunctionUrlConfigCommandInput,
@@ -227,6 +232,11 @@ import {
227232
PutFunctionEventInvokeConfigCommandInput,
228233
PutFunctionEventInvokeConfigCommandOutput,
229234
} from "./commands/PutFunctionEventInvokeConfigCommand";
235+
import {
236+
PutFunctionRecursionConfigCommand,
237+
PutFunctionRecursionConfigCommandInput,
238+
PutFunctionRecursionConfigCommandOutput,
239+
} from "./commands/PutFunctionRecursionConfigCommand";
230240
import {
231241
PutProvisionedConcurrencyConfigCommand,
232242
PutProvisionedConcurrencyConfigCommandInput,
@@ -313,6 +323,7 @@ const commands = {
313323
GetFunctionConcurrencyCommand,
314324
GetFunctionConfigurationCommand,
315325
GetFunctionEventInvokeConfigCommand,
326+
GetFunctionRecursionConfigCommand,
316327
GetFunctionUrlConfigCommand,
317328
GetLayerVersionCommand,
318329
GetLayerVersionByArnCommand,
@@ -340,6 +351,7 @@ const commands = {
340351
PutFunctionCodeSigningConfigCommand,
341352
PutFunctionConcurrencyCommand,
342353
PutFunctionEventInvokeConfigCommand,
354+
PutFunctionRecursionConfigCommand,
343355
PutProvisionedConcurrencyConfigCommand,
344356
PutRuntimeManagementConfigCommand,
345357
RemoveLayerVersionPermissionCommand,
@@ -763,6 +775,23 @@ export interface Lambda {
763775
cb: (err: any, data?: GetFunctionEventInvokeConfigCommandOutput) => void
764776
): void;
765777

778+
/**
779+
* @see {@link GetFunctionRecursionConfigCommand}
780+
*/
781+
getFunctionRecursionConfig(
782+
args: GetFunctionRecursionConfigCommandInput,
783+
options?: __HttpHandlerOptions
784+
): Promise<GetFunctionRecursionConfigCommandOutput>;
785+
getFunctionRecursionConfig(
786+
args: GetFunctionRecursionConfigCommandInput,
787+
cb: (err: any, data?: GetFunctionRecursionConfigCommandOutput) => void
788+
): void;
789+
getFunctionRecursionConfig(
790+
args: GetFunctionRecursionConfigCommandInput,
791+
options: __HttpHandlerOptions,
792+
cb: (err: any, data?: GetFunctionRecursionConfigCommandOutput) => void
793+
): void;
794+
766795
/**
767796
* @see {@link GetFunctionUrlConfigCommand}
768797
*/
@@ -1178,6 +1207,23 @@ export interface Lambda {
11781207
cb: (err: any, data?: PutFunctionEventInvokeConfigCommandOutput) => void
11791208
): void;
11801209

1210+
/**
1211+
* @see {@link PutFunctionRecursionConfigCommand}
1212+
*/
1213+
putFunctionRecursionConfig(
1214+
args: PutFunctionRecursionConfigCommandInput,
1215+
options?: __HttpHandlerOptions
1216+
): Promise<PutFunctionRecursionConfigCommandOutput>;
1217+
putFunctionRecursionConfig(
1218+
args: PutFunctionRecursionConfigCommandInput,
1219+
cb: (err: any, data?: PutFunctionRecursionConfigCommandOutput) => void
1220+
): void;
1221+
putFunctionRecursionConfig(
1222+
args: PutFunctionRecursionConfigCommandInput,
1223+
options: __HttpHandlerOptions,
1224+
cb: (err: any, data?: PutFunctionRecursionConfigCommandOutput) => void
1225+
): void;
1226+
11811227
/**
11821228
* @see {@link PutProvisionedConcurrencyConfigCommand}
11831229
*/

clients/client-lambda/src/LambdaClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ import {
136136
GetFunctionEventInvokeConfigCommandInput,
137137
GetFunctionEventInvokeConfigCommandOutput,
138138
} from "./commands/GetFunctionEventInvokeConfigCommand";
139+
import {
140+
GetFunctionRecursionConfigCommandInput,
141+
GetFunctionRecursionConfigCommandOutput,
142+
} from "./commands/GetFunctionRecursionConfigCommand";
139143
import {
140144
GetFunctionUrlConfigCommandInput,
141145
GetFunctionUrlConfigCommandOutput,
@@ -214,6 +218,10 @@ import {
214218
PutFunctionEventInvokeConfigCommandInput,
215219
PutFunctionEventInvokeConfigCommandOutput,
216220
} from "./commands/PutFunctionEventInvokeConfigCommand";
221+
import {
222+
PutFunctionRecursionConfigCommandInput,
223+
PutFunctionRecursionConfigCommandOutput,
224+
} from "./commands/PutFunctionRecursionConfigCommand";
217225
import {
218226
PutProvisionedConcurrencyConfigCommandInput,
219227
PutProvisionedConcurrencyConfigCommandOutput,
@@ -292,6 +300,7 @@ export type ServiceInputTypes =
292300
| GetFunctionConcurrencyCommandInput
293301
| GetFunctionConfigurationCommandInput
294302
| GetFunctionEventInvokeConfigCommandInput
303+
| GetFunctionRecursionConfigCommandInput
295304
| GetFunctionUrlConfigCommandInput
296305
| GetLayerVersionByArnCommandInput
297306
| GetLayerVersionCommandInput
@@ -319,6 +328,7 @@ export type ServiceInputTypes =
319328
| PutFunctionCodeSigningConfigCommandInput
320329
| PutFunctionConcurrencyCommandInput
321330
| PutFunctionEventInvokeConfigCommandInput
331+
| PutFunctionRecursionConfigCommandInput
322332
| PutProvisionedConcurrencyConfigCommandInput
323333
| PutRuntimeManagementConfigCommandInput
324334
| RemoveLayerVersionPermissionCommandInput
@@ -363,6 +373,7 @@ export type ServiceOutputTypes =
363373
| GetFunctionConcurrencyCommandOutput
364374
| GetFunctionConfigurationCommandOutput
365375
| GetFunctionEventInvokeConfigCommandOutput
376+
| GetFunctionRecursionConfigCommandOutput
366377
| GetFunctionUrlConfigCommandOutput
367378
| GetLayerVersionByArnCommandOutput
368379
| GetLayerVersionCommandOutput
@@ -390,6 +401,7 @@ export type ServiceOutputTypes =
390401
| PutFunctionCodeSigningConfigCommandOutput
391402
| PutFunctionConcurrencyCommandOutput
392403
| PutFunctionEventInvokeConfigCommandOutput
404+
| PutFunctionRecursionConfigCommandOutput
393405
| PutProvisionedConcurrencyConfigCommandOutput
394406
| PutRuntimeManagementConfigCommandOutput
395407
| RemoveLayerVersionPermissionCommandOutput

clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,17 @@ export interface AddLayerVersionPermissionCommandOutput extends AddLayerVersionP
7171
* <p>The permissions policy for the resource is too large. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>.</p>
7272
*
7373
* @throws {@link PreconditionFailedException} (client fault)
74-
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the <code>GetFunction</code> or the <code>GetAlias</code>
75-
* API operation to retrieve the latest RevisionId for your resource.</p>
74+
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.</p>
75+
* <ul>
76+
* <li>
77+
* <p>
78+
* <b>For AddPermission and RemovePermission API operations:</b> Call <code>GetPolicy</code> to retrieve the latest RevisionId for your resource.</p>
79+
* </li>
80+
* <li>
81+
* <p>
82+
* <b>For all other API operations:</b> Call <code>GetFunction</code> or <code>GetAlias</code> to retrieve the latest RevisionId for your resource.</p>
83+
* </li>
84+
* </ul>
7685
*
7786
* @throws {@link ResourceConflictException} (client fault)
7887
* <p>The resource already exists, or another operation is in progress.</p>

clients/client-lambda/src/commands/AddPermissionCommand.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,17 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met
8181
* <p>The permissions policy for the resource is too large. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>.</p>
8282
*
8383
* @throws {@link PreconditionFailedException} (client fault)
84-
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the <code>GetFunction</code> or the <code>GetAlias</code>
85-
* API operation to retrieve the latest RevisionId for your resource.</p>
84+
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.</p>
85+
* <ul>
86+
* <li>
87+
* <p>
88+
* <b>For AddPermission and RemovePermission API operations:</b> Call <code>GetPolicy</code> to retrieve the latest RevisionId for your resource.</p>
89+
* </li>
90+
* <li>
91+
* <p>
92+
* <b>For all other API operations:</b> Call <code>GetFunction</code> or <code>GetAlias</code> to retrieve the latest RevisionId for your resource.</p>
93+
* </li>
94+
* </ul>
8695
*
8796
* @throws {@link ResourceConflictException} (client fault)
8897
* <p>The resource already exists, or another operation is in progress.</p>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { LambdaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LambdaClient";
9+
import { GetFunctionRecursionConfigRequest, GetFunctionRecursionConfigResponse } from "../models/models_0";
10+
import { de_GetFunctionRecursionConfigCommand, se_GetFunctionRecursionConfigCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link GetFunctionRecursionConfigCommand}.
21+
*/
22+
export interface GetFunctionRecursionConfigCommandInput extends GetFunctionRecursionConfigRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link GetFunctionRecursionConfigCommand}.
27+
*/
28+
export interface GetFunctionRecursionConfigCommandOutput extends GetFunctionRecursionConfigResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns your function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/invocation-recursion.html">recursive loop detection</a> configuration.
32+
* </p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { LambdaClient, GetFunctionRecursionConfigCommand } from "@aws-sdk/client-lambda"; // ES Modules import
37+
* // const { LambdaClient, GetFunctionRecursionConfigCommand } = require("@aws-sdk/client-lambda"); // CommonJS import
38+
* const client = new LambdaClient(config);
39+
* const input = { // GetFunctionRecursionConfigRequest
40+
* FunctionName: "STRING_VALUE", // required
41+
* };
42+
* const command = new GetFunctionRecursionConfigCommand(input);
43+
* const response = await client.send(command);
44+
* // { // GetFunctionRecursionConfigResponse
45+
* // RecursiveLoop: "Allow" || "Terminate",
46+
* // };
47+
*
48+
* ```
49+
*
50+
* @param GetFunctionRecursionConfigCommandInput - {@link GetFunctionRecursionConfigCommandInput}
51+
* @returns {@link GetFunctionRecursionConfigCommandOutput}
52+
* @see {@link GetFunctionRecursionConfigCommandInput} for command's `input` shape.
53+
* @see {@link GetFunctionRecursionConfigCommandOutput} for command's `response` shape.
54+
* @see {@link LambdaClientResolvedConfig | config} for LambdaClient's `config` shape.
55+
*
56+
* @throws {@link InvalidParameterValueException} (client fault)
57+
* <p>One of the parameters in the request is not valid.</p>
58+
*
59+
* @throws {@link ResourceNotFoundException} (client fault)
60+
* <p>The resource specified in the request does not exist.</p>
61+
*
62+
* @throws {@link ServiceException} (server fault)
63+
* <p>The Lambda service encountered an internal error.</p>
64+
*
65+
* @throws {@link TooManyRequestsException} (client fault)
66+
* <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
67+
*
68+
* @throws {@link LambdaServiceException}
69+
* <p>Base exception class for all service exceptions from Lambda service.</p>
70+
*
71+
* @public
72+
*/
73+
export class GetFunctionRecursionConfigCommand extends $Command
74+
.classBuilder<
75+
GetFunctionRecursionConfigCommandInput,
76+
GetFunctionRecursionConfigCommandOutput,
77+
LambdaClientResolvedConfig,
78+
ServiceInputTypes,
79+
ServiceOutputTypes
80+
>()
81+
.ep({
82+
...commonParams,
83+
})
84+
.m(function (this: any, Command: any, cs: any, config: LambdaClientResolvedConfig, o: any) {
85+
return [
86+
getSerdePlugin(config, this.serialize, this.deserialize),
87+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
88+
];
89+
})
90+
.s("AWSGirApiService", "GetFunctionRecursionConfig", {})
91+
.n("LambdaClient", "GetFunctionRecursionConfigCommand")
92+
.f(void 0, void 0)
93+
.ser(se_GetFunctionRecursionConfigCommand)
94+
.de(de_GetFunctionRecursionConfigCommand)
95+
.build() {}

clients/client-lambda/src/commands/PublishVersionCommand.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,17 @@ export interface PublishVersionCommandOutput extends FunctionConfiguration, __Me
172172
* <p>One of the parameters in the request is not valid.</p>
173173
*
174174
* @throws {@link PreconditionFailedException} (client fault)
175-
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the <code>GetFunction</code> or the <code>GetAlias</code>
176-
* API operation to retrieve the latest RevisionId for your resource.</p>
175+
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.</p>
176+
* <ul>
177+
* <li>
178+
* <p>
179+
* <b>For AddPermission and RemovePermission API operations:</b> Call <code>GetPolicy</code> to retrieve the latest RevisionId for your resource.</p>
180+
* </li>
181+
* <li>
182+
* <p>
183+
* <b>For all other API operations:</b> Call <code>GetFunction</code> or <code>GetAlias</code> to retrieve the latest RevisionId for your resource.</p>
184+
* </li>
185+
* </ul>
177186
*
178187
* @throws {@link ResourceConflictException} (client fault)
179188
* <p>The resource already exists, or another operation is in progress.</p>

0 commit comments

Comments
 (0)