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

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

Closed
nicokruger opened this issue Feb 27, 2020 · 3 comments
Closed

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

nicokruger opened this issue Feb 27, 2020 · 3 comments

Comments

@nicokruger
Copy link

Just want to say thanks a lot for this, it looks really promising. Really not looking forward to wiring all this AWS crap myself :-)

However, our stack is in eu-west-1, any ideas how I can get the lambda@edge function in your project to deploy? I get the following error:

The function must be in region 'us-east-1'. ARN: arn:aws:lambda:eu-west-1:xx:1 (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidLambdaFunctionAssociation; Request ID: xxx)

@spencerbeggs
Copy link
Owner

spencerbeggs commented Feb 27, 2020

Hi, @nicokruger, I appreciate the enthusiasm. So, yeah, Lambda@Edge versions must be in the us-east-1 region. I am unclear if versions and functions can be in different regions. Let me try to spin up a stack in another region and see what I can see.

@nicokruger
Copy link
Author

nicokruger commented Feb 27, 2020

@spencerbeggs I got it to work for now by just splitting the redirect into a completely different stack. Would be interesting if there is a way to have it in our "main" CDK stack, but for now I'm good.

Just want to let you know, great job! It worked first time in us-east-1 and saved me tons of time.

Thanks!

@spencerbeggs
Copy link
Owner

@nicokruger I did a little investigation and it seems that CloudFormation itself does not allow you to create a stack in one region and a Lambda function in another. So, I think what I will do is cause this examine the stack context this construct is created in and throw an error if it is not us-east-1 with an error message. I will also make a note in the documentation.

Thank you for brining this to my attention.

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

2 participants