-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathtemplate.yaml
63 lines (56 loc) · 1.66 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
serialization utils demo
Globals:
Function:
Timeout: 20
Runtime: java11
MemorySize: 512
Tracing: Active
Resources:
APIGatewayDeserializationFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Handler: org.demo.serialization.APIGatewayRequestDeserializationFunction::handleRequest
Events:
Product:
Type: Api
Properties:
Path: /product
Method: post
DemoSqsQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: "sqs-event-deserialization-queue"
SQSEventDeserializationFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Handler: org.demo.serialization.SQSEventDeserializationFunction::handleRequest
Policies:
- Statement:
- Sid: SQSSendMessageBatch
Effect: Allow
Action:
- sqs:SendMessageBatch
- sqs:SendMessage
Resource: !GetAtt DemoSqsQueue.Arn
Events:
SQSEvent:
Type: SQS
Properties:
Queue: !GetAtt DemoSqsQueue.Arn
BatchSize: 2
MaximumBatchingWindowInSeconds: 30
Outputs:
Api:
Description: "API Gateway endpoint URL for Prod stage for Serialization function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/product/"
Function:
Description: "Serialization Lambda Function ARN"
Value: !GetAtt APIGatewayDeserializationFunction.Arn
DemoSqsQueue:
Description: "ARN for SQS queue"
Value: !GetAtt DemoSqsQueue.Arn