Releases: andela-sjames/serverless-getPage
Version 4
Run locally?
download the zip file, unzip and change directory into document folder.
Install serverless
npm install -g serverless
setup AWS
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 -o --provider aws --key your_xxx_key --secret your_xxx_secret
v4
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.
deploy
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
Redeploy:
deploy
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.
removal
serverless remove -v
Version 3.1
Run locally?
download the zip file, unzip and change directory into document folder.
Install serverless
npm install -g serverless
setup AWS
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
v3
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.
deploy
serverless deploy
Once deployed you can go to the us-west-1 region on AWS to view the services and to invoke the lambda function as well.
OR
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
removal
serverless remove -v
Version 3
Run locally?
download the zip file, unzip and change directory into document folder.
Install serverless
npm install -g serverless
setup AWS
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
v3
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.
deploy
serverless deploy
Once deployed you can go to the us-west-1 region on AWS to view the services and to invoke the lambda function as well.
OR
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
removal
serverless remove -v
Version 2
Run locally?
download the zip file, unzip and change directory into document folder.
Install serverless
npm install -g serverless
setup AWS
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
v2
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.
deploy
serverless deploy
Once deployed you can go to the us-west-1 region on AWS to view the services and to invoke the lambda function as well using the object
{
"page_url": "https://www.cnn.com"
}
removal
serverless remove -v
Version 1
Reference:
https://serverless.com/framework/docs/providers/aws/guide/intro/
Run locally?
download the zip file, unzip and change directory into document
folder.
Install serverless
npm install serverless
setup AWS
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 -o --provider aws --key your_xxx_key --secret your_xxx_secret
Invoke the serverless locally V1.
link: https://serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/
serverless invoke local --function get_page_title_handler -p event.json
deploy
serverless deploy
removal
serverless remove -v