Repository navigation
Expand file tree
/
Copy pathserverless.yml
More file actions
104 lines (92 loc) · 2.4 KB
/
Copy pathserverless.yml
File metadata and controls
104 lines (92 loc) · 2.4 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
service: spring-cloud-aws-local
provider:
name: aws
runtime: java17
region: us-east-1
stage: dev
memorySize: 512
timeout: 29
environment:
TABLE_NAME: MyTable
TOPIC_ARN: arn:aws:sns:us-east-1:000000000000:MyTopic
plugins:
- serverless-localstack
custom:
localstack:
stages:
- dev
host: http://localhost
edgePort: 4566
lambda:
mountCode: False
package:
artifact: build/libs/serverless-0.0.1-SNAPSHOT-aws.jar
functions:
s3Handler:
handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
environment:
SPRING_CLOUD_FUNCTION_DEFINITION: trigger-s3
MAIN_CLASS: dev.rumble.serverless.ServerlessApplication
events:
- s3:
bucket: my-bucket
event: s3:ObjectCreated:*
existing: false
getFile:
handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
environment:
SPRING_CLOUD_FUNCTION_DEFINITION: getS3Object
MAIN_CLASS: dev.rumble.serverless.ServerlessApplication
events:
- http:
path: get-file
method: post
snsHandler:
handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
environment:
SPRING_CLOUD_FUNCTION_DEFINITION: snsHandler
MAIN_CLASS: dev.rumble.serverless.ServerlessApplication
events:
- sns: MyTopic
sqsHandler:
handler: org.springframework.cloud.function.adapter.aws.FunctionInvoker::handleRequest
environment:
SPRING_CLOUD_FUNCTION_DEFINITION: sqsHandler
MAIN_CLASS: dev.rumble.serverless.ServerlessApplication
events:
- sqs:
arn:
Fn::GetAtt:
- MyQueue
- Arn
resources:
Resources:
MyTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: MyTable
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
BillingMode: PAY_PER_REQUEST
MyQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: MyQueue
MyTopic:
Type: AWS::SNS::Topic
Properties:
TopicName: MyTopic
MySubscription:
Type: AWS::SNS::Subscription
Properties:
TopicArn:
Ref: MyTopic
Protocol: sqs
Endpoint:
Fn::GetAtt:
- MyQueue
- Arn