AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the InvokeAsync operation.

For asynchronous function invocation, use Invoke.

Invokes a function asynchronously.

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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonWebServiceRequest
    Amazon.Lambda.AmazonLambdaRequest
      Amazon.Lambda.Model.InvokeAsyncRequest

Namespace: Amazon.Lambda.Model
Assembly: AWSSDK.Lambda.dll
Version: 3.x.y.z

Syntax

C#
[Obsolete("For .NET 3.5/4.5, API InvokeAsyncResponse InvokeAsync(InvokeAsyncRequest) is deprecated, use InvokeResponse Invoke(InvokeRequest), or Task InvokeAsync(InvokeRequest, CancellationToken) instead. For .NET Core, Task InvokeAsyncAsync(InvokeAsyncRequest, CancellationToken) is deprecated, use Task InvokeAsync(InvokeRequest, CancellationToken) instead.")]
public class InvokeAsyncRequest : AmazonLambdaRequest IAmazonWebServiceRequest

The InvokeAsyncRequest type exposes the following members

Constructors

NameDescription
Public Method InvokeAsyncRequest()

Properties

NameTypeDescription
Public Property FunctionName System.String

Gets and sets the property FunctionName.

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 Property InvokeArgs System.String

Gets and sets the property InvokeArgs. When this property is set the InvokeArgsStream property is also set with a MemoryStream containing the contents InvokeArgs

JSON that you want to provide to your cloud function as input.

Public Property InvokeArgsStream System.IO.Stream

Gets and sets the property InvokeArgsStream.

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

Examples

The following example invokes a Lambda function asynchronously

To invoke a Lambda function asynchronously


var response = client.InvokeAsync(new InvokeAsyncRequest 
{
    FunctionName = "my-function",
});

int status = response.Status;

            

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5