Skip to content

Commit

Permalink
feat(client-lambda): Release Lambda FunctionRecursiveConfig, enabling…
Browse files Browse the repository at this point in the history
… customers to turn recursive loop detection on or off on individual functions. This release adds two new APIs, GetFunctionRecursionConfig and PutFunctionRecursionConfig.
  • Loading branch information
awstools committed Aug 19, 2024
1 parent d9a4bcc commit 30b277c
Show file tree
Hide file tree
Showing 17 changed files with 793 additions and 46 deletions.
16 changes: 16 additions & 0 deletions clients/client-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)

</details>
<details>
<summary>
GetFunctionRecursionConfig
</summary>

[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/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -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/)

</details>
<details>
<summary>
PutFunctionRecursionConfig
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-lambda/src/Lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ import {
GetFunctionEventInvokeConfigCommandInput,
GetFunctionEventInvokeConfigCommandOutput,
} from "./commands/GetFunctionEventInvokeConfigCommand";
import {
GetFunctionRecursionConfigCommand,
GetFunctionRecursionConfigCommandInput,
GetFunctionRecursionConfigCommandOutput,
} from "./commands/GetFunctionRecursionConfigCommand";
import {
GetFunctionUrlConfigCommand,
GetFunctionUrlConfigCommandInput,
Expand Down Expand Up @@ -227,6 +232,11 @@ import {
PutFunctionEventInvokeConfigCommandInput,
PutFunctionEventInvokeConfigCommandOutput,
} from "./commands/PutFunctionEventInvokeConfigCommand";
import {
PutFunctionRecursionConfigCommand,
PutFunctionRecursionConfigCommandInput,
PutFunctionRecursionConfigCommandOutput,
} from "./commands/PutFunctionRecursionConfigCommand";
import {
PutProvisionedConcurrencyConfigCommand,
PutProvisionedConcurrencyConfigCommandInput,
Expand Down Expand Up @@ -313,6 +323,7 @@ const commands = {
GetFunctionConcurrencyCommand,
GetFunctionConfigurationCommand,
GetFunctionEventInvokeConfigCommand,
GetFunctionRecursionConfigCommand,
GetFunctionUrlConfigCommand,
GetLayerVersionCommand,
GetLayerVersionByArnCommand,
Expand Down Expand Up @@ -340,6 +351,7 @@ const commands = {
PutFunctionCodeSigningConfigCommand,
PutFunctionConcurrencyCommand,
PutFunctionEventInvokeConfigCommand,
PutFunctionRecursionConfigCommand,
PutProvisionedConcurrencyConfigCommand,
PutRuntimeManagementConfigCommand,
RemoveLayerVersionPermissionCommand,
Expand Down Expand Up @@ -763,6 +775,23 @@ export interface Lambda {
cb: (err: any, data?: GetFunctionEventInvokeConfigCommandOutput) => void
): void;

/**
* @see {@link GetFunctionRecursionConfigCommand}
*/
getFunctionRecursionConfig(
args: GetFunctionRecursionConfigCommandInput,
options?: __HttpHandlerOptions
): Promise<GetFunctionRecursionConfigCommandOutput>;
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}
*/
Expand Down Expand Up @@ -1178,6 +1207,23 @@ export interface Lambda {
cb: (err: any, data?: PutFunctionEventInvokeConfigCommandOutput) => void
): void;

/**
* @see {@link PutFunctionRecursionConfigCommand}
*/
putFunctionRecursionConfig(
args: PutFunctionRecursionConfigCommandInput,
options?: __HttpHandlerOptions
): Promise<PutFunctionRecursionConfigCommandOutput>;
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}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-lambda/src/LambdaClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ import {
GetFunctionEventInvokeConfigCommandInput,
GetFunctionEventInvokeConfigCommandOutput,
} from "./commands/GetFunctionEventInvokeConfigCommand";
import {
GetFunctionRecursionConfigCommandInput,
GetFunctionRecursionConfigCommandOutput,
} from "./commands/GetFunctionRecursionConfigCommand";
import {
GetFunctionUrlConfigCommandInput,
GetFunctionUrlConfigCommandOutput,
Expand Down Expand Up @@ -214,6 +218,10 @@ import {
PutFunctionEventInvokeConfigCommandInput,
PutFunctionEventInvokeConfigCommandOutput,
} from "./commands/PutFunctionEventInvokeConfigCommand";
import {
PutFunctionRecursionConfigCommandInput,
PutFunctionRecursionConfigCommandOutput,
} from "./commands/PutFunctionRecursionConfigCommand";
import {
PutProvisionedConcurrencyConfigCommandInput,
PutProvisionedConcurrencyConfigCommandOutput,
Expand Down Expand Up @@ -292,6 +300,7 @@ export type ServiceInputTypes =
| GetFunctionConcurrencyCommandInput
| GetFunctionConfigurationCommandInput
| GetFunctionEventInvokeConfigCommandInput
| GetFunctionRecursionConfigCommandInput
| GetFunctionUrlConfigCommandInput
| GetLayerVersionByArnCommandInput
| GetLayerVersionCommandInput
Expand Down Expand Up @@ -319,6 +328,7 @@ export type ServiceInputTypes =
| PutFunctionCodeSigningConfigCommandInput
| PutFunctionConcurrencyCommandInput
| PutFunctionEventInvokeConfigCommandInput
| PutFunctionRecursionConfigCommandInput
| PutProvisionedConcurrencyConfigCommandInput
| PutRuntimeManagementConfigCommandInput
| RemoveLayerVersionPermissionCommandInput
Expand Down Expand Up @@ -363,6 +373,7 @@ export type ServiceOutputTypes =
| GetFunctionConcurrencyCommandOutput
| GetFunctionConfigurationCommandOutput
| GetFunctionEventInvokeConfigCommandOutput
| GetFunctionRecursionConfigCommandOutput
| GetFunctionUrlConfigCommandOutput
| GetLayerVersionByArnCommandOutput
| GetLayerVersionCommandOutput
Expand Down Expand Up @@ -390,6 +401,7 @@ export type ServiceOutputTypes =
| PutFunctionCodeSigningConfigCommandOutput
| PutFunctionConcurrencyCommandOutput
| PutFunctionEventInvokeConfigCommandOutput
| PutFunctionRecursionConfigCommandOutput
| PutProvisionedConcurrencyConfigCommandOutput
| PutRuntimeManagementConfigCommandOutput
| RemoveLayerVersionPermissionCommandOutput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,17 @@ export interface AddLayerVersionPermissionCommandOutput extends AddLayerVersionP
* <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>
*
* @throws {@link PreconditionFailedException} (client fault)
* <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>
* API operation to retrieve the latest RevisionId for your resource.</p>
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.</p>
* <ul>
* <li>
* <p>
* <b>For AddPermission and RemovePermission API operations:</b> Call <code>GetPolicy</code> to retrieve the latest RevisionId for your resource.</p>
* </li>
* <li>
* <p>
* <b>For all other API operations:</b> Call <code>GetFunction</code> or <code>GetAlias</code> to retrieve the latest RevisionId for your resource.</p>
* </li>
* </ul>
*
* @throws {@link ResourceConflictException} (client fault)
* <p>The resource already exists, or another operation is in progress.</p>
Expand Down
13 changes: 11 additions & 2 deletions clients/client-lambda/src/commands/AddPermissionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,17 @@ export interface AddPermissionCommandOutput extends AddPermissionResponse, __Met
* <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>
*
* @throws {@link PreconditionFailedException} (client fault)
* <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>
* API operation to retrieve the latest RevisionId for your resource.</p>
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.</p>
* <ul>
* <li>
* <p>
* <b>For AddPermission and RemovePermission API operations:</b> Call <code>GetPolicy</code> to retrieve the latest RevisionId for your resource.</p>
* </li>
* <li>
* <p>
* <b>For all other API operations:</b> Call <code>GetFunction</code> or <code>GetAlias</code> to retrieve the latest RevisionId for your resource.</p>
* </li>
* </ul>
*
* @throws {@link ResourceConflictException} (client fault)
* <p>The resource already exists, or another operation is in progress.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}

/**
* <p>Returns your function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/invocation-recursion.html">recursive loop detection</a> configuration.
* </p>
* @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)
* <p>One of the parameters in the request is not valid.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource specified in the request does not exist.</p>
*
* @throws {@link ServiceException} (server fault)
* <p>The Lambda service encountered an internal error.</p>
*
* @throws {@link TooManyRequestsException} (client fault)
* <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>
*
* @throws {@link LambdaServiceException}
* <p>Base exception class for all service exceptions from Lambda service.</p>
*
* @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() {}
13 changes: 11 additions & 2 deletions clients/client-lambda/src/commands/PublishVersionCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,17 @@ export interface PublishVersionCommandOutput extends FunctionConfiguration, __Me
* <p>One of the parameters in the request is not valid.</p>
*
* @throws {@link PreconditionFailedException} (client fault)
* <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>
* API operation to retrieve the latest RevisionId for your resource.</p>
* <p>The RevisionId provided does not match the latest RevisionId for the Lambda function or alias.</p>
* <ul>
* <li>
* <p>
* <b>For AddPermission and RemovePermission API operations:</b> Call <code>GetPolicy</code> to retrieve the latest RevisionId for your resource.</p>
* </li>
* <li>
* <p>
* <b>For all other API operations:</b> Call <code>GetFunction</code> or <code>GetAlias</code> to retrieve the latest RevisionId for your resource.</p>
* </li>
* </ul>
*
* @throws {@link ResourceConflictException} (client fault)
* <p>The resource already exists, or another operation is in progress.</p>
Expand Down
Loading

0 comments on commit 30b277c

Please sign in to comment.