Skip to content

Commit e04d80c

Browse files
author
Tristan Lee
authored
Merge pull request #145 from edgio-docs/aws_s3_ef_signing
Add S3 signing example
2 parents bbe0514 + 2a83744 commit e04d80c

File tree

10 files changed

+11404
-0
lines changed

10 files changed

+11404
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
S3_HOSTNAME=edgio-docs-demo.s3.us-east-2.amazonaws.com
2+
S3_REGION=us-east-2
3+
S3_ACCESS_KEY_ID=XXX
4+
S3_SECRET_ACCESS_KEY=YYY
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Edgio generated build directory
2+
/.edgio
3+
4+
/node_modules
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# S3 Request Signing Example
2+
3+
https://edgio-community-examples-v7-aws-s3-request-signing-live.glb.edgio.link/
4+
5+
## Description
6+
7+
This repository provides example code for signing requests to an S3 origin using AWS v4 signature algorithm with Edge Functions. It demonstrates how to handle requests using a router and forward them to an S3 bucket with proper authentication.
8+
9+
## Prerequisites
10+
11+
**NOTE**: To use this project, you must be an Edgio customer and signed up for the Edge Functions. See our [Edge Functions documentation](https://docs.edg.io/guides/v7/edge-functions) for information on activating this feature.
12+
13+
The system requirements include Node.js v18 or higher, and a UNIX-like system (Linux or macOS). The project code is written in JavaScript.
14+
15+
## Setup and Installation
16+
17+
1. Ensure you meet the prerequisites.
18+
2. Clone the repository to your local machine.
19+
3. Run `npm install` in the repository directory.
20+
21+
## Environment Variables
22+
23+
The following environment variables need to be set for the edge function to authenticate and sign requests correctly:
24+
25+
- `S3_HOSTNAME`: The S3 bucket hostname.
26+
- `S3_REGION`: The AWS region where the S3 bucket is located.
27+
- `S3_ACCESS_KEY_ID`: Your AWS access key ID.
28+
- `S3_SECRET_ACCESS_KEY`: Your AWS secret access key.
29+
30+
When running the project locally, these variables can be defined in a `.env` file or directly in the environment. For deployment on Edgio, these should be set in the Edgio Developer Console.
31+
32+
## Getting Started
33+
34+
After setting up the project, run `npm run edgio:dev` to start a local development server to test the example functions.
35+
36+
To deploy the project to Edgio, use the command `npm run edgio:deploy`. Note that deployment to Edgio requires you to be logged into Edgio CLI which can be done via `npm run edgio login` and following the instructions.
37+
38+
## Support
39+
40+
If you have any queries or face issues with this project, please don't hesitate to contact the [Edgio team](https://edg.io/contact-support/).
41+
42+
## License
43+
44+
[Creative Commons Attribution 4.0 International Public License](LICENSE-CONTENT) for the documentation.
45+
46+
[MIT License](LICENSE-CODE) for the code.

0 commit comments

Comments
 (0)