-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(apigatewayv2): cyclic dependency between HttpApi and the lambda f…
…unction (#9100) As part of Lambda proxy integration, a `AWS::Lambda::Permission` resource is created to provide the HTTP service permission to invoke the lambda function, creating the dependency, Permission → API. The API, on the other hand, needs to refer to the Function's ARN and hence creates the dependency, API → Function. However, when the lambda function and the HTTP API are placed in different stacks, this creates a cyclic dependency between these two stacks. A picture is worth a thousand words: ``` +--------------------------------------------------------------+ | Lambda stack | | | | +-------------------+ +-----------------+ | | | | via ARN | | | | | Lambda Permission +----------->| Lambda Function | | | | | | | | | +-------+-----------+ +-----------------+ | | | ^ | +------------|--------------------------------|----------------+ |via ARN |via ARN | | +------------|--------------------------------|-----------------+ | v | | | +-----------+ +----------+---------+ | | | | via ID | | | | | Http API |<--------------+ API Integration | | | | | | | | | +-----------+ +--------------------+ | | | | API Gateway stack | +---------------------------------------------------------------+ ``` The fix here is to move the Lambda Permission resource into the same stack as where the API integration is defined, thereby breaking the dependency cycle. Now the 'API Gateway stack' will depend one way on the 'Lambda stack'. fixes #9075 BREAKING CHANGE: The parameter for the method `bind()` on `IHttpRouteIntegration` has changed to accept one of type `HttpRouteIntegrationBindOptions`. The previous parameter `IHttpRoute` is now a property inside the new parameter under the key `route`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Niranjan Jayakar
authored and
Elad Ben-Israel
committed
Aug 10, 2020
1 parent
a7ead62
commit bc1a008
Showing
8 changed files
with
139 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters