-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
64 lines (57 loc) · 1.72 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
# Reference: https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/
service: notifyer-cron
frameworkVersion: '3'
provider:
name: aws
runtime: nodejs18.x
memorySize: 512 # optional, in MB, default is 1024
timeout: 60
stage: ${opt:stage,'dev'}
region: ap-southeast-2
profile: serverless
environment: ${file(env.yml):${self:provider.stage}}
iamRoleStatements:
- Effect: "Allow"
Action:
- dynamodb:GetItem
- dynamodb:UpdateItem
- dynamodb:PutItem
Resource: "arn:aws:dynamodb:*:*:table/${self:provider.environment.DYNAMODB_TABLE}"
package:
individually: true
exclude:
- .dynamodb/**
# https://www.serverless.com/framework/docs/providers/aws/guide/resources/#aws---resources
# resources:
# Resources:
# notifyerTable:
# Type: AWS::DynamoDB::Table
# Properties:
# TableName: ${self:provider.environment.DYNAMODB_TABLE}
# AttributeDefinitions:
# - AttributeName: user
# AttributeType: S
# KeySchema:
# - AttributeName: user
# KeyType: HASH
# ProvisionedThroughput:
# ReadCapacityUnits: 1
# WriteCapacityUnits: 1
# consider BillingMode: PAY_PER_REQUEST
# https://www.serverless.com/blog/dynamodb-on-demand-serverless
plugins:
- serverless-webpack
# - serverless-dynamodb-local
- serverless-offline
# https://www.serverless.com/framework/docs/providers/aws/guide/functions/
functions:
app:
handler: handler.app
events: ${file(events.yml):${self:provider.stage}}
custom:
webpack:
includeModules: false
# dynamodb:
# # If you only want to use DynamoDB Local in some stages, declare them here
# stages:
# - dev