forked from steve-c-thompson/standup-bot-serverless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
86 lines (85 loc) · 2.17 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
85
86
service: slack-standup
frameworkVersion: '3'
provider:
lambdaHashingVersion: "20201221"
name: aws
runtime: nodejs14.x
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
stage: ${self:provider.stage}
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'us-west-2'}
memorySize: 256
logRetentionInDays: 5
resources:
Resources:
StatusDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: "id"
AttributeType: "S"
- AttributeName: "userId"
AttributeType: "S"
KeySchema:
- AttributeName: "id"
KeyType: "HASH"
- AttributeName: "userId"
KeyType: "RANGE"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.stage}_STANDUP_STATUS
TimeToLiveSpecification:
AttributeName: timeToLive
Enabled: true
functions:
slack:
handler: src/app.handler
events:
- http:
path: slack/events
method: post
iamRoleStatements:
- Effect: "Allow"
Action:
- "secretsmanager:GetSecretValue"
Resource:
Fn::Join:
- ':'
- - 'arn:aws:secretsmanager'
- ${self:provider.region}
- Ref: 'AWS::AccountId'
- 'secret'
- 'SlackStandup-secret-*'
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
Fn::Join:
- ':'
- - 'arn:aws:dynamodb'
- ${self:provider.region}
- Ref: 'AWS::AccountId'
- 'table/*_STANDUP_STATUS'
plugins:
- serverless-webpack
- serverless-iam-roles-per-function
- serverless-offline
package:
excludeDevDependencies: true
# individually: true
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
# forceExclude:
# - aws-sdk
excludeFiles:
- src/**/*.test.js
- src/test/scripts/*.ts