Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scheduler-targets-alpha): kinesis data firehose target uses l1 instead of l2 #32150

Merged
merged 4 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-scheduler-targets-alpha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ The code snippet below creates an event rule with a delivery stream as a target
called every hour by EventBridge Scheduler with a custom payload.

```ts
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
declare const deliveryStream: firehose.CfnDeliveryStream;
import * as firehose from '@aws-cdk/aws-kinesisfirehose-alpha';
declare const deliveryStream: firehose.IDeliveryStream;

const payload = {
Data: "record",
Expand Down
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],
}));
}
}
10 changes: 6 additions & 4 deletions packages/@aws-cdk/aws-scheduler-targets-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,19 +82,21 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0",
"@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0",
"@aws-cdk/aws-scheduler-alpha": "0.0.0",
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^29.5.14",
"aws-cdk-lib": "0.0.0",
"@aws-cdk/aws-scheduler-alpha": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
"constructs": "^10.0.0"
},
"dependencies": {},
"peerDependencies": {
"aws-cdk-lib": "^0.0.0",
"@aws-cdk/aws-scheduler-alpha": "0.0.0",
"aws-cdk-lib": "^0.0.0",
"constructs": "^10.0.0"
},
"engines": {
Expand Down
Loading
Loading