From 2a0959cb70620e0bf37992ae4453562aa9fdb994 Mon Sep 17 00:00:00 2001 From: Matt Berry Date: Fri, 17 Sep 2021 18:01:01 +0000 Subject: [PATCH] fix(aws-events-targets): Consume IRestApi as target (#16423) 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* --- packages/@aws-cdk/aws-events-targets/lib/api-gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-events-targets/lib/api-gateway.ts b/packages/@aws-cdk/aws-events-targets/lib/api-gateway.ts index 168c5a65a386d..a827f29655902 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/api-gateway.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/api-gateway.ts @@ -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) { } /**