# edge-fingerprint-filter

The purpose of this function is to receive messages from the kafka topics:
* `cdc.musicGraphV5.hasAsset`
* `cdc.musicGraphV5.hasFingerprintRule`
  to filter messages by actions and types, and trigger the fingerprinter SFN accordingly.

### Optional Dev Sentry DSN

If you have a dev Sentry DSN to use (using either a catch-all DSN or by setting up a dev DSN for this lambda), you can:

* `cp .env.shadow .env`
* Fill in the DSN in `.env`
* The SENTRY_DSN env var in `docker-compose.yaml` will then pick this up

If you don't fill out the environment variable, docker-compose will warn you, but it is not required.

### Running
Before the docker commands you will need to copy `common` folder from the root folder into the `scr` folder of the particular lambda.
`docker compose up --build lint-and-test` to run linting and unit tests.
`docker compose up --build function` to run the lambda in Docker.
Then run this URL: POST http://localhost:9000/2015-03-31/functions/function/invocations in a platform like Postman.
In order to test the lambda you will need to provide a body and pass a JSON data structure that mimics the kafka message.

### AWS Issues

Note `docker` will use your `~/.aws/credentials` as the aws credentials for your container. It will use the `default` profile.  So you need to ensure that `default` section is up date. If you are using `awsume` one way to do this is to run `awsume` then `env | grep AWS`. You can then use those details to update your `credentials` file before running the container.
