-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverless.yml
85 lines (78 loc) · 2.07 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: simple-book-catalog
plugins:
- serverless-python-requirements
- serverless-plugin-cloudwatch-dashboard
- serverless-finch
custom:
stage: ${opt:stage, self:provider.stage}
pythonRequirements:
dockerizePip: non-linux
region:
default: us-west-2 # London
deletionPolicy:
dev: Delete
prod: Retain
logRetention:
prod: 180
default: 14
DBClusterARN:
Fn::Join:
- ':'
- - 'arn:aws:rds'
- Ref: 'AWS::Region'
- Ref: 'AWS::AccountId'
- 'cluster'
- !Ref AuroraDBCluster
client:
bucketName: ${self:custom.stage}-${self:service.name}-app-ui
distributionFolder: app_ui
provider:
name: aws
runtime: python3.7
stage: dev
region: ${self:custom.region.${self:custom.stage}, self:custom.region.default}
stackName: ${self:custom.stage}-${self:service.name}
stackTags:
APP: Aurora Serverless Demo
STAGE: ${self:custom.stage}
logs:
restApi: true
logRetentionInDays: ${self:custom.logRetention.${self:custom.stage}, self:custom.logRetention.default}
package:
exclude:
- node_modules/**
- package.json
- package-lock.json
- README.md
- .venv/**
- load-tests/**
- htmlcov/**
- docs/**
- tests/**
functions:
DBMigration:
name: ${self:provider.stackName}-DBMigration
description: Executes DB Schema Migrations => creates database and tables
handler: db/code/db.handler
memorySize: 512
timeout: 100
role: DBMigrationRole
dependsOn:
- DBMigrationLogGroup
environment:
DB_CLUSTER_ARN:
${self:custom.DBClusterARN}
DB_SECRET_ARN:
!Ref ClusterSecret
DB_NAME: 'rds_simple_book_catalog'
resources:
- ${file(db/resources/stackinfo.yml)}
# VPC
- ${file(db/resources/vpc/vpc.yml)}
# RDS Aurora Serverless
- ${file(db/resources/rds/AuroraRDSServerless.yml)}
# Log Groups
- ${file(db/resources/loggroups/LogGroups.yml)}
# cfn Custom Resource
- ${file(db/resources/custom/DBMigrationTrigger.yml)}
- ${file(db/resources/custom/DBMigrationRole.yml)}