monitor-link-svc
Monitor registered web links and notify about updated pages via slack
Lambda in console: https://us-west-2.console.aws.amazon.com/lambda/home?region=us-west-2#/functions/monitorlinks
Logs of runs: https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logsV2:log-groups/log-group/$252Faws$252Flambda$252Fmonitorlinks
This service is written as an AWS Lambda function that receives a daily CloudWatch cron event.
Json documents for registered links and last state are kept in AWS S3.
https://s3.console.aws.amazon.com/s3/buckets/sigscidev-monitor-links/?region=us-east-2&tab=overview
The registered links are kept in a json document, ex:
{
links : [
{ "link": "http://abc", "channel": "ops", "msg":"The abc repo has been updated" },
{ "link": "https://xyz", "channel": "nsync", "msg":"The xyz product list has been updated" },
]
}
The last state for each link is kept in a separate document, ex:
{
page_status : [
{ "link": "http://abc", "hash": "xxx" },
{ "link": "https://xyz", "hash": "zzz"}
]
}
Development Environment
In your local dev environment, ie. Mac laptop:
`make build`
In order to test, be sure to have an AWS profile named "sigsci_prod" setup for your sigsci account in order to allow the service to able to access AWS resources.
make test
Will build (if needed), start a local aws lambda testing service, load the new binary, and execute it.
Deploying changes to lambda
If you are satisfied that the code you've written is good:
`make deploy`
uploads your artifact for use by the next run of the lambda.