Skip to content
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

CDK: The function must be in region 'us-east-1' #2179

Open
3 tasks done
andreialecu opened this issue Dec 5, 2021 · 3 comments
Open
3 tasks done

CDK: The function must be in region 'us-east-1' #2179

andreialecu opened this issue Dec 5, 2021 · 3 comments

Comments

@andreialecu
Copy link

Issue Summary

I've been recently testing this library and our stacks are in eu-west-1. Seems that deployment fails with:

15:00:45 | CREATE_IN_PROGRESS   | AWS::CloudFormation::Stack                      | TestStack
15:02:57 | CREATE_FAILED        | AWS::CloudFront::Distribution                   | NextJsApp/NextJSDistribution
Resource handler returned message: "Invalid request provided: The function must be in region 'us-east-1'. ARN: arn:aws:lambda:eu-central-1:...

Actual behavior

CDK deployment fails.

Expected behavior

CDK deployment should succeed

Steps to reproduce

Create a CDK stack that's not in the us-east-1 region.

Versions

  • @sls-next/serverless-component version: 3.7.0-alpha.0

Checklist

  • You have reviewed the README and FAQs, which answers several common questions.
  • You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible. As there is only one maintainer (who maintains this in his free time) and thus very limited resources, if you have time, please try to debug the issue a bit yourself if possible.
  • You have first tried using the most recent latest or alpha @sls-next/serverless-component release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.
@andreialecu
Copy link
Author

Related: #951

@shishkin
Copy link

This probably would require a nested CDK stack created in us-east-1 for the functions, while the rest of the construct can remain in the region defined by the containing user stack. It seems that only stacks can define a region.

@kiernan
Copy link

kiernan commented Jan 21, 2022

There now appears to be an experimental construct in CDK which can create the lambda@edge functions in us-east-1 despite the stack being deployed to a different region: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants