Hey, so I’m working with `sst.NextjsSite` and `sst...
# sst
b
Hey, so I’m working with
sst.NextjsSite
and
sst start
worked well (including the cool
sst-env
shim). I’m looking to deploy this in
ca-central-1
but now that I’m done, I’m deploying and getting the following error:
Copy code
username-mysite-frontend-website | UPDATE_FAILED | AWS::CloudFront::Distribution | SiteDistribution390DED28 Resource handler returned message: "Invalid request provided: The function must be in region 'us-east-1'. ARN: arn:aws:lambda:ca-central-1:1234:function:username-mysite-fronten-SiteMainFunction123-YYZ:3 (Service: CloudFront, Status Code: 400, Request ID: ABC, Extended Request ID: null)" (RequestToken: ABC, HandlerErrorCode: InvalidRequest)
I thought maybe it was the cloudfront distribution, which I’ve tried to disable, still now joy - any pointers?
Copy code
// Create a Next.js site
    const site = new sst.NextjsSite(this, 'Site', {
      path: 'nextjs',
      cfDistribution: {
        enabled: false,
      },
      environment: {
        // Pass the table details to our app
        REGION: scope.region,
        API_URLS: Fn.select(0, apiUrls),
      },
    })
note my
stage
is using the new aws username option hence
username
and yeah,
ca-central-1
is set in my
sst.json
f
Hey @Blake E, I’m taking a look right now.
b
Update: I imagine it’s because it’s setup as an lambda@edge - for testing/prototyping purposes I really don’t care about that boost. Looking at the
NextjsSite
construct I can see
lambda@edge
is bundled with cloudfront support etc. I’d settle for an ugly URL but no expecting any solution in near-term - I’ll use another region for now.
f
Blake, I was able to reproduce the issue on my end. Working on a fix.
b
Update: I thought maybe it could be how my certificates were setup (maybe trying to utilize a different region) but no joy - still assuming it’s
lambda@edge
and using
us-east-1
for now (works as expected)
f
Yeah still working on the fix… need to rewrite a part of it to deploy the edge lambdas to us-east-1 while the rest resources to the app’s region
b
thanks, no pressure 😉 (just posting for lurkers mostly)
t
that whole thing with lambda@edge working only if deployed to us-east-1 is a complete piece of crap 😄 When I saw it first time months ago I hoped it was just some temp shortcut from AWS - but it's still there ... 😄
f
@Blake E Finally wrapped it up! v0.44.1 - u can deploy NextjsSite to any region now.
b
Thanks @Frank!