-
Notifications
You must be signed in to change notification settings - Fork 249
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
Added two new construct patterns: aws-events-rule-kinesisstream and aws-events-rule-kinesisfirehose-s3 #92
Conversation
…inesisstream-no-arguments.ts
…dated aws-events-rule-kinesisstream
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, few minor comments, the main one is missing recommended CW Alarms for Kinesisstream pattern, check any other aws-kinesisstreams-*
pattern for reference.
Here is a minimal deployable pattern definition in Typescript: | ||
|
||
``` javascript | ||
const { EventsRuleToKinesisFirehoseToS3, EventsRuleToKinesisFirehoseToS3Props } from '@aws-solutions-constructs/aws-events-rule-kinesisfirehose-s3'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change const
to import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
const props: EventsRuleToKinesisFirehoseToS3Props = { | ||
eventRuleProps: { | ||
description: 'event rule props', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is description necessary ? It might be nice to have, but this example is for a minimal deployable pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed description
|eventsRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-iam.Role.html)|Returns an instance of the iam.Role created by the construct for Events Rule| | ||
|kinesisFirehoseRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-iam.Role.html)|Returns an instance of the iam.Role created by the construct for Kinesis Data Firehose delivery stream| | ||
|kinesisFirehoseLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for Kinesis Data Firehose delivery stream| | ||
|firehoseToS3|[`aws_solutions_constructs.aws-kinesisfirehose-s3`](https://docs.aws.amazon.com/solutions/latest/constructs/aws-kinesisfirehose-s3.html)|Returns an instance of aws-kinesisfirehose-s3 construct created by the construct| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we should expose the underlying solutions construct, as long all the resulting CDK objects are available as properties, IMO this exposes the unnecessary complexity to the user, especially the whole point of these patterns is to abstract away these complexities from the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I exposed firehoseToS3 instance as a property of the construct is because that I want to make it easier to access properties of firehoseToS3 that aren’t exposed in the firehoseToS3 construct without having to changing the firehoseToS3 construct itself. Since firehoseToS3 is the base construct rather than the top construct, it won’t affect user experience. But I got your point and updated the code per request.
public readonly kinesisFirehoseRole: iam.Role; | ||
public readonly s3Bucket?: s3.Bucket; | ||
public readonly s3LoggingBucket?: s3.Bucket; | ||
public readonly firehoseToS3: KinesisFirehoseToS3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the comment above. Recommend removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}) | ||
}; | ||
|
||
// Add the kinese event source mapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the comment, probably "Set up the events rule props"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}, | ||
"dotnet": { | ||
"namespace": "Amazon.Constructs.AWS.eventsrulekinesisstream", | ||
"packageId": "Amazon.Constructs.AWS.eventsrulekinesisstream", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pascal case EventsRuleKinesisStream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
"iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png" | ||
}, | ||
"python": { | ||
"distName": "aws-solutions-constructs.aws-events-rule-kinesisstream", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use kinesis-stream
instead of kinesisstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
}, | ||
"python": { | ||
"distName": "aws-solutions-constructs.aws-events-rule-kinesisstream", | ||
"module": "aws_solutions_constructs.aws_events_rule_kinesisstream" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use kinesis_stream
instead of kinesisstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
}; | ||
|
||
const constructStack = new EventsRuleToKinesisStream(this, 'test-events-rule-kinesis-stream', props); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove const constructStack =
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
new EventsRuleToKinesisStream(stack, 'test-events-rule-kinesis-stream', props); | ||
|
||
app.synth(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend adding an integ test for existing stream i.e. existingStreamObj
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Addressed all the items that were raised in the code review and pushed the new code changes. Please take a look at the new changes. Thanks! |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor updates requested and a name change for the kinsesisstream pattern, hope that's not an issue.
const props: EventsRuleToKinesisFirehoseToS3Props = { | ||
eventRuleProps: { | ||
schedule: events.Schedule.rate(cdk.Duration.minutes(5)) | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing closing bracket }
const props: EventsRuleToKinesisFirehoseToS3Props = {
eventRuleProps: {
schedule: events.Schedule.rate(cdk.Duration.minutes(5))
}
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
``` javascript | ||
import { EventsRuleToKinesisFirehoseToS3, EventsRuleToKinesisFirehoseToS3Props } from '@aws-solutions-constructs/aws-events-rule-kinesisfirehose-s3'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import statement for cdk.Duration
, please add import * as cdk from '@aws-cdk/core';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
``` javascript | ||
import { EventsRuleToKinesisFirehoseToS3, EventsRuleToKinesisFirehoseToS3Props } from '@aws-solutions-constructs/aws-events-rule-kinesisfirehose-s3'; | ||
|
||
const props: EventsRuleToKinesisFirehoseToS3Props = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this code is copied into the cdk init
app the props
variable collides with the existing one, please change the props
variable name to eventsRuleToKinesisFirehoseToS3Props
here and on line 37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
``` typescript | ||
import {EventsRuleToKinesisStream, EventsRuleToKinesisStreamProps} from "@aws-solutions-constructs/aws-events-rule-kinesisstream"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import statement for cdk.Duration
, please add import * as cdk from '@aws-cdk/core';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
``` typescript | ||
import {EventsRuleToKinesisStream, EventsRuleToKinesisStreamProps} from "@aws-solutions-constructs/aws-events-rule-kinesisstream"; | ||
|
||
const props: EventsRuleToKinesisStreamProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this code is copied into the cdk init
app the props
variable collides with the existing one, please change the props variable name to eventsRulesKinesisstreamProps
here and on line 37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -0,0 +1,83 @@ | |||
{ | |||
"name": "@aws-solutions-constructs/aws-events-rule-kinesisstream", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest name change of the pattern from aws-events-rule-kinesisstream
to aws-events-rule-kinesisstreams
to be consistent with other aws-kinesisstreams-*
patterns in the library, it will entain changing the directory names as well, sorry should have caught it the first time..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…nts-rule-kinesisstream to aws-events-rule-kinesisstreams
Pushed code changes per PR feedback. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
… and integration template
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thanks for the contribution, these will be published in the next release |
Issue #, if available:
#59: aws-events-rule-kinesisstream
#72: aws-events-rule-kinesisfirehose-s3
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.