Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(events-targets):
ApiGateway
events target should accept IRestApi (
#29397) ### Issue Closes [#16423](#16423). ### Reason for this change The CDK construct to set an APIGatway as the target for an EventBridge rule only accepted RestApi. It should instead accept the interface IRestApi. ### Description of changes This change was attempted once earlier, but [the PR](#16542) was closed. Changed the `ApiGateway` target's constructor's first argument from `api.RestApi` to `api.IRestApi`. To fix compatibility failures caused by the previous `restApi` being a public member of the class, I've followed the approach suggested [here](#16542 (comment)). Some other alternatives are suggested [here](#16542 (comment)). ### Description of how you validated changes Added a unit test that creates a dummy `SpecRestApi`. Also added an integ test that creates a `SpecRestApi` from a dummy OpenAPI spec and creates a rule on the default event bus with the APIGateway as target. Nothing is executed in the integ test. The assertion only checks if the target is created using the `ListTargetsByRule` API. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information