Feli25 / workers-aws-template

Cloudflare Workers template for accessing AWS services such as DynamoDB and SQS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using AWS from Cloudflare Workers

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.

Wrangler

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.

AWS SDK for JavaScript

These examples use v3 of the AWS SDK for JavaScript, see that repository for more information.

About

Cloudflare Workers template for accessing AWS services such as DynamoDB and SQS

License:Apache License 2.0


Languages

Language:JavaScript 100.0%