1.1.0 • Published 3 years ago

@bgcbrasil/usage-notifier-dynamodb-plugin v1.1.0

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
3 years ago

bgc-usage-notifier-dynamodb-plugin

Install

Install the module as a dependency

npm i @bgcbrasil/usage-notifier-dynamodb-plugin

Use

Add @bgcbrasil/usage-notifier-dynamodb-plugin to your plugins list on serverless.yml

plugins:
  - '@bgcbrasil/usage-notifier-dynamodb-plugin'
  - ...
  - ...

Add following variables to custom params:

provider:
	environment:
		stage: dev

custom:
	stage: dev #required
	usageNotifierWebhookUrl:
		dev: https://google.com
		staging: https://google.com
		production: https://google.com
	serviceId: # serviceId at admin
		dev: 12
		staging: 13
		production: 14
	usageNotifierDynamodb:
		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
				requesterFilter: principalGroup # 'principalGroup' or 'clientId'
				description: All Searches # optional
				resourceName: dynamodbSearchesTable  # This must be a environment key holding the table name.
				extraFilters: # optional
					status: done
			- candidates:
				name: Candidates
				requesterFilter: clientId
				resourceName: dynamodbCandidatesTable  # This must be a environment key holding the table name.
				description: Candidates

Observations

  • If you use webpack, you must forceInclude the module
  • Its necessary an index where the hash key is the requesterFilter
1.1.0

3 years ago

1.1.0-beta.1

3 years ago

1.1.0-dev.1

3 years ago

1.0.0

3 years ago

1.0.0-dev.2

3 years ago

1.0.0-dev.1

3 years ago