Skip to content

invoke_async

Operation

invoke_async

invoke_async(request: InvokeAsyncInput | InvokeAsyncInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeAsyncInputDict]) -> InvokeAsyncOutput
Note

For asynchronous function invocation, use Invoke.

Invokes a function asynchronously.

Note

The payload limit is 256KB. For larger payloads, for up to 1MB, use Invoke.

Note: 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.

Parameters:

Name Type Description Default
request InvokeAsyncInput | InvokeAsyncInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[InvokeAsyncInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
InvokeAsyncOutput

An instance of InvokeAsyncOutput.

invoke_async async

invoke_async(request: InvokeAsyncInput | InvokeAsyncInputDict | AsyncInvokeAsyncInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[AsyncInvokeAsyncInputDict]) -> InvokeAsyncOutput
Note

For asynchronous function invocation, use Invoke.

Invokes a function asynchronously.

Note

The payload limit is 256KB. For larger payloads, for up to 1MB, use Invoke.

Note: 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.

Parameters:

Name Type Description Default
request InvokeAsyncInput | InvokeAsyncInputDict | AsyncInvokeAsyncInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[AsyncInvokeAsyncInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
InvokeAsyncOutput

An instance of InvokeAsyncOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

Both clients accept InvokeAsyncInputDict. Only the asynchronous client accepts AsyncInvokeAsyncInputDict.

InvokeAsyncInputDict

Bases: TypedDict

Dictionary form of InvokeAsyncInput that either client accepts. Its streaming body is one a sync client can send. Use AsyncInvokeAsyncInputDict for an async stream.

Attributes

function_name instance-attribute
function_name: Required[str]

The name or ARN of the Lambda function.

Name formats

  • Function name -- my-function.

  • Function ARN -- arn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN -- 123456789012: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.

invoke_args instance-attribute
invoke_args: Required[StreamingBlob]

The JSON that you want to provide to your Lambda function as input.

AsyncInvokeAsyncInputDict

Bases: TypedDict

Dictionary form of InvokeAsyncInput for the async client. Its streaming body may also be an async stream.

Attributes

function_name instance-attribute
function_name: Required[str]

The name or ARN of the Lambda function.

Name formats

  • Function name -- my-function.

  • Function ARN -- arn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN -- 123456789012: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.

invoke_args instance-attribute
invoke_args: Required[StreamingBlob]

The JSON that you want to provide to your Lambda function as input.

InvokeAsyncInput dataclass

Bases: _SerdeShape

Dataclass for InvokeAsyncInput structure.

Attributes

function_name class-attribute instance-attribute
function_name: str | None = ...

The name or ARN of the Lambda function.

Name formats

  • Function name -- my-function.

  • Function ARN -- arn:aws:lambda:us-west-2:123456789012:function:my-function.

  • Partial ARN -- 123456789012: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.

invoke_args class-attribute instance-attribute
invoke_args: StreamingBlob | None = ...

The JSON that you want to provide to your Lambda function as input.

Output

InvokeAsyncOutput dataclass

Bases: _SerdeShape

A success response (202 Accepted) indicates that the request is queued for invocation.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

status class-attribute instance-attribute
status: int = ...

The status code.