-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
58 lines (51 loc) · 1.17 KB
/
Copy pathserverless.yml
File metadata and controls
58 lines (51 loc) · 1.17 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
service: notification-service
frameworkVersion: "3"
custom:
S3_BUCKET_NAME: notificationtemplates1t1l1te
SQS_ARN: !GetAtt MySQSQueue.Arn
QUEUE_URL: !GetAtt MySQSQueue.QueueUrl
provider:
name: aws
runtime: nodejs18.x
region: us-east-1
iam:
role:
statements:
- Effect: Allow
Action:
- s3:*
Resource:
- arn:aws:s3:::${self:custom.S3_BUCKET_NAME}/*
- Effect: Allow
Action:
- sqs:*
Resource:
- ${self:custom.SQS_ARN}
functions:
processS3Upload:
handler: sendMessageToSQS.handler
events:
- s3:
bucket: ${self:custom.S3_BUCKET_NAME}
event: s3:ObjectCreated:*
rules:
- suffix: .xlsx
existing: true
environment:
QUEUE_URL: ${self:custom.QUEUE_URL}
resources:
Resources:
MySQSQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: my-sqs-queue
RedrivePolicy:
deadLetterTargetArn:
Fn::GetAtt:
- MyDLQ
- Arn
maxReceiveCount: 10
MyDLQ:
Type: AWS::SQS::Queue
Properties:
QueueName: my-dlq