From 3518de48e73b54caa638ae727ea0517afe4a5023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Miguel=20Mej=C3=ADa=20Su=C3=A1rez?= Date: Thu, 25 Jul 2024 17:22:15 -0500 Subject: [PATCH] Fix Kinesis Stream EventBridge target --- .../aws-cdk-lib/aws-events-targets/lib/kinesis-stream.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/aws-cdk-lib/aws-events-targets/lib/kinesis-stream.ts b/packages/aws-cdk-lib/aws-events-targets/lib/kinesis-stream.ts index b0f33fbee5fc8..3859bf8a97e26 100644 --- a/packages/aws-cdk-lib/aws-events-targets/lib/kinesis-stream.ts +++ b/packages/aws-cdk-lib/aws-events-targets/lib/kinesis-stream.ts @@ -1,6 +1,5 @@ import { singletonEventRole } from './util'; import * as events from '../../aws-events'; -import * as iam from '../../aws-iam'; import * as kinesis from '../../aws-kinesis'; /** @@ -46,10 +45,7 @@ export class KinesisStream implements events.IRuleTarget { */ public bind(_rule: events.IRule, _id?: string): events.RuleTargetConfig { const role = singletonEventRole(this.stream); - role.addToPrincipalPolicy(new iam.PolicyStatement({ - actions: ['kinesis:PutRecord', 'kinesis:PutRecords'], - resources: [this.stream.streamArn], - })); + this.stream.grantWrite(role) return { arn: this.stream.streamArn,