bgc-usage-notifier-plugin v2.1.1
bgc-usage-notifier-plugin
Install
Install the module as a dependency
npm i bgc-usage-notifier-plugin
Use
Add bgc-usage-notifier-plugin
to your plugins list on serverless.yml
plugins:
- bgc-usage-notifier-plugin
- ...
- ...
Add following variables to custom params:
provider:
environment:
stage: dev
dynamodbSearchesTable: my-cool-table-name # The lambda uses this value, its key can be customized if you change the value at custom.usageNotifier.resourceName
custom:
stage: dev #required
serviceId: # serviceId at admin
dev: 12
staging: 13
production: 14
usageNotifierWebhookUrl:
dev: https://google.com
staging: https://google.com
production: https://google.com
usageNotifier:
modelPath: Models # path defined through aliases
period: 1 day # '1 day', '7 days' or '30 days'
serviceId: ${self:custom.serviceId.${self:custom.stage}} # id defined at bgc-admin service
token: ${self:provider.environment.systemToken} # service token
webhookUrl: ${self:custom.usageNotifierWebhookUrl.${self:custom.stage}} # discord url to be notified
useOnDev: true # to use the plugin on dev environment
useOnStaging: false # to use the plugin on staging environment
models:
- searches:
name: Search # model name
dbType: dynamodb # 'dynamodb' or 'rds'
requesterFilter: principalGroup # 'principalGroup' or 'clientId'
resourceName: dynamodbSearchesTable # This must be a environment key holding the table name.
description: All Searches # optional
extraFilters: # optional
status: done
- candidates:
name: Candidates
dbType: dynamodb
requesterFilter: clientId
description: Candidates
Observations
- If you use webpack, you must forceInclude the module
- When using dynamodb table, its required to have an index with
principalGroup/clientId
key - Notification for RDS are not working yet
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago