forked from rpidanny/serverless-cognito-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
75 lines (69 loc) · 1.86 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
service: ${self:custom.projectName}
plugins:
- serverless-offline
- serverless-plugin-typescript
- serverless-plugin-include-dependencies
package:
individually: true
include:
# - src/assets/**/*
exclude:
- node_modules/**
- README.md
- package.json
- package-lock.json
provider:
name: aws
runtime: nodejs12.x
region: eu-west-1
versionFunctions: false
tracing:
lambda: true
apiGateway: true
stage: ${self:custom.currentStage}
stackTags:
PROJECT: ${self:service}
STAGE: ${opt:stage, self:provider.stage}
tags:
PROJECT: ${self:service}
STAGE: ${opt:stage, self:provider.stage}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:PutObject"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- Ref : DataBucket
- "/*"
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- "Fn::GetAtt": [ DynamoDbTable, Arn ]
custom:
projectName: cognito-boilerplate
defaultStage: ${env:USER}
currentStage: ${opt:stage, self:custom.defaultStage}
userPoolName: ${self:service}-${self:provider.stage}-userpool
userPoolClientName: ${self:service}-${self:provider.stage}-webclient
identityPoolName:
Fn::Join:
- ''
- !Split ['-', '${self:service}-${self:provider.stage}-identitypool']
dynamoDbTableName: ${self:service}-${self:provider.stage}-table
dataBucketName: ${self:service}-${self:provider.stage}-databucket
functions:
- ${file(functions/helloworld.yml)}
resources:
- ${file(resources/cognito-user-pool.yml)}
- ${file(resources/cognito-identity-pool.yml)}
- ${file(resources/s3-bucket.yml)}
- ${file(resources/dynamodb-table.yml)}