Skip to content

Commit

Permalink
fix(aws-events-targets): Consume IRestApi as target (aws#16423)
Browse files Browse the repository at this point in the history
Fixes: aws#16423

When creating an Event Bridge target for an API Gateway, the
superinterface IRestApi should be consumed instead of the
concrete class RestApi.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Matt Berry committed Sep 18, 2021
1 parent efe5112 commit 2a0959c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-events-targets/lib/api-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface ApiGatewayProps extends TargetBaseProps {
*/
export class ApiGateway implements events.IRuleTarget {

constructor(public readonly restApi: api.RestApi, private readonly props?: ApiGatewayProps) {
constructor(public readonly restApi: api.IRestApi, private readonly props?: ApiGatewayProps) {
}

/**
Expand Down

0 comments on commit 2a0959c

Please sign in to comment.