Devin
02/25/2022, 11:53 PM503 ERROR
The request could not be satisfied.
The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
So I “think” the problem is that I need to make the bucket public. But it’s not super obvious that I’m correct. I”m deploying now to test.
const staticSite = new sst.StaticSite(this, "Site", {
path: "website",
errorPage: "404.html",
buildOutput: "public",
buildCommand: "npm run build",
s3Bucket: {
accessControl: BucketAccessControl.PUBLIC_READ, // added this to make it public
},
cfDistribution: {
defaultBehavior: {
allowedMethods: ["GET"],
edgeLambdas: [
{
functionVersion: originRewriteHandler.currentVersion, // this is the edge function referenced above
eventType: LambdaEdgeEventType.ORIGIN_REQUEST,
},
],
},
},
});
Does that seem correct?
it wasn’t 😞Patrick
02/26/2022, 12:31 AMNextjsSite
construct for this.
Even if you’re not using building with Next, you may still want to look into that construct and see how they handle the permissions for the Lambda edge handler under the hoodDevin
02/26/2022, 12:32 AMDevin
02/26/2022, 12:32 AMFrank
Frank
publicReadAccess
on the bucket, ie.
const staticSite = new sst.StaticSite(this, "Site", {
...
s3Bucket: {
publicReadAccess: true
},
...
});
Devin
02/27/2022, 1:45 PMwebsiteIndexDocument
is a problem.Devin
02/27/2022, 7:30 PMFrank