Repository navigation
Commit 8e1fefd
authored
fix(events-targets):
### 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*ApiGateway events target should accept IRestApi (#29397)1 parent f00f918 commit 8e1fefd
14 files changed
Lines changed: 34180 additions & 5 deletions
File tree
- packages
- @aws-cdk-testing/framework-integ/test/aws-events-targets/test/api-gateway
- integ.api-gateway.js.snapshot
- asset.45f61bab328e8191a44031ca867c949870035c7adaf4c2418c1a451b2d0c1589.bundle
- aws-cdk-lib
- aws-apigateway
- lib
- test
- aws-events-targets
- lib
- test/api-gateway
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments