-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
53 lines (45 loc) · 1.11 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
service: pushyami-sls-demo
provider:
name: aws #
runtime: python3.6
stage: dev
region: us-east-1
iamRoleStatements:
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: arn:aws:lambda:*:*:function:${self:custom.process}
- Effect: Allow
Action:
- sqs:DeleteMessage
- sqs:ReceiveMessage
Resource: arn:aws:sqs:*:*:${self:custom.sqs}
custom:
region: ${self:provider.region}
stage: ${opt:stage, self:provider.stage}
prefix: ${self:custom.stage}-${self:service}
process: ${self:custom.prefix}-process
sqs: ${self:custom.prefix}-messages # dev-pushyami-sls-demo-messages
package:
exclude:
- samle-python/**
- sls-proj.iml
functions:
worker:
timeout: 10
memorySize: 128
handler: worker.handler
name: ${self:custom.prefix}-process
environment:
sqs: ${self:custom.sqs}
region: ${self:custom.region}
events:
- schedule: rate(1 minute)
resources:
Resources:
Messages:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:custom.sqs}
MessageRetentionPeriod: 1209600
VisibilityTimeout: 60