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

feat(scheduler-targets-alpha): KinesisDataFirehosePutRecord Target #27842

Merged
merged 18 commits into from
Dec 5, 2023

Conversation

go-to-k
Copy link
Contributor

@go-to-k go-to-k commented Nov 5, 2023

This PR adds KinesisDataFirehosePutRecord as a target for an EventBridge scheduler.

Closes #27450.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team November 5, 2023 05:25
@github-actions github-actions bot added star-contributor [Pilot] contributed between 25-49 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Nov 5, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@go-to-k go-to-k marked this pull request as ready for review November 5, 2023 07:51
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 5, 2023 07:53

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@go-to-k go-to-k marked this pull request as draft November 5, 2023 09:20
@go-to-k go-to-k marked this pull request as ready for review November 5, 2023 13:18
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 5, 2023
Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍
Just some minor documentation adjustments needed.


## Put records to an Amazon Kinesis Data Firehose

Use the `KinesisDataFirehosePutRecord` target to put records to an Amazon Kinesis Data Firehose.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use the `KinesisDataFirehosePutRecord` target to put records to an Amazon Kinesis Data Firehose.
Use the `KinesisDataFirehosePutRecord` target to put a record to a Kinesis Data Firehose delivery stream.

Comment on lines 134 to 136
import * as kinesisfirehose from 'aws-cdk-lib/aws-kinesisfirehose';

declare const deliveryStream: kinesisfirehose.CfnDeliveryStream;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import * as kinesisfirehose from 'aws-cdk-lib/aws-kinesisfirehose';
declare const deliveryStream: kinesisfirehose.CfnDeliveryStream;
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
declare const deliveryStream: firehose.CfnDeliveryStream;


protected addTargetActionToRole(schedule: ISchedule, role: IRole): void {
if (!sameEnvDimension(this.deliveryStream.stack.region, schedule.env.region)) {
throw new Error(`Cannot assign firehose in region ${this.deliveryStream.stack.region} to the schedule ${Names.nodeUniqueId(schedule.node)} in region ${schedule.env.region}. Both the schedule and the firehose must be in the same region.`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new Error(`Cannot assign firehose in region ${this.deliveryStream.stack.region} to the schedule ${Names.nodeUniqueId(schedule.node)} in region ${schedule.env.region}. Both the schedule and the firehose must be in the same region.`);
throw new Error(`Cannot assign the Firehose delivery stream in region ${this.deliveryStream.stack.region} to the schedule ${Names.nodeUniqueId(schedule.node)} in region ${schedule.env.region}. Both the schedule and the Firehose delivery stream must be in the same region.`);

}

if (!sameEnvDimension(this.deliveryStream.stack.account, schedule.env.account)) {
throw new Error(`Cannot assign firehose in account ${this.deliveryStream.stack.account} to the schedule ${Names.nodeUniqueId(schedule.node)} in account ${schedule.env.region}. Both the schedule and the firehose must be in the same account.`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new Error(`Cannot assign firehose in account ${this.deliveryStream.stack.account} to the schedule ${Names.nodeUniqueId(schedule.node)} in account ${schedule.env.region}. Both the schedule and the firehose must be in the same account.`);
throw new Error(`Cannot assign the Firehose delivery stream in account ${this.deliveryStream.stack.account} to the schedule ${Names.nodeUniqueId(schedule.node)} in account ${schedule.env.region}. Both the schedule and the Firehose delivery stream must be in the same account.`);

@go-to-k
Copy link
Contributor Author

go-to-k commented Nov 8, 2023

@lpizzinidev

Thanks! Please check the changes.

Copy link
Contributor

@lpizzinidev lpizzinidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@aws-cdk-automation aws-cdk-automation added pr/needs-maintainer-review This PR needs a review from a Core Team Member and removed pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. labels Nov 8, 2023
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@vinayak-kukreja vinayak-kukreja self-assigned this Nov 30, 2023
@vinayak-kukreja vinayak-kukreja changed the title feat(scheduler-targets): KinesisDataFirehosePutRecord Target feat(scheduler-targets-alpha): KinesisDataFirehosePutRecord Target Nov 30, 2023
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Nov 30, 2023
Signed-off-by: Vinayak Kukreja <vinakuk@amazon.com>
Copy link
Contributor

@vinayak-kukreja vinayak-kukreja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @go-to-k, thank you for this contribution.

Copy link
Contributor

mergify bot commented Nov 30, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot dismissed vinayak-kukreja’s stale review December 1, 2023 03:17

Pull request has been modified.

@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 1, 2023

@vinayak-kukreja

Thanks for your approval! I fixed conflicts. Please approve again.

I fixed the other PR the same way, but when one of them gets merged, the other one gets conflicts again. If that happens, I will fix it again.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 1, 2023
@vinayak-kukreja
Copy link
Contributor

Hey @go-to-k , thank you for fixing the conflicts. The other PR is now merged. Please let me know once you have fixed conflicts for this PR.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@go-to-k
Copy link
Contributor Author

go-to-k commented Dec 5, 2023

@vinayak-kukreja

Thanks, I fixed new conflicts in this PR again, please look at this.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: f8d1f44
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Contributor

mergify bot commented Dec 5, 2023

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 46f3a00 into aws:main Dec 5, 2023
10 checks passed
chenjane-dev pushed a commit to chenjane-dev/aws-cdk that referenced this pull request Dec 5, 2023
…ws#27842)

This PR adds KinesisDataFirehosePutRecord as a target for an EventBridge scheduler.

Closes aws#27450.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/needs-maintainer-review This PR needs a review from a Core Team Member star-contributor [Pilot] contributed between 25-49 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-scheduler-targets-alpha): Add KinesisDataFirehosePutRecord Target
4 participants