-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathtemplate.yaml
More file actions
51 lines (47 loc) · 1.65 KB
/
template.yaml
File metadata and controls
51 lines (47 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
Serverless pattern - Lambda durable function invoking another AWS Lambda function (Python).
Demonstrates how a Lambda durable function can use context.invoke() to call a standard
Lambda function as a checkpointed step in its workflow.
Globals:
Function:
Timeout: 30
MemorySize: 128
Resources:
# Standard AWS Lambda function that processes sample values
ProcessorFunction:
Type: AWS::Serverless::Function
Properties:
Handler: processor_function.lambda_handler
Runtime: python3.14
CodeUri: src/
# Lambda durable function that orchestrates the workflow
DurableLambdaFunction:
Type: AWS::Serverless::Function
Properties:
Handler: durable_lambda_function.lambda_handler
Runtime: python3.14
CodeUri: src/
Timeout: 600
DurableConfig:
ExecutionTimeout: 600
RetentionPeriodInDays: 7
AutoPublishAlias: live
Environment:
Variables:
PROCESSOR_FUNCTION_NAME: !Ref ProcessorFunction
Policies:
- arn:aws:iam::aws:policy/service-role/AWSLambdaBasicDurableExecutionRolePolicy
- LambdaInvokePolicy:
FunctionName: !Ref ProcessorFunction
Outputs:
DurableLambdaFunctionArn:
Description: ARN of Lambda durable function
Value: !GetAtt DurableLambdaFunction.Arn
DurableLambdaFunctionAliasArn:
Description: Alias ARN of the Lambda durable function (use this for invocations)
Value: !Ref DurableLambdaFunction.Alias
ProcessorFunctionArn:
Description: ARN of the processor Lambda function
Value: !GetAtt ProcessorFunction.Arn