- Create an S3 bucket. It can be called whatever you want. There are guides for this.
- Go to Properties -> Static Web Hosting and then "Enable website hosting". Then enter a value for the "Index Document". "index.html" is fine.
- Then, in Permissions -> Add CORS Configuration (Edit CORS Configuration if you've added a CORS configuration previously), paste in CORS.xml. This is for development only, as it allows CORS from any origin.
- Then, in Permissions -> Add Bucket Configuration (Edit Bucket Configuration if you've added a Bucket configuration previously), paste in Bucket.json. This makes all files public by default.
- Locate your AWS key and Secret Key. You can find this in the top AWS navigation under your name -> Security Credentials.
- Add the following lines to your .env file:
AWS_ACCESS_KEY=<your-aws-access-key>
AWS_SECRET_KEY=<your-aws-secret-key>
S3_BUCKET=<your-s3-bucket>
- Restart the app if it's running, and you should be good to go.
hi @catarak, thanks for this! just setting this up for myself, I had a couple notes:
"Resource": "arn:aws:s3:::p5js-webeditor/*"
needs to match your bucket name. maybe better to post the bucket.json with line"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
?