-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
85 lines (77 loc) · 1.97 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
service: vacgom-codef-api
frameworkVersion: '3'
useDotenv: true
plugins:
- serverless-plugin-typescript
- serverless-plugin-additional-stacks
- serverless-dynamodb
- serverless-offline
custom:
additionalStacks:
permanent:
Resources:
requestTokensTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: requestTokensTable
KeySchema:
- AttributeName: id
KeyType: HASH
AttributeDefinitions:
- AttributeName: id
AttributeType: S
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TimeToLiveSpecification:
AttributeName: expireAt
Enabled: true
credentialsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: credentialsTable
KeySchema:
- AttributeName: id
KeyType: HASH
AttributeDefinitions:
- AttributeName: id
AttributeType: S
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
serverless-dynamodb:
start:
seed: true
migrate: true
seed:
credentialsTable:
sources:
- table: credentialsTable
sources: [ ./credentialsTable.json ]
provider:
name: aws
runtime: nodejs16.x
region: ap-northeast-2
stage: prod
environment:
SLACK_TOKEN: ${env:SLACK_TOKEN}
SLACK_CHANNEL: ${env:SLACK_CHANNEL}
JWT_SECRET: ${env:JWT_SECRET}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- ${env:CREDENTIAL_ARN}
- ${env:TOKEN_ARN}
functions:
api:
handler: src/index.handler
timeout: 300
events:
- httpApi: '*'