Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Switch from InvokeAsync to the newer Invoke API  #21

@specious

Description

@specious

I have received an automated email from AWS regarding the use of the deprecated InvokeAsync API to call lambda function that logs an event in the event-log DynamoDB table:

let response = await lambda.invokeAsync({

The recommendation is to use the newer Invoke function with InvocationType set to Event to make the call asynchronous.

Here is the text from the email:

You are receiving this message because we identified AWS Lambda functions in your account that are using the deprecated InvokeAsync API [1], which was deprecated in 2015 and is replaced by the Invoke API [2].

The following is a list of your affected AWS Lambda functions:
arn:aws:lambda:us-east-1:999999999999:function:log-event

While Lambda continues to support customers using the deprecated API, the API does not receive any new updates. The deprecated InvokeAsync API does not consider reserved concurrency [3] for a function as reserved concurrency was launched in 2017, after the InvokeAsync API was deprecated. When a function using the InvokeAsync API with reserved concurrency experiences throttles, you may also experience throttles for other functions in the account. With Invoke API with InvocationType as Event, Lambda will only throttle the function with a reserved concurrency in such an event without impacting other functions in the account.

To ensure that your functions continue to benefit from optimizations in asynchronous processing, we recommend you to migrate your existing functions to the Invoke API. If the impacted AWS Lambda functions are already deleted, no further action is required.

If you have any questions, please contact AWS Support [4].

[1] https://docs.aws.amazon.com/lambda/latest/dg/API_InvokeAsync.html
[2] https://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html
[3] https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html
[4] https://aws.amazon.com/support

There is nothing urgent about making this change, however AWS recommends switching to the newer and better supported API for the reasons given in the email.

I would strongly recommend taking a closer look at the code in the first place to see if it could be written differently to begin with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions