2021-06-01 01:19:13 +00:00
Invoking other Lambdas synchronously from a Lambda is a scalability anti-pattern. Lambdas have a maximum execution time before they timeout (15 minutes as of May 2021). Having to wait for another Lambda to finish its execution could lead to a timeout.
2021-05-05 08:56:28 +00:00
2021-05-11 01:20:07 +00:00
2021-06-01 01:19:13 +00:00
A better solution is to generate events that can be consumed asynchronously by other Lambdas.
2021-05-11 01:20:07 +00:00
2021-05-05 08:56:28 +00:00
2021-05-13 01:16:52 +00:00
== Noncompliant Code Example
With AWS SDKv1
----
InvokeRequest invokeRequest = new InvokeRequest()
.withFunctionName("myFunction");
AWSLambda awsLambda = AWSLambdaClientBuilder.standard()
.withCredentials(new ProfileCredentialsProvider())
.withRegion(Regions.US_WEST_2).build();
awsLambda.invoke(invokeRequest); // Noncompliant
----
== See
* https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html[Best practices for working with AWS Lambda functions]
2021-06-02 20:44:38 +02:00
2021-06-03 09:05:38 +02:00
ifdef::env-github,rspecator-view[]
2021-09-20 15:38:42 +02:00
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
include::highlighting.adoc[]
2021-06-08 15:52:13 +02:00
'''
2021-06-02 20:44:38 +02:00
== Comments And Links
(visible only on this page)
include::comments-and-links.adoc[]
2021-06-03 09:05:38 +02:00
endif::env-github,rspecator-view[]