This is a template for using Amazon Web Services such as DynamoDB and SQS from a Cloudflare Worker.
This project is not related to, affiliated with, sponsored or endorsed by Amazon Web Services.
To generate using wrangler
wrangler generate projectname https://github.com/cloudflare/workers-aws-template
cd projectname
index.js
is the content of the Workers script. See the commented areas of the code for where to fill in your region, table name, etc.
You'll need to use wrangler secrets to add appropriate values for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SQS_QUEUE_URL, e.g.
wrangler secret put AWS_ACCESS_KEY_ID
After that you can use wrangler publish
as normal. See the wrangler documentation for more information.
These examples use v3 of the AWS SDK for JavaScript, see that repository for more information.