The Sierra reader receives windows from the window generator, fetches any modified/deleted records from Sierra, and publishes them to an SNS topic.
It's automatically deployed when Buildkite is merged to main, or you can deploy it locally by running the deploy.sh
script.
If you want to skip the "business as usual" logs, this is a good starting query:
not log:"*records to SNS*" and not log:"*Got a batch of*" and not log:"*Fetching updated records*" and not log:"*Fetching deleted records*" and not log:"*INIT_START*" and not log:"*REPORT RequestId*" and not log:"*END RequestId*" and not log:"*START RequestId*" and not log:"*Window is complete*" and not log:"*Getting Sierra access token*" and not log:"*Getting Sierra API credentials*" and not log:"*Using cached access token credentials*" and not log:"*Fetching new access token from Sierra*" and not log:"*Access token is expired, skipping cached credentials*"
You can test the Lambda by running it locally with a single window.
Use the run_lambda.sh
script and pass a resource type and a JSON-encoded window, for example:
$ AWS_PROFILE=platform-dev bash run_lambda.sh bibs '{"start": "2023-05-19T07:58:01.000000+00:00", "end": "2023-05-19T09:40:00+00:00"}'
Getting Sierra access token…
Using cached access token credentials…
Fetching updated records --> [2023-05-19T07:58:01Z,2023-05-19T09:40:00Z]
Got a batch of 3 records from Sierra…
Got a batch of 0 records from Sierra…
Fetching deleted records --> 2023-05-19
Got a batch of 0 records from Sierra…
Window is complete --> {"start": "2023-05-19T07:58:01.000000+00:00", "end": "2023-05-19T09:40:00+00:00"}