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
+26-7Lines changed: 26 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,30 @@
1
1
# serverless-aws-lambda-dynamic-trigger
2
2
3
3
The plugin can register triggers (events) for a lambda function dynamically at the time of the deployment.
4
-
1. It fetches the value of a parameter form the Parameter Store. The value must be a list ARNs separated by commas.
4
+
The usual static trigger (event) definitions can be completely omitted.
5
+
The original idea is to make the same lambda function triggered by different events on different environments (stages).
6
+
This way we can even do some basic **feature switching**.
7
+
8
+
## How it works
9
+
The plugin when the host code gets deployed...
10
+
1. Fetches the value of a defined parameter from the Parameter Store. The value must be a list ARNs separated by commas. (If there is only one trigger it's just a single ARN)
5
11
2. Parses the individual ARNs and pulls out the name of the aws service.
6
-
3.Register the ARNs as triggers with the configured lambda function or functions.
12
+
3.Registers the ARNs as triggers with the configured lambda function or functions.
7
13
8
14
Please note that you can only use the plugin with **sns**, **sqs** or **kinesis** triggers.
9
15
10
-
The original idea is to make the same lambda function triggered by different events on different environments (stages).
11
16
Like on **dev** foo lambda function is triggered by
12
17
- arn:aws:sns:eu-west-2:123456654321:topic1
13
18
- arn:aws:sns:eu-west-2:123456654321:topic2
14
19
- arn:aws:sns:eu-west-2:123456654321:topic3
15
-
while on **prod** foo lambda function is triggered by
20
+
21
+
While on **prod** foo lambda function is triggered by
16
22
- arn:aws:sns:eu-west-2:123456654321:topic1
17
23
- arn:aws:sns:eu-west-2:123456654321:topic2
24
+
18
25
This way we can switch features on and off on different stages.
19
26
20
-
The dynamic trigger sets need to ne stored in the Parameter Store of the Systems Manager (SSM) and it should look somewhat like this:
27
+
The dynamic trigger sets need to be stored in the Parameter Store of the Systems Manager (SSM) and it should look somewhat like this:
0 commit comments