xxxxxxxxxx
Step Functions is a serverless orchestration service that lets you easily coordinate multiple Lambda functions into flexible workflows that are easy to debug and change.
Step Functions will keep your Lambda functions free of additional logic by triggering and tracking each step of your application for you.
xxxxxxxxxx
# The lambda keyword in Python provides a
# shortcut for declaring small and
# anonymous functions:
add = lambda x, y: x + y
print(add(5, 3))
# Output
# 8
# You could declare the same add()
# function with the def keyword:
def add(x, y):
return x + y
print(add(5, 3))
# Output
# 8
# So what's the big fuss about?
# Lambdas are *function expressions*:
print((lambda x, y: x + y)(5, 3))
# Output
# 8
# • Lambda functions are single-expression
# functions that are not necessarily bound
# to a name (they can be anonymous).
# • Lambda functions can't use regular
# Python statements and always include an
# implicit `return` statement.
xxxxxxxxxx
fn = lambda_.Function(self, "MyFunction",
runtime=lambda_.Runtime.NODEJS_16_X,
handler="index.handler",
code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler"))
)
xxxxxxxxxx
{
// ...
"Resource": "arn:aws:states:::lambda:invoke",
"Parameters": {
"FunctionName": "arn:aws:lambda:us-east-1:123456789001:function:ExtractData",
"Payload.$": "$.document.Item"
}
// ...
}
xxxxxxxxxx
Runnable subTaskWithLambda = () ->
{
System.out.println("SubTaskWithLambda started...");
};
Copied!