-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(events-targets): ApiGateway
events target should accept IRestApi
#29397
fix(events-targets): ApiGateway
events target should accept IRestApi
#29397
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Moving to maintainer review. I'd like @rix0rrr to review this since he had feedback on the previous PR.
5981dde
to
4b1544d
Compare
4b1544d
to
ae2bd23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
ApiGateway
target's constructor's first argument fromapi.RestApi
toapi.IRestApi
.To fix compatibility failures caused by the previous
restApi
being 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 aSpecRestApi
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 theListTargetsByRule
API.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license