You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added multilevel stage configuration
* Updated README
* Do not set default values explicitly on methods
* Fixed layout issues in README stage example
* Added unit tests for stage generation and configuration
* Fixed layout issues in README. Removed alpha release notes.
There are two further options that can only be specified on a service level and that
125
+
affect the whole stage:
126
+
127
+
```
128
+
aliasStage:
129
+
cacheClusterEnabled: (Boolean)
130
+
cacheClusterSize: (Integer)
131
+
```
132
+
133
+
For more information see the [AWS::APIGateway::Stage](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html) or [MethodSettings](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apitgateway-stage-methodsetting.html) documentation
134
+
on the AWS website.
135
+
136
+
Sample serverless.yml (partial):
137
+
138
+
```
139
+
service: sls-test-project
140
+
141
+
provider:
142
+
...
143
+
# Enable detailed error logging on all endpoints
144
+
aliasStage:
145
+
loggingLevel: "ERROR"
146
+
dataTraceEnabled: true
147
+
...
148
+
149
+
functions:
150
+
myFunc1:
151
+
...
152
+
# myFunc1 should generally not log anything
153
+
aliasStage:
154
+
loggingLevel: "OFF"
155
+
dataTraceEnabled: false
156
+
events:
157
+
- http:
158
+
method: GET
159
+
path: /func1
160
+
- http:
161
+
method: POST
162
+
path: /func1/create
163
+
- http:
164
+
method: PATCH
165
+
path: /func1/update
166
+
# The update endpoint needs special settings
167
+
aliasStage:
168
+
loggingLevel: "INFO"
169
+
dataTraceEnabled: true
170
+
throttlingBurstLimit: 200
171
+
throttlingRateLimit: 100
172
+
173
+
myFunc2:
174
+
...
175
+
# Will inherit the global settings if nothing is set on function level
176
+
```
177
+
95
178
## Reference the current alias in your service
96
179
97
180
You can reference the currently deployed alias with `${self:provider.alias}` in
@@ -174,11 +257,11 @@ functions:
174
257
path: /func1
175
258
resources:
176
259
Resources:
177
-
myKinesis:
178
-
Type: AWS::Kinesis::Stream
179
-
Properties:
180
-
Name: my-kinesis
181
-
ShardCount: 1
260
+
myKinesis:
261
+
Type: AWS::Kinesis::Stream
262
+
Properties:
263
+
Name: my-kinesis
264
+
ShardCount: 1
182
265
```
183
266
184
267
When a function is deployed to an alias it will now also listen to the *my-kinesis*
@@ -214,11 +297,11 @@ functions:
214
297
path: /func1
215
298
resources:
216
299
Resources:
217
-
myKinesis${self:provider.alias}:
218
-
Type: AWS::Kinesis::Stream
219
-
Properties:
220
-
Name: my-kinesis-${self.provider.alias}
221
-
ShardCount: 1
300
+
myKinesis${self:provider.alias}:
301
+
Type: AWS::Kinesis::Stream
302
+
Properties:
303
+
Name: my-kinesis-${self.provider.alias}
304
+
ShardCount: 1
222
305
```
223
306
224
307
### Named streams
@@ -343,7 +426,7 @@ The plugin adds the following lifecycle events that can be hooked by other plugi
343
426
* alias:deploy:done
344
427
345
428
The Alias plugin is successfully finished. Hook this instead of 'after:deploy:deploy'
346
-
to make sure that your plugin gets triggered right after the alias plugin is done.
429
+
to make sure that your plugin gets triggered right after the alias plugin is done.
347
430
348
431
* alias:remove:removeStack
349
432
@@ -360,8 +443,8 @@ and _serverless.service.provider.deployedAliasTemplates[]_.
360
443
361
444
* The master alias for a stage could be protected by a separate stack policy that
362
445
only allows admin users to deploy or change it. The stage stack does not have
363
-
to be protected individually because the stack cross references prohibit changes
364
-
naturally. It might be possible to introduce some kind of per alias policy.
446
+
to be protected individually because the stack cross references prohibit changes
447
+
naturally. It might be possible to introduce some kind of per alias policy.
365
448
366
449
## Version history
367
450
@@ -381,19 +464,3 @@ and _serverless.service.provider.deployedAliasTemplates[]_.
381
464
382
465
383
466
* 1.0.0 Support "serverless logs" with aliases. First non-alpha!
384
-
* 0.5.1-alpha1 Use separate Lambda roles per alias
385
-
* 0.5.0-alpha1 Fixes a bug with deploying event sources introduced with 0.4.0
386
-
Use new event model introduced in SLS 1.12. Needs SLS 1.12 or greater from now on.
387
-
Add support for CW events.
388
-
Set SERVERLESS_ALIAS environment variable on deployed functions.
389
-
* 0.4.0-alpha1 APIG support fixed. Support external IAM roles. BREAKING.
390
-
* 0.3.4-alpha1 Bugfixes. IAM policy consolitaion. Show master alias information.
0 commit comments