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
Copy file name to clipboardExpand all lines: README.md
+92-62Lines changed: 92 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,13 @@ Add the plugin to your package.json's devDependencies and to the plugins array
31
31
in your `serverless.yml` file
32
32
33
33
Terminal:
34
+
34
35
```
35
36
npm install --save-dev serverless-aws-alias
36
37
```
37
38
38
39
serverless.yml:
40
+
39
41
```
40
42
plugins:
41
43
- serverless-aws-alias
@@ -58,6 +60,23 @@ be changed for a deployed version by accident, as it can be done with the
58
60
`$LATEST` qualifier.This adds an additional level of stability to your deployment
59
61
process.
60
62
63
+
## Custom Variable - pluginDibsAwsAlias:alias
64
+
65
+
The plugin [registers a custom variable source](https://www.serverless.com/framework/docs/guides/plugins/custom-variables), `pluginDibsAwsAlias`, with a single variable, `alias`, enabling retrieval of the alias in serverless config.
66
+
67
+
```yaml
68
+
# serverless.yml
69
+
...
70
+
plugins:
71
+
- dibs-serverless-aws-alias
72
+
...
73
+
functions:
74
+
imageConvert:
75
+
...
76
+
description: ${pluginDibsAwsAlias:alias} - convert images to smaller, web-friendly images
77
+
...
78
+
```
79
+
61
80
## Deploy a single function
62
81
63
82
The plugin supports `serverless deploy function` and moves the alias to the
@@ -303,7 +322,7 @@ resources:
303
322
ShardCount: 1
304
323
```
305
324
306
-
When a function is deployed to an alias it will now also listen to the *my-kinesis*
325
+
When a function is deployed to an alias it will now also listen to the _my-kinesis_
307
326
stream events. This is useful, if you want to test new implementations with an
308
327
existing resource.
309
328
@@ -378,6 +397,7 @@ deployed alias you can combine it with the `--alias` option as usual.
378
397
## The alias command
379
398
380
399
## Subcommands
400
+
381
401
### alias remove
382
402
383
403
Removes an alias and all its uniquely referenced functions and function versions.
@@ -437,9 +457,9 @@ If you are not happy with the plugin or just do not like me, you can easily get
437
457
of the plugin without doing any harm to the deployed stuff. The plugin is
438
458
non-intrusive and does only add some output variables to the main stack:
439
459
440
-
* Remove all alias stacks via the CloudFormation console or with 'alias remove'
441
-
* Remove the plugin from your serverless.yml and your package.json
442
-
* Deploy the service again (serverless deploy)
460
+
- Remove all alias stacks via the CloudFormation console or with 'alias remove'
461
+
- Remove the plugin from your serverless.yml and your package.json
462
+
- Deploy the service again (serverless deploy)
443
463
444
464
You're all set.
445
465
@@ -453,26 +473,27 @@ internal networks. This is possible because each deployed AWS lambda version
453
473
contains its entire configuration (VPC settings, environment, etc.)
454
474
455
475
## For developers
476
+
456
477
### Lifecycle events
457
478
458
479
_currently the exposed hooks are not available after the change to the new SLS lifecycle model_
459
480
460
481
The plugin adds the following lifecycle events that can be hooked by other plugins:
461
482
462
-
* alias:deploy:uploadArtifacts
483
+
- alias:deploy:uploadArtifacts
463
484
464
485
Upload alias dependent CF definitions to S3.
465
486
466
-
* alias:deploy:updateAliasStack
487
+
- alias:deploy:updateAliasStack
467
488
468
489
Update the alias CF stack.
469
490
470
-
* alias:deploy:done
491
+
- alias:deploy:done
471
492
472
493
The Alias plugin is successfully finished. Hook this instead of 'after:deploy:deploy'
473
494
to make sure that your plugin gets triggered right after the alias plugin is done.
474
495
475
-
* alias:remove:removeStack
496
+
- alias:remove:removeStack
476
497
477
498
The alias stack is removed from CF.
478
499
@@ -485,76 +506,88 @@ and _serverless.service.provider.deployedAliasTemplates[]_.
485
506
486
507
## Ideas
487
508
488
-
* The master alias for a stage could be protected by a separate stack policy that
509
+
- The master alias for a stage could be protected by a separate stack policy that
489
510
only allows admin users to deploy or change it. The stage stack does not have
490
511
to be protected individually because the stack cross references prohibit changes
491
512
naturally. It might be possible to introduce some kind of per alias policy.
492
513
493
514
## Version history
494
515
495
-
* 1.8.0
496
-
* Option to retain lambda function versions [#160][link-160]
497
-
***Breaking** drop Node.js 6 support [#161][link-161]
516
+
- 1.8.0
517
+
518
+
- Option to retain lambda function versions [#160][link-160]
519
+
-**Breaking** drop Node.js 6 support [#161][link-161]
520
+
521
+
- 1.7.2
522
+
523
+
- Added support for Lambda custom roles [#87][link-87][#88][link-88]
524
+
- Added support for dash in alias name when creating api gateway authorizers [#140][link-140]
525
+
- Configurable master alias [#127][link-127]
526
+
- Fix for "functionnames" where "functionname" A starts with function name B [#159][link-159]
527
+
- Dependencies updated
498
528
499
-
* 1.7.2
500
-
* Added support for Lambda custom roles [#87][link-87][#88][link-88]
501
-
* Added support for dash in alias name when creating api gateway authorizers [#140][link-140]
502
-
* Configurable master alias [#127][link-127]
503
-
* Fix for "functionnames" where "functionname" A starts with function name B [#159][link-159]
504
-
* Dependencies updated
529
+
- 1.7.1
505
530
506
-
* 1.7.1
507
-
* Restore compatibility with Serverless 1.27 [#120][link-120]
531
+
- Restore compatibility with Serverless 1.27 [#120][link-120]
508
532
509
-
* 1.7.0
510
-
* Support existing custom authorizers [#101][link-101]
511
-
* Support domain-manager plugin [#110][link-110]
512
-
* Support pseudo-parameter plugin [#112][link-112]
513
-
* Show logs from arbitrary versions [#62][link-62], [#89][link-89]
0 commit comments