-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,66 @@ | ||
# serverless-plugin-subscription-filter | ||
# serverless-plugin-subscription-filter | ||
|
||
[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com) | ||
|
||
Serverless plugin to register AWS CloudWatchLogs subscription filter. | ||
|
||
## Installation | ||
|
||
`npm install --save-dev serverless-plugin-subscription-filter` | ||
|
||
```yaml | ||
plugins: | ||
- serverless-plugin-subscription-filter | ||
``` | ||
## Usage | ||
This plugin is external serverless events. | ||
You can write settings like serverless events. | ||
```yaml | ||
functions: | ||
hello: | ||
handler: handler.hello | ||
events: | ||
- subscriptionFilter: | ||
stage: prod | ||
logGroupName: /cloud-trail | ||
filterPattern: "{ $.errorMessage != '' }" | ||
``` | ||
Supports also multiple subscription filter. | ||
```yaml | ||
functions: | ||
hello: | ||
handler: handler.hello | ||
events: | ||
- subscriptionFilter: | ||
stage: prod | ||
logGroupName: /cloud-trail | ||
filterPattern: "{ $.errorMessage != '' }" | ||
- subscriptionFilter: | ||
stage: prod | ||
logGroupName: /my-log-group | ||
filterPattern: "{ $.errorMessage != '' }" | ||
goobye: | ||
handler: handler.goodbye | ||
events: | ||
- subscriptionFilter: | ||
stage: dev | ||
logGroupName: /my-log-group2 | ||
filterPattern: Exception | ||
``` | ||
### About each properties | ||
|property|description| | ||
|:---:|:---:| | ||
|stage|The deployment stage with serverless. Sorry, only one subscription filter can be set for one LogGroup.| | ||
|logGroupName|The log group to associate with the subscription filter. | | ||
|filterPattern|The filtering expressions that restrict what gets delivered to the destination AWS resource. Sorry, if you want to use "{ $.xxx == yyy }" syntax, then surround ""(double quote).| | ||
## Future supports | ||
* Set IAM Role for subscription filter |