A simple serverless framework system used to retrieve minute details of a web page.
https://serverless.com/framework/docs/providers/aws/guide/intro/
download the zip file, unzip and change directory into document folder.
npm install -g serverless
NB: IAM AWS user should have programmatic access with policy to interact with lambda services such as DynamoDB, S3, Lambda, Cloudformation, Cloudwatch and IAM amongst others depending on your use-case.
serverless config credentials --provider aws --key your_xxx_key --secret your_xxx_secret
Change directory to document
& run npm install
NB: You should have docker running on your system before deploying, as this allows python packages to be added to the lambda function.
serverless deploy
Once deployed go to your dynamodb service on us-east-1; under the overview
tab for table UrlDocument
get the arn from the Latest stream ARN
label
arn:aws:dynamodb:us-east-1:{your_account_id}:table/UrlDocument/stream/2019-06-07T14:34:54.231
update the serverless.yml config under
functions.get_page_title_handler.events.stream
events:
- stream: arn:aws:dynamodb:us-east-1:{your_account_id}:table/UrlDocument/stream/2019-06-07T14:34:54.231
serverless deploy
Run this command locally to invoke the AWS lambda function
serverless invoke -f create_request_identifier_handler -s dev -r us-east-1 -l -p event.json
Verify by checking s3 and dynamoDB for the latest changes/updates.
serverless remove -v