@aws-sdk/client-lambda
Version:
AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native
179 lines (178 loc) • 10.2 kB
TypeScript
import type { MetadataBearer as __MetadataBearer, StreamingBlobPayloadInputTypes } from "@smithy/types";
import type { InvokeAsyncRequest, InvokeAsyncResponse } from "../models/models_0";
/**
* @public
*/
export type { __MetadataBearer };
/**
* @public
*
* The input for {@link InvokeAsyncCommand}.
*/
export interface InvokeAsyncCommandInput extends Omit<InvokeAsyncRequest, "InvokeArgs"> {
InvokeArgs: StreamingBlobPayloadInputTypes;
}
/**
* @public
*
* The output of {@link InvokeAsyncCommand}.
*/
export interface InvokeAsyncCommandOutput extends InvokeAsyncResponse, __MetadataBearer {
}
declare const InvokeAsyncCommand_base: {
new (input: InvokeAsyncCommandInput): import("@smithy/core/client").CommandImpl<InvokeAsyncCommandInput, InvokeAsyncCommandOutput, import("..").LambdaClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
new (input: InvokeAsyncCommandInput): import("@smithy/core/client").CommandImpl<InvokeAsyncCommandInput, InvokeAsyncCommandOutput, import("..").LambdaClientResolvedConfig, import("..").ServiceInputTypes, import("..").ServiceOutputTypes>;
getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions;
};
/**
* <note> <p>For asynchronous function invocation, use <a>Invoke</a>.</p> </note> <p>Invokes a function asynchronously.</p> <note> <p>The payload limit is 256KB. For larger payloads, for up to 1MB, use <a>Invoke</a>.</p> </note> <note> <p>If you do use the InvokeAsync action, note that it doesn't support the use of X-Ray active tracing. Trace ID is not propagated to the function, even if X-Ray active tracing is turned on.</p> </note>
*
* @deprecated deprecated.
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { LambdaClient, InvokeAsyncCommand } from "@aws-sdk/client-lambda"; // ES Modules import
* // const { LambdaClient, InvokeAsyncCommand } = require("@aws-sdk/client-lambda"); // CommonJS import
* // import type { LambdaClientConfig } from "@aws-sdk/client-lambda";
* const config = {}; // type is LambdaClientConfig
* const client = new LambdaClient(config);
* const input = { // InvokeAsyncRequest
* FunctionName: "STRING_VALUE", // required
* InvokeArgs: "MULTIPLE_TYPES_ACCEPTED", // see \@smithy/types -> StreamingBlobPayloadInputTypes // required
* };
* const command = new InvokeAsyncCommand(input);
* const response = await client.send(command);
* // { // InvokeAsyncResponse
* // Status: Number("int"),
* // };
*
* ```
*
* @param InvokeAsyncCommandInput - {@link InvokeAsyncCommandInput}
* @returns {@link InvokeAsyncCommandOutput}
* @see {@link InvokeAsyncCommandInput} for command's `input` shape.
* @see {@link InvokeAsyncCommandOutput} for command's `response` shape.
* @see {@link LambdaClientResolvedConfig | config} for LambdaClient's `config` shape.
*
* @throws {@link EC2AccessDeniedException} (server fault)
* <p>Need additional permissions to configure VPC settings.</p>
*
* @throws {@link EC2ThrottledException} (server fault)
* <p>Amazon EC2 throttled Lambda during Lambda function initialization using the execution role provided for the function.</p>
*
* @throws {@link EC2UnexpectedException} (server fault)
* <p>Lambda received an unexpected Amazon EC2 client exception while setting up for the Lambda function.</p>
*
* @throws {@link EFSIOException} (client fault)
* <p>An error occurred when reading from or writing to a connected file system.</p>
*
* @throws {@link EFSMountConnectivityException} (client fault)
* <p>The Lambda function couldn't make a network connection to the configured file system.</p>
*
* @throws {@link EFSMountFailureException} (client fault)
* <p>The Lambda function couldn't mount the configured file system due to a permission or configuration issue.</p>
*
* @throws {@link EFSMountTimeoutException} (client fault)
* <p>The Lambda function made a network connection to the configured file system, but the mount operation timed out.</p>
*
* @throws {@link ENILimitReachedException} (server fault)
* <p>Lambda couldn't create an elastic network interface in the VPC, specified as part of Lambda function configuration, because the limit for network interfaces has been reached. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>.</p>
*
* @throws {@link InvalidRequestContentException} (client fault)
* <p>The request body could not be parsed as JSON, or a request header is invalid. For example, the 'x-amzn-RequestId' header is not a valid UUID string.</p>
*
* @throws {@link InvalidRuntimeException} (server fault)
* <p>The runtime or runtime version specified is not supported.</p>
*
* @throws {@link InvalidSecurityGroupIDException} (server fault)
* <p>The security group ID provided in the Lambda function VPC configuration is not valid.</p>
*
* @throws {@link InvalidSubnetIDException} (server fault)
* <p>The subnet ID provided in the Lambda function VPC configuration is not valid.</p>
*
* @throws {@link KMSAccessDeniedException} (server fault)
* <p>Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.</p>
*
* @throws {@link KMSDisabledException} (server fault)
* <p>Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.</p>
*
* @throws {@link KMSInvalidStateException} (server fault)
* <p>Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.</p>
*
* @throws {@link KMSNotFoundException} (server fault)
* <p>Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.</p>
*
* @throws {@link ModeNotSupportedException} (client fault)
* <p>The Lambda function doesn't support the invocation mode requested. For example, calling <code>Invoke</code> with <code>InvocationType=RequestResponse</code> on a function configured for asynchronous-only invocation, or vice versa. For more information about invocation types, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/invocation-options.html">Invoking Lambda functions</a>.</p>
*
* @throws {@link ResourceConflictException} (client fault)
* <p>The resource already exists, or another operation is in progress.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The resource specified in the request does not exist.</p>
*
* @throws {@link S3FilesMountConnectivityException} (client fault)
* <p>The Lambda function couldn't make a network connection to the configured S3 Files access point.</p>
*
* @throws {@link S3FilesMountFailureException} (client fault)
* <p>The Lambda function couldn't mount the configured S3 Files access point due to a permission or configuration issue.</p>
*
* @throws {@link S3FilesMountTimeoutException} (client fault)
* <p>The Lambda function made a network connection to the configured S3 Files access point, but the mount operation timed out.</p>
*
* @throws {@link ServiceException} (server fault)
* <p>The Lambda service encountered an internal error.</p>
*
* @throws {@link ServiceQuotaExceededException} (client fault)
* <p>The request would exceed a service quota. For more information about Lambda service quotas, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html">Lambda quotas</a>. To request a quota increase, see <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html">Requesting a quota increase</a> in the <i>Service Quotas User Guide</i>.</p>
*
* @throws {@link SnapStartException} (client fault)
* <p>The <code>afterRestore()</code> <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart-runtime-hooks.html">runtime hook</a> encountered an error. For more information, check the Amazon CloudWatch logs.</p>
*
* @throws {@link SnapStartNotReadyException} (client fault)
* <p>Lambda is initializing your function. You can invoke the function when the <a href="https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html">function state</a> becomes <code>Active</code>.</p>
*
* @throws {@link SnapStartRegenerationFailureException} (client fault)
* <p>Lambda couldn't regenerate the SnapStart snapshot for the function. SnapStart-enabled functions periodically regenerate snapshots when their underlying runtime or dependencies change; this regeneration failed. Wait for Lambda to retry, or update the function's configuration to trigger a new snapshot. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html">Lambda SnapStart</a>.</p>
*
* @throws {@link SnapStartTimeoutException} (client fault)
* <p>Lambda couldn't restore the snapshot within the timeout limit.</p>
*
* @throws {@link SubnetIPAddressLimitReachedException} (server fault)
* <p>Lambda couldn't set up VPC access for the Lambda function because one or more configured subnets has no available IP addresses.</p>
*
* @throws {@link LambdaServiceException}
* <p>Base exception class for all service exceptions from Lambda service.</p>
*
*
* @example To invoke a Lambda function asynchronously
* ```javascript
* // The following example invokes a Lambda function asynchronously
* const input = {
* FunctionName: "my-function",
* InvokeArgs: "{}"
* };
* const command = new InvokeAsyncCommand(input);
* const response = await client.send(command);
* /* response is
* {
* Status: 202
* }
* *\/
* ```
*
* @public
*/
export declare class InvokeAsyncCommand extends InvokeAsyncCommand_base {
/** @internal type navigation helper, not in runtime. */
protected static __types: {
api: {
input: InvokeAsyncRequest;
output: InvokeAsyncResponse;
};
sdk: {
input: InvokeAsyncCommandInput;
output: InvokeAsyncCommandOutput;
};
};
}