This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowAllEC2Actions", | |
"Effect": "Allow", | |
"Action": "ec2:*", | |
"Resource": "*" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async fetch(request) { | |
// SPA routing: Rewrite non-asset paths to index.html | |
const url = new URL(request.url); | |
if (!url.pathname.startsWith('/assets/') && !url.pathname.includes('.')) { | |
url.pathname = '/index.html'; | |
} | |
const s3Url = `http://YOUR-BUCKET-NAME.s3-website.eu-west-2.amazonaws.com${url.pathname}`; | |
// Fetch the origin's response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "AllowMFAManagementAndPasswordChange", | |
"Effect": "Allow", | |
"Action": [ | |
"iam:CreateVirtualMFADevice", | |
"iam:EnableMFADevice", | |
"iam:ResyncMFADevice", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async fetch(request) { | |
// SPA routing: Rewrite non-asset paths to index.html | |
const url = new URL(request.url); | |
if (!url.pathname.startsWith('/assets/') && !url.pathname.includes('.')) { | |
url.pathname = '/index.html'; | |
} | |
// Fill in your bucket name and change eu-west-2 if needed | |
const s3Url = `http://YOUR-BUCKET-NAME.s3-website.eu-west-2.amazonaws.com${url.pathname}`; | |