-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlambda-events.json
59 lines (59 loc) · 1.46 KB
/
lambda-events.json
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
52
53
54
55
56
57
58
59
{
"$schema": "../cdk.schema.json",
"Description": "A template creates a lambda function which can be invoked by an sns topic",
"Resources": {
"MyTopic": {
"Type": "aws-cdk-lib.aws_sns.Topic"
},
"Table": {
"Type": "aws-cdk-lib.aws_dynamodb.Table",
"Properties": {
"partitionKey": {
"name": "ID",
"type": "STRING"
},
"stream": "NEW_AND_OLD_IMAGES"
}
},
"HelloWorldFunction": {
"Type": "aws-cdk-lib.aws_lambda.Function",
"Properties": {
"handler": "app.hello_handler",
"runtime": "PYTHON_3_6",
"code": {
"aws-cdk-lib.aws_lambda.Code.fromAsset": "examples/lambda-handler"
},
"environment": {
"Param": "f"
},
"events": [
{
"aws-cdk-lib.aws_lambda_event_sources.DynamoEventSource": [
{ "Ref": "Table" },
{
"startingPosition": "TRIM_HORIZON"
}
]
},
{
"aws-cdk-lib.aws_lambda_event_sources.ApiEventSource": [
"GET",
"/hello"
]
},
{
"aws-cdk-lib.aws_lambda_event_sources.ApiEventSource": [
"POST",
"/hello"
]
},
{
"aws-cdk-lib.aws_lambda_event_sources.SnsEventSource": {
"Ref": "MyTopic"
}
}
]
}
}
}
}