From 30b277c4334b25da5624b2d5474260d30e01d7bd Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 19 Aug 2024 18:16:45 +0000 Subject: [PATCH] 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. --- clients/client-lambda/README.md | 16 ++ clients/client-lambda/src/Lambda.ts | 46 +++++ clients/client-lambda/src/LambdaClient.ts | 12 ++ .../AddLayerVersionPermissionCommand.ts | 13 +- .../src/commands/AddPermissionCommand.ts | 13 +- .../GetFunctionRecursionConfigCommand.ts | 95 +++++++++ .../src/commands/PublishVersionCommand.ts | 13 +- .../PutFunctionRecursionConfigCommand.ts | 104 ++++++++++ .../RemoveLayerVersionPermissionCommand.ts | 13 +- .../src/commands/RemovePermissionCommand.ts | 13 +- .../src/commands/UpdateAliasCommand.ts | 13 +- .../src/commands/UpdateFunctionCodeCommand.ts | 13 +- .../UpdateFunctionConfigurationCommand.ts | 13 +- clients/client-lambda/src/commands/index.ts | 2 + clients/client-lambda/src/models/models_0.ts | 184 +++++++++++++++-- .../src/protocols/Aws_restJson1.ts | 89 +++++++++ codegen/sdk-codegen/aws-models/lambda.json | 187 ++++++++++++++++-- 17 files changed, 793 insertions(+), 46 deletions(-) create mode 100644 clients/client-lambda/src/commands/GetFunctionRecursionConfigCommand.ts create mode 100644 clients/client-lambda/src/commands/PutFunctionRecursionConfigCommand.ts diff --git a/clients/client-lambda/README.md b/clients/client-lambda/README.md index eb0b9ca6b7cc3..f29e02171dc0b 100644 --- a/clients/client-lambda/README.md +++ b/clients/client-lambda/README.md @@ -475,6 +475,14 @@ GetFunctionEventInvokeConfig [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/) + +
+ +GetFunctionRecursionConfig + + +[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/) +
@@ -691,6 +699,14 @@ PutFunctionEventInvokeConfig [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/) +
+
+ +PutFunctionRecursionConfig + + +[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/) +
diff --git a/clients/client-lambda/src/Lambda.ts b/clients/client-lambda/src/Lambda.ts index ff1c5e10a3604..f6b0e42e6bc41 100644 --- a/clients/client-lambda/src/Lambda.ts +++ b/clients/client-lambda/src/Lambda.ts @@ -116,6 +116,11 @@ import { GetFunctionEventInvokeConfigCommandInput, GetFunctionEventInvokeConfigCommandOutput, } from "./commands/GetFunctionEventInvokeConfigCommand"; +import { + GetFunctionRecursionConfigCommand, + GetFunctionRecursionConfigCommandInput, + GetFunctionRecursionConfigCommandOutput, +} from "./commands/GetFunctionRecursionConfigCommand"; import { GetFunctionUrlConfigCommand, GetFunctionUrlConfigCommandInput, @@ -227,6 +232,11 @@ import { PutFunctionEventInvokeConfigCommandInput, PutFunctionEventInvokeConfigCommandOutput, } from "./commands/PutFunctionEventInvokeConfigCommand"; +import { + PutFunctionRecursionConfigCommand, + PutFunctionRecursionConfigCommandInput, + PutFunctionRecursionConfigCommandOutput, +} from "./commands/PutFunctionRecursionConfigCommand"; import { PutProvisionedConcurrencyConfigCommand, PutProvisionedConcurrencyConfigCommandInput, @@ -313,6 +323,7 @@ const commands = { GetFunctionConcurrencyCommand, GetFunctionConfigurationCommand, GetFunctionEventInvokeConfigCommand, + GetFunctionRecursionConfigCommand, GetFunctionUrlConfigCommand, GetLayerVersionCommand, GetLayerVersionByArnCommand, @@ -340,6 +351,7 @@ const commands = { PutFunctionCodeSigningConfigCommand, PutFunctionConcurrencyCommand, PutFunctionEventInvokeConfigCommand, + PutFunctionRecursionConfigCommand, PutProvisionedConcurrencyConfigCommand, PutRuntimeManagementConfigCommand, RemoveLayerVersionPermissionCommand, @@ -763,6 +775,23 @@ export interface Lambda { cb: (err: any, data?: GetFunctionEventInvokeConfigCommandOutput) => void ): void; + /** + * @see {@link GetFunctionRecursionConfigCommand} + */ + getFunctionRecursionConfig( + args: GetFunctionRecursionConfigCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getFunctionRecursionConfig( + args: GetFunctionRecursionConfigCommandInput, + cb: (err: any, data?: GetFunctionRecursionConfigCommandOutput) => void + ): void; + getFunctionRecursionConfig( + args: GetFunctionRecursionConfigCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetFunctionRecursionConfigCommandOutput) => void + ): void; + /** * @see {@link GetFunctionUrlConfigCommand} */ @@ -1178,6 +1207,23 @@ export interface Lambda { cb: (err: any, data?: PutFunctionEventInvokeConfigCommandOutput) => void ): void; + /** + * @see {@link PutFunctionRecursionConfigCommand} + */ + putFunctionRecursionConfig( + args: PutFunctionRecursionConfigCommandInput, + options?: __HttpHandlerOptions + ): Promise; + putFunctionRecursionConfig( + args: PutFunctionRecursionConfigCommandInput, + cb: (err: any, data?: PutFunctionRecursionConfigCommandOutput) => void + ): void; + putFunctionRecursionConfig( + args: PutFunctionRecursionConfigCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: PutFunctionRecursionConfigCommandOutput) => void + ): void; + /** * @see {@link PutProvisionedConcurrencyConfigCommand} */ diff --git a/clients/client-lambda/src/LambdaClient.ts b/clients/client-lambda/src/LambdaClient.ts index 410a29096133c..1ee6ae697e142 100644 --- a/clients/client-lambda/src/LambdaClient.ts +++ b/clients/client-lambda/src/LambdaClient.ts @@ -136,6 +136,10 @@ import { GetFunctionEventInvokeConfigCommandInput, GetFunctionEventInvokeConfigCommandOutput, } from "./commands/GetFunctionEventInvokeConfigCommand"; +import { + GetFunctionRecursionConfigCommandInput, + GetFunctionRecursionConfigCommandOutput, +} from "./commands/GetFunctionRecursionConfigCommand"; import { GetFunctionUrlConfigCommandInput, GetFunctionUrlConfigCommandOutput, @@ -214,6 +218,10 @@ import { PutFunctionEventInvokeConfigCommandInput, PutFunctionEventInvokeConfigCommandOutput, } from "./commands/PutFunctionEventInvokeConfigCommand"; +import { + PutFunctionRecursionConfigCommandInput, + PutFunctionRecursionConfigCommandOutput, +} from "./commands/PutFunctionRecursionConfigCommand"; import { PutProvisionedConcurrencyConfigCommandInput, PutProvisionedConcurrencyConfigCommandOutput, @@ -292,6 +300,7 @@ export type ServiceInputTypes = | GetFunctionConcurrencyCommandInput | GetFunctionConfigurationCommandInput | GetFunctionEventInvokeConfigCommandInput + | GetFunctionRecursionConfigCommandInput | GetFunctionUrlConfigCommandInput | GetLayerVersionByArnCommandInput | GetLayerVersionCommandInput @@ -319,6 +328,7 @@ export type ServiceInputTypes = | PutFunctionCodeSigningConfigCommandInput | PutFunctionConcurrencyCommandInput | PutFunctionEventInvokeConfigCommandInput + | PutFunctionRecursionConfigCommandInput | PutProvisionedConcurrencyConfigCommandInput | PutRuntimeManagementConfigCommandInput | RemoveLayerVersionPermissionCommandInput @@ -363,6 +373,7 @@ export type ServiceOutputTypes = | GetFunctionConcurrencyCommandOutput | GetFunctionConfigurationCommandOutput | GetFunctionEventInvokeConfigCommandOutput + | GetFunctionRecursionConfigCommandOutput | GetFunctionUrlConfigCommandOutput | GetLayerVersionByArnCommandOutput | GetLayerVersionCommandOutput @@ -390,6 +401,7 @@ export type ServiceOutputTypes = | PutFunctionCodeSigningConfigCommandOutput | PutFunctionConcurrencyCommandOutput | PutFunctionEventInvokeConfigCommandOutput + | PutFunctionRecursionConfigCommandOutput | PutProvisionedConcurrencyConfigCommandOutput | PutRuntimeManagementConfigCommandOutput | RemoveLayerVersionPermissionCommandOutput diff --git a/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts b/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts index a9adeae07bd2b..cea1fd74ef4b8 100644 --- a/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts +++ b/clients/client-lambda/src/commands/AddLayerVersionPermissionCommand.ts @@ -71,8 +71,17 @@ export interface AddLayerVersionPermissionCommandOutput extends AddLayerVersionP *

The permissions policy for the resource is too large. For more information, see Lambda quotas.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

diff --git a/clients/client-lambda/src/commands/AddPermissionCommand.ts b/clients/client-lambda/src/commands/AddPermissionCommand.ts index 19b7bee4a7f3d..0f44a4d07add4 100644 --- a/clients/client-lambda/src/commands/AddPermissionCommand.ts +++ b/clients/client-lambda/src/commands/AddPermissionCommand.ts @@ -81,8 +81,17 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met *

The permissions policy for the resource is too large. For more information, see Lambda quotas.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

diff --git a/clients/client-lambda/src/commands/GetFunctionRecursionConfigCommand.ts b/clients/client-lambda/src/commands/GetFunctionRecursionConfigCommand.ts new file mode 100644 index 0000000000000..1e36f4ad8c031 --- /dev/null +++ b/clients/client-lambda/src/commands/GetFunctionRecursionConfigCommand.ts @@ -0,0 +1,95 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { LambdaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LambdaClient"; +import { GetFunctionRecursionConfigRequest, GetFunctionRecursionConfigResponse } from "../models/models_0"; +import { de_GetFunctionRecursionConfigCommand, se_GetFunctionRecursionConfigCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetFunctionRecursionConfigCommand}. + */ +export interface GetFunctionRecursionConfigCommandInput extends GetFunctionRecursionConfigRequest {} +/** + * @public + * + * The output of {@link GetFunctionRecursionConfigCommand}. + */ +export interface GetFunctionRecursionConfigCommandOutput extends GetFunctionRecursionConfigResponse, __MetadataBearer {} + +/** + *

Returns your function's recursive loop detection configuration. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { LambdaClient, GetFunctionRecursionConfigCommand } from "@aws-sdk/client-lambda"; // ES Modules import + * // const { LambdaClient, GetFunctionRecursionConfigCommand } = require("@aws-sdk/client-lambda"); // CommonJS import + * const client = new LambdaClient(config); + * const input = { // GetFunctionRecursionConfigRequest + * FunctionName: "STRING_VALUE", // required + * }; + * const command = new GetFunctionRecursionConfigCommand(input); + * const response = await client.send(command); + * // { // GetFunctionRecursionConfigResponse + * // RecursiveLoop: "Allow" || "Terminate", + * // }; + * + * ``` + * + * @param GetFunctionRecursionConfigCommandInput - {@link GetFunctionRecursionConfigCommandInput} + * @returns {@link GetFunctionRecursionConfigCommandOutput} + * @see {@link GetFunctionRecursionConfigCommandInput} for command's `input` shape. + * @see {@link GetFunctionRecursionConfigCommandOutput} for command's `response` shape. + * @see {@link LambdaClientResolvedConfig | config} for LambdaClient's `config` shape. + * + * @throws {@link InvalidParameterValueException} (client fault) + *

One of the parameters in the request is not valid.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The resource specified in the request does not exist.

+ * + * @throws {@link ServiceException} (server fault) + *

The Lambda service encountered an internal error.

+ * + * @throws {@link TooManyRequestsException} (client fault) + *

The request throughput limit was exceeded. For more information, see Lambda quotas.

+ * + * @throws {@link LambdaServiceException} + *

Base exception class for all service exceptions from Lambda service.

+ * + * @public + */ +export class GetFunctionRecursionConfigCommand extends $Command + .classBuilder< + GetFunctionRecursionConfigCommandInput, + GetFunctionRecursionConfigCommandOutput, + LambdaClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: LambdaClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSGirApiService", "GetFunctionRecursionConfig", {}) + .n("LambdaClient", "GetFunctionRecursionConfigCommand") + .f(void 0, void 0) + .ser(se_GetFunctionRecursionConfigCommand) + .de(de_GetFunctionRecursionConfigCommand) + .build() {} diff --git a/clients/client-lambda/src/commands/PublishVersionCommand.ts b/clients/client-lambda/src/commands/PublishVersionCommand.ts index 6ae0af1300143..ab820ac6ba810 100644 --- a/clients/client-lambda/src/commands/PublishVersionCommand.ts +++ b/clients/client-lambda/src/commands/PublishVersionCommand.ts @@ -172,8 +172,17 @@ export interface PublishVersionCommandOutput extends FunctionConfiguration, __Me *

One of the parameters in the request is not valid.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

diff --git a/clients/client-lambda/src/commands/PutFunctionRecursionConfigCommand.ts b/clients/client-lambda/src/commands/PutFunctionRecursionConfigCommand.ts new file mode 100644 index 0000000000000..8b4cb4f69eca9 --- /dev/null +++ b/clients/client-lambda/src/commands/PutFunctionRecursionConfigCommand.ts @@ -0,0 +1,104 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { commonParams } from "../endpoint/EndpointParameters"; +import { LambdaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LambdaClient"; +import { PutFunctionRecursionConfigRequest, PutFunctionRecursionConfigResponse } from "../models/models_0"; +import { de_PutFunctionRecursionConfigCommand, se_PutFunctionRecursionConfigCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link PutFunctionRecursionConfigCommand}. + */ +export interface PutFunctionRecursionConfigCommandInput extends PutFunctionRecursionConfigRequest {} +/** + * @public + * + * The output of {@link PutFunctionRecursionConfigCommand}. + */ +export interface PutFunctionRecursionConfigCommandOutput extends PutFunctionRecursionConfigResponse, __MetadataBearer {} + +/** + *

Sets your function's recursive loop detection configuration.

+ *

When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create + * an infinite recursive loop. For example, a Lambda function might write a message to an Amazon Simple Queue Service (Amazon SQS) queue, which then invokes the same + * function. This invocation causes the function to write another message to the queue, which in turn invokes the function again.

+ *

Lambda can detect certain types of recursive loops shortly after they occur. When Lambda detects a recursive loop and your + * function's recursive loop detection configuration is set to Terminate, it stops your function being invoked and notifies + * you.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { LambdaClient, PutFunctionRecursionConfigCommand } from "@aws-sdk/client-lambda"; // ES Modules import + * // const { LambdaClient, PutFunctionRecursionConfigCommand } = require("@aws-sdk/client-lambda"); // CommonJS import + * const client = new LambdaClient(config); + * const input = { // PutFunctionRecursionConfigRequest + * FunctionName: "STRING_VALUE", // required + * RecursiveLoop: "Allow" || "Terminate", // required + * }; + * const command = new PutFunctionRecursionConfigCommand(input); + * const response = await client.send(command); + * // { // PutFunctionRecursionConfigResponse + * // RecursiveLoop: "Allow" || "Terminate", + * // }; + * + * ``` + * + * @param PutFunctionRecursionConfigCommandInput - {@link PutFunctionRecursionConfigCommandInput} + * @returns {@link PutFunctionRecursionConfigCommandOutput} + * @see {@link PutFunctionRecursionConfigCommandInput} for command's `input` shape. + * @see {@link PutFunctionRecursionConfigCommandOutput} for command's `response` shape. + * @see {@link LambdaClientResolvedConfig | config} for LambdaClient's `config` shape. + * + * @throws {@link InvalidParameterValueException} (client fault) + *

One of the parameters in the request is not valid.

+ * + * @throws {@link ResourceConflictException} (client fault) + *

The resource already exists, or another operation is in progress.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The resource specified in the request does not exist.

+ * + * @throws {@link ServiceException} (server fault) + *

The Lambda service encountered an internal error.

+ * + * @throws {@link TooManyRequestsException} (client fault) + *

The request throughput limit was exceeded. For more information, see Lambda quotas.

+ * + * @throws {@link LambdaServiceException} + *

Base exception class for all service exceptions from Lambda service.

+ * + * @public + */ +export class PutFunctionRecursionConfigCommand extends $Command + .classBuilder< + PutFunctionRecursionConfigCommandInput, + PutFunctionRecursionConfigCommandOutput, + LambdaClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: LambdaClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSGirApiService", "PutFunctionRecursionConfig", {}) + .n("LambdaClient", "PutFunctionRecursionConfigCommand") + .f(void 0, void 0) + .ser(se_PutFunctionRecursionConfigCommand) + .de(de_PutFunctionRecursionConfigCommand) + .build() {} diff --git a/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts b/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts index bb4c554ed147d..43086fa78dbdb 100644 --- a/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts +++ b/clients/client-lambda/src/commands/RemoveLayerVersionPermissionCommand.ts @@ -62,8 +62,17 @@ export interface RemoveLayerVersionPermissionCommandOutput extends __MetadataBea *

One of the parameters in the request is not valid.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceNotFoundException} (client fault) *

The resource specified in the request does not exist.

diff --git a/clients/client-lambda/src/commands/RemovePermissionCommand.ts b/clients/client-lambda/src/commands/RemovePermissionCommand.ts index 3a0a8a3c252a4..0ae7c022de6e4 100644 --- a/clients/client-lambda/src/commands/RemovePermissionCommand.ts +++ b/clients/client-lambda/src/commands/RemovePermissionCommand.ts @@ -58,8 +58,17 @@ export interface RemovePermissionCommandOutput extends __MetadataBearer {} *

One of the parameters in the request is not valid.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceNotFoundException} (client fault) *

The resource specified in the request does not exist.

diff --git a/clients/client-lambda/src/commands/UpdateAliasCommand.ts b/clients/client-lambda/src/commands/UpdateAliasCommand.ts index 58795301d22d0..46de955cacc03 100644 --- a/clients/client-lambda/src/commands/UpdateAliasCommand.ts +++ b/clients/client-lambda/src/commands/UpdateAliasCommand.ts @@ -74,8 +74,17 @@ export interface UpdateAliasCommandOutput extends AliasConfiguration, __Metadata *

One of the parameters in the request is not valid.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

diff --git a/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts index 0057fa9dbd156..840743c078926 100644 --- a/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts +++ b/clients/client-lambda/src/commands/UpdateFunctionCodeCommand.ts @@ -201,8 +201,17 @@ export interface UpdateFunctionCodeCommandOutput extends FunctionConfiguration, *

One of the parameters in the request is not valid.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

diff --git a/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts b/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts index b9445ceffdfc6..fbabf9bfff074 100644 --- a/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts +++ b/clients/client-lambda/src/commands/UpdateFunctionConfigurationCommand.ts @@ -244,8 +244,17 @@ export interface UpdateFunctionConfigurationCommandOutput extends FunctionConfig *

One of the parameters in the request is not valid.

* * @throws {@link PreconditionFailedException} (client fault) - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* * @throws {@link ResourceConflictException} (client fault) *

The resource already exists, or another operation is in progress.

diff --git a/clients/client-lambda/src/commands/index.ts b/clients/client-lambda/src/commands/index.ts index d0fc490920187..d1001072d7eae 100644 --- a/clients/client-lambda/src/commands/index.ts +++ b/clients/client-lambda/src/commands/index.ts @@ -25,6 +25,7 @@ export * from "./GetFunctionCommand"; export * from "./GetFunctionConcurrencyCommand"; export * from "./GetFunctionConfigurationCommand"; export * from "./GetFunctionEventInvokeConfigCommand"; +export * from "./GetFunctionRecursionConfigCommand"; export * from "./GetFunctionUrlConfigCommand"; export * from "./GetLayerVersionByArnCommand"; export * from "./GetLayerVersionCommand"; @@ -52,6 +53,7 @@ export * from "./PublishVersionCommand"; export * from "./PutFunctionCodeSigningConfigCommand"; export * from "./PutFunctionConcurrencyCommand"; export * from "./PutFunctionEventInvokeConfigCommand"; +export * from "./PutFunctionRecursionConfigCommand"; export * from "./PutProvisionedConcurrencyConfigCommand"; export * from "./PutRuntimeManagementConfigCommand"; export * from "./RemoveLayerVersionPermissionCommand"; diff --git a/clients/client-lambda/src/models/models_0.ts b/clients/client-lambda/src/models/models_0.ts index 876925fc77aee..3e5b9b5239a0c 100644 --- a/clients/client-lambda/src/models/models_0.ts +++ b/clients/client-lambda/src/models/models_0.ts @@ -180,8 +180,17 @@ export class PolicyLengthExceededException extends __BaseException { } /** - *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias - * API operation to retrieve the latest RevisionId for your resource.

+ *

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

+ *
    + *
  • + *

    + * For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    + *
  • + *
  • + *

    + * For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    + *
  • + *
* @public */ export class PreconditionFailedException extends __BaseException { @@ -1142,10 +1151,10 @@ export interface CreateEventSourceMappingRequest { /** *

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. * You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

- *

For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default + *

For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default * batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. * To restore the default batching window, you must create a new event source mapping.

- *

Related setting: For streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

+ *

Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

* @public */ MaximumBatchingWindowInSeconds?: number; @@ -1879,8 +1888,14 @@ export interface CreateFunctionRequest { FunctionName: string | undefined; /** - *

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

The identifier of the function's + * runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in + * an error if you're deploying a function using a container image.

+ *

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing + * functions shortly after each runtime is deprecated. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ Runtime?: Runtime; @@ -2371,8 +2386,14 @@ export interface FunctionConfiguration { FunctionArn?: string; /** - *

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

The identifier of the function's + * runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in + * an error if you're deploying a function using a container image.

+ *

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing + * functions shortly after each runtime is deprecated. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ Runtime?: Runtime; @@ -3542,6 +3563,47 @@ export interface GetFunctionEventInvokeConfigRequest { Qualifier?: string; } +/** + * @public + */ +export interface GetFunctionRecursionConfigRequest { + /** + *

+ * @public + */ + FunctionName: string | undefined; +} + +/** + * @public + * @enum + */ +export const RecursiveLoop = { + Allow: "Allow", + Terminate: "Terminate", +} as const; + +/** + * @public + */ +export type RecursiveLoop = (typeof RecursiveLoop)[keyof typeof RecursiveLoop]; + +/** + * @public + */ +export interface GetFunctionRecursionConfigResponse { + /** + *

If your function's recursive loop detection configuration is Allow, Lambda doesn't take any action when it + * detects your function being invoked as part of a recursive loop.

+ *

If your function's recursive loop detection configuration is Terminate, Lambda stops your function being + * invoked and notifies you when it detects your function being invoked as part of a recursive loop.

+ *

By default, Lambda sets your function's configuration to Terminate. You can update this + * configuration using the PutFunctionRecursionConfig action.

+ * @public + */ + RecursiveLoop?: RecursiveLoop; +} + /** * @public */ @@ -3736,7 +3798,10 @@ export interface GetLayerVersionResponse { /** *

The layer's compatible runtimes.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

The following list includes deprecated runtimes. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ CompatibleRuntimes?: Runtime[]; @@ -5573,8 +5638,11 @@ export interface ListFunctionUrlConfigsResponse { */ export interface ListLayersRequest { /** - *

A runtime identifier. For example, java21.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

A runtime identifier.

+ *

The following list includes deprecated runtimes. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ CompatibleRuntime?: Runtime; @@ -5631,7 +5699,10 @@ export interface LayerVersionsListItem { /** *

The layer's compatible runtimes.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

The following list includes deprecated runtimes. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ CompatibleRuntimes?: Runtime[]; @@ -5697,8 +5768,11 @@ export interface ListLayersResponse { */ export interface ListLayerVersionsRequest { /** - *

A runtime identifier. For example, java21.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

A runtime identifier.

+ *

The following list includes deprecated runtimes. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ CompatibleRuntime?: Runtime; @@ -6068,7 +6142,10 @@ export interface PublishLayerVersionResponse { /** *

The layer's compatible runtimes.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

The following list includes deprecated runtimes. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ CompatibleRuntimes?: Runtime[]; @@ -6321,6 +6398,69 @@ export interface PutFunctionEventInvokeConfigRequest { DestinationConfig?: DestinationConfig; } +/** + * @public + */ +export interface PutFunctionRecursionConfigRequest { + /** + *

The name or ARN of the Lambda function.

+ *

+ * Name formats + *

+ *
    + *
  • + *

    + * Function namemy-function.

    + *
  • + *
  • + *

    + * Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    + *
  • + *
  • + *

    + * Partial ARN123456789012:function:my-function.

    + *
  • + *
+ *

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 + * characters in length.

+ * @public + */ + FunctionName: string | undefined; + + /** + *

If you set your function's recursive loop detection configuration to Allow, Lambda doesn't take any action when it + * detects your function being invoked as part of a recursive loop. We recommend that you only use this setting if your design intentionally uses a + * Lambda function to write data back to the same Amazon Web Services resource that invokes it.

+ *

If you set your function's recursive loop detection configuration to Terminate, Lambda stops your function being + * invoked and notifies you when it detects your function being invoked as part of a recursive loop.

+ *

By default, Lambda sets your function's configuration to Terminate.

+ * + *

If your design intentionally uses a Lambda function to write data back to the same Amazon Web Services resource that invokes + * the function, then use caution and implement suitable guard rails to prevent unexpected charges being billed to + * your Amazon Web Services account. To learn more about best practices for using recursive invocation patterns, see Recursive patterns that cause + * run-away Lambda functions in Serverless Land.

+ *
+ * @public + */ + RecursiveLoop: RecursiveLoop | undefined; +} + +/** + * @public + */ +export interface PutFunctionRecursionConfigResponse { + /** + *

The status of your function's recursive loop detection configuration.

+ *

When this value is set to Allowand Lambda detects your function being invoked as part of a recursive + * loop, it doesn't take any action.

+ *

When this value is set to Terminate and Lambda detects your function being invoked as part of a recursive + * loop, it stops your function being invoked and notifies you. + *

+ * @public + */ + RecursiveLoop?: RecursiveLoop; +} + /** * @public */ @@ -6807,10 +6947,10 @@ export interface UpdateEventSourceMappingRequest { /** *

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. * You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

- *

For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default + *

For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default * batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it. * To restore the default batching window, you must create a new event source mapping.

- *

Related setting: For streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

+ *

Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

* @public */ MaximumBatchingWindowInSeconds?: number; @@ -7046,8 +7186,14 @@ export interface UpdateFunctionConfigurationRequest { Environment?: Environment; /** - *

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

- *

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

+ *

The identifier of the function's + * runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in + * an error if you're deploying a function using a container image.

+ *

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing + * functions shortly after each runtime is deprecated. For more information, see + * Runtime use after deprecation.

+ *

For a list of all currently supported runtimes, see + * Supported runtimes.

* @public */ Runtime?: Runtime; diff --git a/clients/client-lambda/src/protocols/Aws_restJson1.ts b/clients/client-lambda/src/protocols/Aws_restJson1.ts index 4d9d62c836ef0..97ec1cbc00373 100644 --- a/clients/client-lambda/src/protocols/Aws_restJson1.ts +++ b/clients/client-lambda/src/protocols/Aws_restJson1.ts @@ -106,6 +106,10 @@ import { GetFunctionEventInvokeConfigCommandInput, GetFunctionEventInvokeConfigCommandOutput, } from "../commands/GetFunctionEventInvokeConfigCommand"; +import { + GetFunctionRecursionConfigCommandInput, + GetFunctionRecursionConfigCommandOutput, +} from "../commands/GetFunctionRecursionConfigCommand"; import { GetFunctionUrlConfigCommandInput, GetFunctionUrlConfigCommandOutput, @@ -184,6 +188,10 @@ import { PutFunctionEventInvokeConfigCommandInput, PutFunctionEventInvokeConfigCommandOutput, } from "../commands/PutFunctionEventInvokeConfigCommand"; +import { + PutFunctionRecursionConfigCommandInput, + PutFunctionRecursionConfigCommandOutput, +} from "../commands/PutFunctionRecursionConfigCommand"; import { PutProvisionedConcurrencyConfigCommandInput, PutProvisionedConcurrencyConfigCommandOutput, @@ -857,6 +865,22 @@ export const se_GetFunctionEventInvokeConfigCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1GetFunctionRecursionConfigCommand + */ +export const se_GetFunctionRecursionConfigCommand = async ( + input: GetFunctionRecursionConfigCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = {}; + b.bp("/2024-08-31/functions/{FunctionName}/recursion-config"); + b.p("FunctionName", () => input.FunctionName!, "{FunctionName}", false); + let body: any; + b.m("GET").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1GetFunctionUrlConfigCommand */ @@ -1426,6 +1450,29 @@ export const se_PutFunctionEventInvokeConfigCommand = async ( return b.build(); }; +/** + * serializeAws_restJson1PutFunctionRecursionConfigCommand + */ +export const se_PutFunctionRecursionConfigCommand = async ( + input: PutFunctionRecursionConfigCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const b = rb(input, context); + const headers: any = { + "content-type": "application/json", + }; + b.bp("/2024-08-31/functions/{FunctionName}/recursion-config"); + b.p("FunctionName", () => input.FunctionName!, "{FunctionName}", false); + let body: any; + body = JSON.stringify( + take(input, { + RecursiveLoop: [], + }) + ); + b.m("PUT").h(headers).b(body); + return b.build(); +}; + /** * serializeAws_restJson1PutProvisionedConcurrencyConfigCommand */ @@ -2465,6 +2512,27 @@ export const de_GetFunctionEventInvokeConfigCommand = async ( return contents; }; +/** + * deserializeAws_restJson1GetFunctionRecursionConfigCommand + */ +export const de_GetFunctionRecursionConfigCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RecursiveLoop: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1GetFunctionUrlConfigCommand */ @@ -3126,6 +3194,27 @@ export const de_PutFunctionEventInvokeConfigCommand = async ( return contents; }; +/** + * deserializeAws_restJson1PutFunctionRecursionConfigCommand + */ +export const de_PutFunctionRecursionConfigCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_CommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + RecursiveLoop: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + /** * deserializeAws_restJson1PutProvisionedConcurrencyConfigCommand */ diff --git a/codegen/sdk-codegen/aws-models/lambda.json b/codegen/sdk-codegen/aws-models/lambda.json index 28975fbcfbfb6..3b12de67a7a6b 100644 --- a/codegen/sdk-codegen/aws-models/lambda.json +++ b/codegen/sdk-codegen/aws-models/lambda.json @@ -111,6 +111,9 @@ { "target": "com.amazonaws.lambda#GetFunctionEventInvokeConfig" }, + { + "target": "com.amazonaws.lambda#GetFunctionRecursionConfig" + }, { "target": "com.amazonaws.lambda#GetFunctionUrlConfig" }, @@ -192,6 +195,9 @@ { "target": "com.amazonaws.lambda#PutFunctionEventInvokeConfig" }, + { + "target": "com.amazonaws.lambda#PutFunctionRecursionConfig" + }, { "target": "com.amazonaws.lambda#PutProvisionedConcurrencyConfig" }, @@ -2560,7 +2566,7 @@ "MaximumBatchingWindowInSeconds": { "target": "com.amazonaws.lambda#MaximumBatchingWindowInSeconds", "traits": { - "smithy.api#documentation": "

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.\n You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

\n

For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default\n batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it.\n To restore the default batching window, you must create a new event source mapping.

\n

Related setting: For streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" + "smithy.api#documentation": "

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.\n You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

\n

For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default\n batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it.\n To restore the default batching window, you must create a new event source mapping.

\n

Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" } }, "ParallelizationFactor": { @@ -2729,7 +2735,7 @@ "Runtime": { "target": "com.amazonaws.lambda#Runtime", "traits": { - "smithy.api#documentation": "

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

" + "smithy.api#documentation": "

The identifier of the function's \n runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in\n an error if you're deploying a function using a container image.

\n

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing\n functions shortly after each runtime is deprecated. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

" } }, "Role": { @@ -4318,7 +4324,7 @@ "Runtime": { "target": "com.amazonaws.lambda#Runtime", "traits": { - "smithy.api#documentation": "

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

" + "smithy.api#documentation": "

The identifier of the function's \n runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in\n an error if you're deploying a function using a container image.

\n

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing\n functions shortly after each runtime is deprecated. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

" } }, "Role": { @@ -5396,6 +5402,67 @@ "smithy.api#input": {} } }, + "com.amazonaws.lambda#GetFunctionRecursionConfig": { + "type": "operation", + "input": { + "target": "com.amazonaws.lambda#GetFunctionRecursionConfigRequest" + }, + "output": { + "target": "com.amazonaws.lambda#GetFunctionRecursionConfigResponse" + }, + "errors": [ + { + "target": "com.amazonaws.lambda#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.lambda#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.lambda#ServiceException" + }, + { + "target": "com.amazonaws.lambda#TooManyRequestsException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns your function's recursive loop detection configuration. \n

", + "smithy.api#http": { + "method": "GET", + "uri": "/2024-08-31/functions/{FunctionName}/recursion-config", + "code": 200 + } + } + }, + "com.amazonaws.lambda#GetFunctionRecursionConfigRequest": { + "type": "structure", + "members": { + "FunctionName": { + "target": "com.amazonaws.lambda#UnqualifiedFunctionName", + "traits": { + "smithy.api#documentation": "

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.lambda#GetFunctionRecursionConfigResponse": { + "type": "structure", + "members": { + "RecursiveLoop": { + "target": "com.amazonaws.lambda#RecursiveLoop", + "traits": { + "smithy.api#documentation": "

If your function's recursive loop detection configuration is Allow, Lambda doesn't take any action when it \n detects your function being invoked as part of a recursive loop.

\n

If your function's recursive loop detection configuration is Terminate, Lambda stops your function being \n invoked and notifies you when it detects your function being invoked as part of a recursive loop.

\n

By default, Lambda sets your function's configuration to Terminate. You can update this \n configuration using the PutFunctionRecursionConfig action.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.lambda#GetFunctionRequest": { "type": "structure", "members": { @@ -5782,7 +5849,7 @@ "CompatibleRuntimes": { "target": "com.amazonaws.lambda#CompatibleRuntimes", "traits": { - "smithy.api#documentation": "

The layer's compatible runtimes.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

" + "smithy.api#documentation": "

The layer's compatible runtimes.

\n

The following list includes deprecated runtimes. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

" } }, "LicenseInfo": { @@ -7296,7 +7363,7 @@ "CompatibleRuntimes": { "target": "com.amazonaws.lambda#CompatibleRuntimes", "traits": { - "smithy.api#documentation": "

The layer's compatible runtimes.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

" + "smithy.api#documentation": "

The layer's compatible runtimes.

\n

The following list includes deprecated runtimes. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

" } }, "LicenseInfo": { @@ -8016,7 +8083,7 @@ "CompatibleRuntime": { "target": "com.amazonaws.lambda#Runtime", "traits": { - "smithy.api#documentation": "

A runtime identifier. For example, java21.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

", + "smithy.api#documentation": "

A runtime identifier.

\n

The following list includes deprecated runtimes. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

", "smithy.api#httpQuery": "CompatibleRuntime" } }, @@ -8114,7 +8181,7 @@ "CompatibleRuntime": { "target": "com.amazonaws.lambda#Runtime", "traits": { - "smithy.api#documentation": "

A runtime identifier. For example, java21.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

", + "smithy.api#documentation": "

A runtime identifier.

\n

The following list includes deprecated runtimes. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

", "smithy.api#httpQuery": "CompatibleRuntime" } }, @@ -8786,7 +8853,7 @@ } }, "traits": { - "smithy.api#documentation": "

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias. Call the GetFunction or the GetAlias\n API operation to retrieve the latest RevisionId for your resource.

", + "smithy.api#documentation": "

The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.

\n
    \n
  • \n

    \n For AddPermission and RemovePermission API operations: Call GetPolicy to retrieve the latest RevisionId for your resource.

    \n
  • \n
  • \n

    \n For all other API operations: Call GetFunction or GetAlias to retrieve the latest RevisionId for your resource.

    \n
  • \n
", "smithy.api#error": "client", "smithy.api#httpError": 412 } @@ -9026,7 +9093,7 @@ "CompatibleRuntimes": { "target": "com.amazonaws.lambda#CompatibleRuntimes", "traits": { - "smithy.api#documentation": "

The layer's compatible runtimes.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

" + "smithy.api#documentation": "

The layer's compatible runtimes.

\n

The following list includes deprecated runtimes. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

" } }, "LicenseInfo": { @@ -9334,6 +9401,77 @@ "smithy.api#input": {} } }, + "com.amazonaws.lambda#PutFunctionRecursionConfig": { + "type": "operation", + "input": { + "target": "com.amazonaws.lambda#PutFunctionRecursionConfigRequest" + }, + "output": { + "target": "com.amazonaws.lambda#PutFunctionRecursionConfigResponse" + }, + "errors": [ + { + "target": "com.amazonaws.lambda#InvalidParameterValueException" + }, + { + "target": "com.amazonaws.lambda#ResourceConflictException" + }, + { + "target": "com.amazonaws.lambda#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.lambda#ServiceException" + }, + { + "target": "com.amazonaws.lambda#TooManyRequestsException" + } + ], + "traits": { + "smithy.api#documentation": "

Sets your function's recursive loop detection configuration.

\n

When you configure a Lambda function to output to the same service or resource that invokes the function, it's possible to create \n an infinite recursive loop. For example, a Lambda function might write a message to an Amazon Simple Queue Service (Amazon SQS) queue, which then invokes the same \n function. This invocation causes the function to write another message to the queue, which in turn invokes the function again.

\n

Lambda can detect certain types of recursive loops shortly after they occur. When Lambda detects a recursive loop and your \n function's recursive loop detection configuration is set to Terminate, it stops your function being invoked and notifies\n you.

", + "smithy.api#http": { + "method": "PUT", + "uri": "/2024-08-31/functions/{FunctionName}/recursion-config", + "code": 200 + } + } + }, + "com.amazonaws.lambda#PutFunctionRecursionConfigRequest": { + "type": "structure", + "members": { + "FunctionName": { + "target": "com.amazonaws.lambda#UnqualifiedFunctionName", + "traits": { + "smithy.api#documentation": "

The name or ARN of the Lambda function.

\n

\n Name formats\n

\n
    \n
  • \n

    \n Function namemy-function.

    \n
  • \n
  • \n

    \n Function ARNarn:aws:lambda:us-west-2:123456789012:function:my-function.

    \n
  • \n
  • \n

    \n Partial ARN123456789012:function:my-function.

    \n
  • \n
\n

The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64\n characters in length.

", + "smithy.api#httpLabel": {}, + "smithy.api#required": {} + } + }, + "RecursiveLoop": { + "target": "com.amazonaws.lambda#RecursiveLoop", + "traits": { + "smithy.api#documentation": "

If you set your function's recursive loop detection configuration to Allow, Lambda doesn't take any action when it \n detects your function being invoked as part of a recursive loop. We recommend that you only use this setting if your design intentionally uses a \n Lambda function to write data back to the same Amazon Web Services resource that invokes it.

\n

If you set your function's recursive loop detection configuration to Terminate, Lambda stops your function being \n invoked and notifies you when it detects your function being invoked as part of a recursive loop.

\n

By default, Lambda sets your function's configuration to Terminate.

\n \n

If your design intentionally uses a Lambda function to write data back to the same Amazon Web Services resource that invokes\n the function, then use caution and implement suitable guard rails to prevent unexpected charges being billed to\n your Amazon Web Services account. To learn more about best practices for using recursive invocation patterns, see Recursive patterns that cause\n run-away Lambda functions in Serverless Land.

\n
", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.lambda#PutFunctionRecursionConfigResponse": { + "type": "structure", + "members": { + "RecursiveLoop": { + "target": "com.amazonaws.lambda#RecursiveLoop", + "traits": { + "smithy.api#documentation": "

The status of your function's recursive loop detection configuration.

\n

When this value is set to Allowand Lambda detects your function being invoked as part of a recursive \n loop, it doesn't take any action.

\n

When this value is set to Terminate and Lambda detects your function being invoked as part of a recursive \n loop, it stops your function being invoked and notifies you.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.lambda#PutProvisionedConcurrencyConfig": { "type": "operation", "input": { @@ -9595,6 +9733,23 @@ "smithy.api#httpError": 400 } }, + "com.amazonaws.lambda#RecursiveLoop": { + "type": "enum", + "members": { + "Allow": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Allow" + } + }, + "Terminate": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Terminate" + } + } + } + }, "com.amazonaws.lambda#RemoveLayerVersionPermission": { "type": "operation", "input": { @@ -10985,6 +11140,16 @@ "smithy.api#pattern": "^[a-zA-Z0-9-\\/*:_+=.@-]*$" } }, + "com.amazonaws.lambda#UnqualifiedFunctionName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 140 + }, + "smithy.api#pattern": "^(arn:(aws[a-zA-Z-]*)?:lambda:)?([a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\\d{1}:)?(\\d{12}:)?(function:)?([a-zA-Z0-9-_]+)$" + } + }, "com.amazonaws.lambda#UnreservedConcurrentExecutions": { "type": "integer", "traits": { @@ -11304,7 +11469,7 @@ "MaximumBatchingWindowInSeconds": { "target": "com.amazonaws.lambda#MaximumBatchingWindowInSeconds", "traits": { - "smithy.api#documentation": "

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.\n You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

\n

For streams and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default\n batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it.\n To restore the default batching window, you must create a new event source mapping.

\n

Related setting: For streams and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" + "smithy.api#documentation": "

The maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function.\n You can configure MaximumBatchingWindowInSeconds to any value from 0 seconds to 300 seconds in increments of seconds.

\n

For Kinesis, DynamoDB, and Amazon SQS event sources, the default batching window is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources, the default\n batching window is 500 ms. Note that because you can only change MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back to the 500 ms default batching window after you have changed it.\n To restore the default batching window, you must create a new event source mapping.

\n

Related setting: For Kinesis, DynamoDB, and Amazon SQS event sources, when you set BatchSize to a value greater than 10, you must set MaximumBatchingWindowInSeconds to at least 1.

" } }, "DestinationConfig": { @@ -11595,7 +11760,7 @@ "Runtime": { "target": "com.amazonaws.lambda#Runtime", "traits": { - "smithy.api#documentation": "

The identifier of the function's runtime. Runtime is required if the deployment package is a .zip file archive.

\n

The following list includes deprecated runtimes. For more information, see Runtime deprecation policy.

" + "smithy.api#documentation": "

The identifier of the function's \n runtime. Runtime is required if the deployment package is a .zip file archive. Specifying a runtime results in\n an error if you're deploying a function using a container image.

\n

The following list includes deprecated runtimes. Lambda blocks creating new functions and updating existing\n functions shortly after each runtime is deprecated. For more information, see\n Runtime use after deprecation.

\n

For a list of all currently supported runtimes, see\n Supported runtimes.

" } }, "DeadLetterConfig": {