-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathserverless.yml
47 lines (40 loc) · 1.01 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
# serverless.yml
service: sqs-triggers-demo
provider:
name: aws
runtime: nodejs6.10
profile: sls
region: us-east-1
iamRoleStatements:
- Effect: "Allow"
Action:
- "sqs:SendMessage"
- "sqs:GetQueueUrl"
Resource: "arn:aws:sqs:${self:provider.region}:811338114639:MyQueue"
- Effect: "Allow"
Action:
- "sqs:ListQueues"
Resource: "arn:aws:sqs:${self:provider.region}:811338114639:*"
functions:
sender:
handler: sender.handler
events:
- http:
path: v1/sender
method: post
receiver:
handler: receiver.handler
events:
- sqs:
arn:
Fn::GetAtt:
- MyQueue
- Arn
resources:
Resources:
MyQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "MyQueue"
# export QUEUE_URL=`aws sqs get-queue-url --queue-name MyQueue --query 'QueueUrl' --output text --profile=sls`
# aws sqs send-message --queue-url ${QUEUE_URL} --message-body "test" --profile=sls