-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathtemplate.yaml
More file actions
62 lines (57 loc) · 1.61 KB
/
template.yaml
File metadata and controls
62 lines (57 loc) · 1.61 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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
Large Message Handling Example using SQS and S3 offloading
Globals:
Function:
Timeout: 30
Runtime: java11
MemorySize: 512
Tracing: Active
Environment:
Variables:
JAVA_TOOL_OPTIONS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
POWERTOOLS_LOG_LEVEL: INFO
POWERTOOLS_SERVICE_NAME: LargeMessageExample
Resources:
LargeMessageBucket:
Type: AWS::S3::Bucket
Properties:
LifecycleConfiguration:
Rules:
- Id: DeleteOldMessages
Status: Enabled
ExpirationInDays: 1
MyLargeMessageQueue:
Type: AWS::SQS::Queue
Properties:
VisibilityTimeout: 30
LargeMessageProcessingFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: .
Handler: helloworld.App::handleRequest
Policies:
- S3CrudPolicy:
BucketName: !Ref LargeMessageBucket
- SQSPollerPolicy:
QueueName: !GetAtt MyLargeMessageQueue.QueueName
Environment:
Variables:
POWERTOOLS_LARGE_MESSAGES_BUCKET: !Ref LargeMessageBucket
Events:
SQSEvent:
Type: SQS
Properties:
Queue: !GetAtt MyLargeMessageQueue.Arn
BatchSize: 1
Outputs:
LargeMessageBucketName:
Description: "S3 Bucket for large payloads"
Value: !Ref LargeMessageBucket
QueueURL:
Description: "SQS Queue URL"
Value: !Ref MyLargeMessageQueue
FunctionArn:
Description: "Lambda Function ARN"
Value: !GetAtt LargeMessageProcessingFunction.Arn