-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { IDeliveryStream } from '@aws-cdk/aws-kinesisfirehose-alpha'; | ||
import { IScheduleTarget } from '@aws-cdk/aws-scheduler-alpha'; | ||
import { IRole, PolicyStatement } from 'aws-cdk-lib/aws-iam'; | ||
import { CfnDeliveryStream } from 'aws-cdk-lib/aws-kinesisfirehose'; | ||
import { ScheduleTargetBase, ScheduleTargetBaseProps } from './target'; | ||
|
||
/** | ||
* Use an Amazon Kinesis Data Firehose as a target for AWS EventBridge Scheduler. | ||
*/ | ||
export class KinesisDataFirehosePutRecord extends ScheduleTargetBase implements IScheduleTarget { | ||
constructor( | ||
private readonly deliveryStream: CfnDeliveryStream, | ||
private readonly deliveryStream: IDeliveryStream, | ||
props: ScheduleTargetBaseProps = {}, | ||
) { | ||
super(props, deliveryStream.attrArn); | ||
super(props, deliveryStream.deliveryStreamArn); | ||
} | ||
|
||
protected addTargetActionToRole(role: IRole): void { | ||
|
||
role.addToPrincipalPolicy(new PolicyStatement({ | ||
actions: ['firehose:PutRecord'], | ||
resources: [this.deliveryStream.attrArn], | ||
resources: [this.deliveryStream.deliveryStreamArn], | ||
})); | ||
} | ||
} |