fix(events-targets): ApiGateway events target should accept IRestApi#29397
fix(events-targets): ApiGateway events target should accept IRestApi#29397mergify[bot] merged 2 commits intoaws:mainfrom
ApiGateway events target should accept IRestApi#29397Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
ApiGateway events target should accept IRestApi
0cef0c6 to
f8f83f4
Compare
f8f83f4 to
1d21c33
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
1d21c33 to
e34274f
Compare
e34274f to
7afac66
Compare
...ws-cdk-testing/framework-integ/test/aws-events-targets/test/api-gateway/integ.api-gateway.ts
Outdated
Show resolved
Hide resolved
...ws-cdk-testing/framework-integ/test/aws-events-targets/test/api-gateway/integ.api-gateway.ts
Outdated
Show resolved
Hide resolved
0194e06 to
c17243a
Compare
5981dde to
4b1544d
Compare
4b1544d to
ae2bd23
Compare
gracelu0
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Issue
Closes #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 was closed.
Changed the
ApiGatewaytarget's constructor's first argument fromapi.RestApitoapi.IRestApi.To fix compatibility failures caused by the previous
restApibeing a public member of the class, I've followed the approach suggested here. Some other alternatives are suggested here.Description of how you validated changes
Added a unit test that creates a dummy
SpecRestApi. Also added an integ test that creates aSpecRestApifrom 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 theListTargetsByRuleAPI.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license