-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(apigateway): cross-stack lambda integration causes a cyclic reference #4010
Conversation
Thanks so much for taking the time to contribute to the AWS CDK ❤️ We will shortly assign someone to review this pull request and help get it
|
Continuous integration build failed |
Make a couple of tweaks (with "@default" if there is concrete default value, we just use "-") and the title of a "fix" PR should describe the bug, not the fix. The changelog will show "fixes" and then a list of bugs that were fixed. |
1dc0da8
to
3fc43e3
Compare
…n and/or creates cyclic references 1. Token resolution of Deployment construct must not resolve the entire stack, specifically during the prepare phase. stack.resolve() works only after the CDK app has been fully prepared. During the 'prepare' phase, token resolution should instead resolve the token partially and within the local context. 2. Scope the lambda.CfnPermission construct closer to the consumer of the permission rather than being closer to the lambda function. For instance, when a lambda function is being consumed by an APIGateway RestApi Method as a cross-stack reference, placing the lambda.CfnPermission construct closer to the RestApi Method reduces the possibility of cyclic dependencies. fixes #3705, #3000
70eaa73
to
a116edb
Compare
Can someone please share the release version carrying this fix? We are still seeing this issue when using v 1.10.0 |
It was released in 1.9.0. You can usually find this information in our CHANGELOG.md. Make sure your application is using CDK packages >=1.9.0 and not just a later CLI version (for typescript, by checking If you think this is still occurring, feel free to open a new issue with repro steps. |
Has this been resolved for python? We're seeing similar cyclic problems with API Gateway and Lambda being separated into two stacks and passing the reference of the API gateway into the Lambda stack. |
Token resolution of Deployment construct must not resolve the entire
stack, specifically during the prepare phase.
stack.resolve() works only after the CDK app has been fully prepared.
During the 'prepare' phase, token resolution should instead resolve
the token partially and within the local context.
Scope the lambda.CfnPermission construct closer to the consumer of
the permission rather than being closer to the lambda function.
For instance, when a lambda function is being consumed by an
APIGateway RestApi Method as a cross-stack reference, placing the
lambda.CfnPermission construct closer to the RestApi Method reduces
the possibility of cyclic dependencies.
fixes #3705, #3000
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license