Description
Describe the feature
Work to support L2 constructs for AWS Scheduler is in progress (#23394). See the approved RFC. RFC planned to add 12 templates targets, but only Lambda Invoke is currently implemented (#26575).
This issue tracks implementation of KinesisDataFirehosePutRecord
target to put a record to a Kinesis Firehose.
Use Case
Customers would like to use templated target KinesisDataFirehosePutRecord
to be able to put a record to a Kinesis Firehose on schedule. L2 target construct should grant required permissions to the AWS Scheduler
to put records to a Kinesis Firehose.
Proposed Solution
The proposed solution needs to be adopted to the recent examples of LambdaInvoke
(https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/aws-scheduler-targets-alpha/lib/lambda-invoke.ts).
Solution should also include unit and integration tests.
export class KinesisDataFirehosePutRecord extends ScheduleTargetBase implements IScheduleTarget {
constructor(
private readonly deliveryStream: firehose.CfnDeliveryStream,
private readonly props: ScheduleTargetBaseProps,
) {
super(props, deliveryStream);
}
protected addTargetActionToRole(schedule: ISchedule, role: IRole): void {
// TODO: Check if target and schedule are in the same account and region
// TODO: Check if target and role are in the same account
// TODO: Check if L2 grant methods can be used
role.addToPrincipalPolicy(new iam.PolicyStatement({
actions: ['firehose:PutRecord'],
resources: [this.deliverySream.attrArn],
}));
}
}
Other Information
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
CDK version used
2.99.1
Environment details (OS name and version, etc.)
MacOs
Activity