1
1
## Modules
2
2
3
3
<dl >
4
- <dt ><a href =" #module_index " >index </a ></dt >
4
+ <dt ><a href =" #index.module_js " >js </a ></dt >
5
5
<dd ><p >The plugin can register triggers (events) for a lambda function dynamically. At deployment time</p >
6
6
<ol >
7
7
<li >It fetches the value of a parameter in the Parameters. The value must be a list ARNs sepearted by comma.</li >
@@ -20,7 +20,32 @@ while on <em>prod</em> foo lambda function is triggered by</li>
20
20
<li >arn:aws:sns:eu-west-2:123456654321:topic2
21
21
This way we can switch features on and off on different stages.</li >
22
22
</ul >
23
- <p >The dynamic triger sets needs to ne stored in the Parameter Store of the Systems Manager (SSM) and it should look somewhat like this:</p >
23
+ <p >The dynamic trigger sets needs to ne stored in the Parameter Store of the Systems Manager (SSM) and it should look somewhat like this:
24
+ Name: /dev/dynamic-trigger
25
+ Value: arn:aws:sns:eu-west-2:123456654321: topic1 ,arn:aws:sns:eu-west-2:123456654321: topic2 ,arn:aws:sns:eu-west-2:123456654321: topic3
26
+ or
27
+ Name: /prod/dynamic-trigger
28
+ Value: arn:aws:sns:eu-west-2:123456654321: topic1 ,arn:aws:sns:eu-west-2:123456654321: topic2 </p >
29
+ <p >The config parameters:</p >
30
+ <ul >
31
+ <li >region: the region of the Systems Manager -> ; Parameter Store</li >
32
+ <li >functions:<ul >
33
+ <li >name: The name of the function</li >
34
+ </ul >
35
+ </li >
36
+ </ul >
37
+ <p >plugins:</p >
38
+ <ul >
39
+ <li >@kakkuk/serverless-aws-lambda-dynamic-trigger
40
+ custom:
41
+ dynamicTrigger:
42
+ region: " ; eu-west-2" ; // !!! Optional !!! It' ; ll fall back to AWS_DEFAULT_REGION if it' ; s not set
43
+ functions:<ul >
44
+ <li >name: " ; handler" ;
45
+ ssmPath: " ; {/path/to/triggers}" ; </li >
46
+ </ul >
47
+ </li >
48
+ </ul >
24
49
</dd >
25
50
</dl >
26
51
@@ -32,9 +57,9 @@ This way we can switch features on and off on different stages.</li>
32
57
</dd >
33
58
</dl >
34
59
35
- <a name =" module_index " ></a >
60
+ <a name =" index.module_js " ></a >
36
61
37
- ## index
62
+ ## js
38
63
The plugin can register triggers (events) for a lambda function dynamically. At deployment time
39
64
1 . It fetches the value of a parameter in the Parameters. The value must be a list ARNs sepearted by comma.
40
65
2 . Parses the individual ARNs.
@@ -52,23 +77,18 @@ while on *prod* foo lambda function is triggered by
52
77
- arn:aws:sns:eu-west-2:123456654321: topic2
53
78
This way we can switch features on and off on different stages.
54
79
55
- The dynamic triger sets needs to ne stored in the Parameter Store of the Systems Manager (SSM) and it should look somewhat like this:
56
-
57
- ** Example**
58
- ``` js
59
- * Name* : / dev/ dynamic- trigger
60
- * Value* : arn: aws: sns: eu- west- 2 : 123456654321 : topic1,arn: aws: sns: eu- west- 2 : 123456654321 : topic2,arn: aws: sns: eu- west- 2 : 123456654321 : topic3
80
+ The dynamic trigger sets needs to ne stored in the Parameter Store of the Systems Manager (SSM) and it should look somewhat like this:
81
+ Name: /dev/dynamic-trigger
82
+ Value: arn:aws:sns:eu-west-2:123456654321: topic1 ,arn:aws:sns:eu-west-2:123456654321: topic2 ,arn:aws:sns:eu-west-2:123456654321: topic3
61
83
or
62
- * Name* : / prod/ dynamic- trigger
63
- * Value* : arn: aws: sns: eu- west- 2 : 123456654321 : topic1,arn: aws: sns: eu- west- 2 : 123456654321 : topic2
84
+ Name: /prod/dynamic-trigger
85
+ Value: arn:aws:sns:eu-west-2:123456654321: topic1 ,arn:aws:sns:eu-west-2:123456654321: topic2
64
86
65
87
The config parameters:
88
+ - region: the region of the Systems Manager -> Parameter Store
66
89
- functions:
67
90
- name: The name of the function
68
- - ssmPath: Path to ssm which stores the triggers for the function . The value of the parameter should be a list of aws arns.
69
- ```
70
- **Example**
71
- ```js
91
+
72
92
plugins:
73
93
- @kakkuk/serverless-aws-lambda-dynamic-trigger
74
94
custom:
@@ -77,7 +97,7 @@ custom:
77
97
functions:
78
98
- name: "handler"
79
99
ssmPath: "{/path/to/triggers}"
80
- ```
100
+
81
101
<a name =" Package @kakkuk/serverless-aws-lambda-dynamic-trigger " ></a >
82
102
83
103
## Package @kakkuk/serverless-aws-lambda-dynamic-trigger
0 commit comments