-
Notifications
You must be signed in to change notification settings - Fork 69
AWS edge integration doc #3573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
AWS edge integration doc #3573
Conversation
docs/integrations/aws.md
Outdated
|
||
## Overview | ||
|
||
Statsig now offers support to use statsig configs on AWS edge services, providing low latency for gate and experiment evaluations in your AWS project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this - "now" is meaningless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
docs/integrations/aws.md
Outdated
|
||
Statsig now offers support to use statsig configs on AWS edge services, providing low latency for gate and experiment evaluations in your AWS project. | ||
|
||
This integration uses the bring your own CDN model from the statsig edge client. This guide will highlight the most optimal setup for using statsig with AWS to leverage performance on the edge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"bring your own CDN model from the statsig edge client"
This is also meaningless to someone reading the doc for the first time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed. I put this sentence here so it made a bit more sense later why the method is called initalizeFromCDN()
docs/integrations/aws.md
Outdated
|
||
## S3 Storage Setup | ||
|
||
The S3 bucket will be leveraged to store your statsig Config specifications. Since Amazon does not provide a traditional KV store for lambda@edge, we will treat the S3 storage as our KV store. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont use passive voice. "will be leveraged"
"For edge integrations, the statsig SDK needs access to storage located as close to the lambda as possible. On aws, we recommend storing your statsig project definition in an s3 bucket" or something like that.
Also, can you make this generic? Im pretty sure you can sub gcp function / gcp data store in for lambda/s3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed section paragraph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc walks users through a start to finish setup using AWS. There are many AWS specific components in the doc. Wouldn't it make more sense to have a separate doc for GCP?
docs/integrations/aws.md
Outdated
- Call the statsig CDN endpoint with you client key. | ||
|
||
```bash | ||
https://api.statsigcdn.com/v1/download_config_specs/<YOUR_CLIENT_API_KEY>.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make this a curl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
docs/integrations/aws.md
Outdated
**CRITICAL**: Must be created in **us-east-1** region | ||
|
||
1. Change region to **us-east-1** (top-right corner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? does this not work otherwise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/integrations/aws.md
Outdated
This setup guide aims to complete every step through the AWS console. We suggest you work on your project on your local. Once you are ready to deploy your code, upload it as a zip to your function's code tab. Ensure your project is built and all packages are installed before you test or deploy it in the Lambda console. | ||
|
||
Further explanation and breakdown of the usage of the statsig SDK within this code will be provided later in this guide. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make it clear which variables they need to plug in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
Further explanation and breakdown of the usage of the statsig SDK within this code will be provided later in this guide. | ||
|
||
```javascript | ||
import { StatsigEdgeClient } from "@statsig/edge-client"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesnt exist yet, but good ot have the docs ready
docs/integrations/aws.md
Outdated
callback(null, { | ||
status: "200", | ||
statusDescription: "OK", | ||
headers: { | ||
"content-type": [{ key: "Content-Type", value: "application/json" }], | ||
}, | ||
body: JSON.stringify({ | ||
success: false, | ||
error: error.message, | ||
message: "Fallback response", | ||
}), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdk initialization shouldnt really have a fialure case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
4. Click **Publish** | ||
5. **Copy the Version ARN** (ends with :1) - you'll need this for CloudFront | ||
|
||
### Create IAM Execution Role for Lambda@Edge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So is this specific to lambda at edge, but not lambda? can we make the setup for just lambda clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
docs/integrations/aws.md
Outdated
### Install | ||
|
||
```bash | ||
npm install @statsig/edge-client | ||
``` | ||
|
||
Install the statsig edge SDK. This SDK is a one stop shop for all edge integrations, including AWS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird that you go back to lambda and THEN break down the code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guide doesnt mention anything about how to keep the spec up to date
Description
Brief summary or screenshot of your changes
Best practice checklist
Questions?
Reach out to Brock or Tore on Slack!