-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
92 lines (82 loc) · 1.96 KB
/
serverless.yml
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
service: document-service
provider:
memorySize: 1536
name: aws
region: us-east-1
runtime: nodejs8.10
stage: dev
timeout: 180
iamRoleStatements:
- Effect: Allow
Action:
- s3:PutObject
- s3:PutObjectAcl
Resource: "arn:aws:s3:::${self:custom.bucket}/*"
custom:
bucket: sls-bucket-name
hooks:
package:initialize:
- yarn run package-nochrome
prefix: ${self:custom.stage}-${self:service}
region: ${self:provider.region}
sqs: ${self:custom.prefix}-messages
stage: ${opt:stage, self:provider.stage}
functions:
process:
handler: index.handler
name: ${self:custom.prefix}-process
events:
- sqs:
arn:
Fn::GetAtt:
- ${self:custom.sqs}
- Arn
environment:
region: ${self:custom.region}
sqs: ${self:custom.sqs}
BUCKET: ${self:custom.bucket}
resources:
Resources:
S3BucketAttachments:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucket}
CorsConfiguration:
CorsRules:
-
AllowedOrigins:
- '*'
AllowedHeaders:
- '*'
AllowedMethods:
- GET
- PUT
- POST
- DELETE
- HEAD
MaxAge: 3000
Messages:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:custom.sqs}
MessageRetentionPeriod: 1209600
VisibilityTimeout: 60
RedrivePolicy:
deadLetterTargetArn:
Fn::GetAtt:
- MessagesDeadLetterQueue
- Arn
maxReceiveCount: 10
MessagesDeadLetterQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:custom.sqs}-dead-letter-queue
MessageRetentionPeriod: 1209600
package:
artifact: ./package.zip
exclude:
- docs/**
- src/local/**
- src/__tests__/**
plugins:
- serverless-hooks-plugin