-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
110 lines (102 loc) · 3 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
#
# Happy Coding!
service: serverless-hyperledger
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
frameworkVersion: ">=1.1.0 <2.0.0"
provider:
name: aws
runtime: nodejs8.10
stage: ${self:provider.environment.STAGE}
region: us-east-2 # Overwrite the default region used. Default is us-east-1
profile: ${self:custom.profiles.${self:provider.environment.PROFILE}}
apiKeys:
- hyperledger-${self:provider.environment.STAGE}-api-key
usagePlan:
quota:
limit: 5000
offset: 0
period: DAY
throttle:
burstLimit: 200
rateLimit: 100
environment:
STAGE: ${opt:stage, self:custom.defaultStage}
PROFILE: ${opt:profile, self:custom.defaultProfile}
HOME: /tmp
NETWORK: com.emastersapp
CARDNAME: admin@proak-hyperledger-network
plugins:
- serverless-webpack
- serverless-offline
- serverless-plugin-split-stacks
custom:
splitStacks:
perFunction: true
perType: false
individually:
dev: true
prod: true
defaultStage: v1
defaultProfile: dev
profiles:
dev: devProfile
prod: prodProfile
webpack:
webpackConfig: 'webpack.config.js' # Name of webpack configuration file
includeModules:
forceInclude:
- composer-wallet-filesystem
- composer-connector-hlfv1
forceExclude:
- aws-sdk
- node-mailer
packager: 'npm' # Packager that will be used to package your external modules
packagerOptions:
scripts:
- npm rebuild grpc --target=8.1.0 --target_arch=x64 --target_platform=linux --target_libc=glibc
package:
excludeDevDependencies: true
individually: ${self:custom.individually.${self:provider.environment.PROFILE}}
exclude:
- .gitignore
- .git/**
functions:
networkPing:
description: "Network Ping"
handler: api/network/ping/handler.default
memorySize: 256
timeout: 30
events:
- http:
path: network/ping
method: GET
cors: true # Turn on CORS for this endpoint, but don't forget to return the right header in your response
private: true
headers:
- Content-Type
- X-Api-Key
transactionSubmit:
description: "Transaction Submit"
handler: api/transaction/submit/handler.default
memorySize: 256
timeout: 30
events:
- http:
path: transaction/submit
method: POST
cors: true # Turn on CORS for this endpoint, but don't forget to return the right header in your response
private: true
headers:
- Content-Type
- X-Api-Key