-
Notifications
You must be signed in to change notification settings - Fork 251
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
aws-cloudfront-apigateway-lambda can't be deployed elsewhere than in us-east-1 #93
Comments
And if it's a known limitation, it is not documented in https://docs.aws.amazon.com/solutions/latest/constructs/aws-cloudfront-apigateway-lambda.html?did=cs_card&trk=cs_card |
Thanks for opening the issue. This pattern, by default, deploys a Lambda@Edge function for injection of best practice HTTP security headers in all responses from CloudFront WebDistribution, which fails to deploy in any region other than While we come up with a fix for it, the workaround would be to disable the Lambda@Edge function deployment, we will update the documentation accordingly
|
We will look into the recently released Cloudfront Functions (replacing Lambda@Edge function) to insert the best practices HTTP security headers |
Implementing the CloudFront constructs with CloudFront Functions can be followed in this issue. |
PR 313 changed this construct from using Lambda@Edge functions to CloudFront Functions, so this issue has been addressed. |
configure your profile to deploy in eu-west-1
run cdk deploy
it fails with the following error
The function must be in region 'us-east-1'. ARN: arn:aws:lambda:eu-west-1:204847680503:function:LandingPageStack-testcloudfrontapigatewaylambdaClo-1F9QY441H38IK:1 (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidLambdaFunctionAssociation; Request ID: 42fefc2e-52b1-4db1-90ae-b3d26b2cadaa)
Reproduction Steps
try to deploy this
Error Log
4:56:08 PM | CREATE_FAILED | AWS::CloudFront::Distribution | testcloudfrontapig...stribution4AF2BFE4
The function must be in region 'us-east-1'. ARN: arn:aws:lambda:eu-west-1:204847680503:function:LandingPageStack-testcloudfrontapigatewaylambdaClo-1F9QY441H38IK:1 (Service: AmazonCloudFront; Status Code: 400; Error Code: InvalidLambdaFunctionAssociation; Request ID: 42fefc2e-52b1-4db1-90ae-b3d26b2cadaa)
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: