-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
62 lines (56 loc) · 1.71 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
service: sopt-push-notification
frameworkVersion: '3'
useDotenv: true
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs18.x
region: ap-northeast-2
environment:
DYNAMODB_TABLE: ${env:DYNAMODB_TABLE}
PLATFORM_APPLICATION_iOS: ${env:PLATFORM_APPLICATION_iOS}
PLATFORM_APPLICATION_ANDROID: ${env:PLATFORM_APPLICATION_ANDROID}
ALL_TOPIC_ARN: ${env:ALL_TOPIC_ARN}
STAGE: ${env:STAGE}
MAKERS_APP_SERVER_URL: ${env:MAKERS_APP_SERVER_URL}
MAKERS_OPERATION_SERVER_URL: ${env:MAKERS_OPERATION_SERVER_URL}
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: 'arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}'
- Effect: Allow
Action:
- sns:Subscribe
- sns:Unsubscribe
- sns:Publish
- sns:DeleteEndpoint
- sns:ListEndpointsByPlatformApplication
- sns:GetTopicAttributes
- sns:CreatePlatformEndpoint
- sns:SetTopicAttributes
- sns:ListPlatformApplications
Resource:
- '${self:provider.environment.PLATFORM_APPLICATION_iOS}'
- '${self:provider.environment.PLATFORM_APPLICATION_ANDROID}'
- '${self:provider.environment.ALL_TOPIC_ARN}'
custom:
serverless-offline:
httpPort: 4000
printOutput: true
functions:
service:
handler: src/lambda.service
events:
- http:
path: ''
method: post
cors: true