-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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(iot): add the TopicRule L2 construct #16681
Conversation
2c58467
to
49a0bb2
Compare
This comment has been minimized.
This comment has been minimized.
924c117
to
ebfd5f2
Compare
1. add The TopicRule L2 construct 2. add unit tests 3. add integration test 4. update package.json
@skinny85 |
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.
This looks like a great contribution @yamatatsu! It needs some work, but it's a great start.
Can I have one suggestion? Right now, the PR is gigantic. The chance of quickly merging a PR with 51 files changed and 5,000 lines of code added are very, very slim.
What do you think about splitting it up? Perhaps something like:
- Just
TopicRule
, and minimal properties to get it deployed (with unit and integration tests). - Remaining properties of the
TopicRule
. - New
@aws-cdk/aws-iot-actions
package (see my comments), with like 1 or 2IAction
implementations? - (and higher) Separate PRs for new
@aws-cdk/aws-iot-actions
implementations - depending on the size, maybe one to a few in each PR?
Let me know what you think!
Thanks,
Adam
packages/@aws-cdk/aws-iot/test/actions/cloudwatch-alarm/cloudwatch-alarm-action.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Pull request has been modified.
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
@skinny85 I think too that it is better to split PRs and packages. But I could not image steps to complete these implementations. Your steps is sounds good and I will do it!
|
@skinny85 |
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.
Thanks so much for shrinking the PR @yamatatsu! Now it's very easy to review 🙂.
The general direction is great. I have some comments on the details, but I think we're off to a great start here - awesome work!
* | ||
* @see https://docs.aws.amazon.com/iot/latest/developerguide/iot-sql-reference.html | ||
*/ | ||
readonly sql: string; |
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.
Let's model this a little bit differently.
I have a feeling we might want to add a nice API around constructing the SQL string too. Let's "future proof" this a little bit.
I know you had an enum here before that allowed you to choose the version used. Let's combine the version with this concept to make it what CDK calls a union-like class.
So, we'll have:
export interface TopicRuleProps {
// ...
readonly sql: IotSql;
}
export abstract class IotSql {
public static ver_2015_10_08_fromString(sql: string): IotSql { ... }
// ...
public abstract bind(scope: Construct): IotSqlConfig;
}
Take a look at how these are implemented in the AppMesh library, which uses this pattern often; here's a good example.
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.
OK. I will implement as lambda.Code
and appmesh.HttpRoutePathMatch
.
But I'd like to understand more clearly.
I wonder why this implementation is "future proof"?
Is it because the user's code will explicit the SQL version?
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.
I meant "future proof" because you removed the the SQL version enum in this iteration of the PR (which was the correct thing to do, BTW), and I'm kind of bringing it back with this vision for the IotSql
class.
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Pull request has been modified.
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
Co-authored-by: Adam Ruka <adamruka85@gmail.com>
I'm trying to implement aws-iot L2 Constructs. This PR is the next step of #16681 refar: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is the next step of #16681 refar: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…7225) I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - #16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is the next step of #16681 refar: - aws/aws-cdk#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I tried to implement aws-iot L2 Constructs. I did following: 1. add L2 construct 1. add unit tests 1. add integration test 1. test with deploying to my AWS account and sending MQTT. 1. update package.json resolves: aws#16602 I should do following for undrafting: - [x] write comments - [x] implement other actions Following is not implemented yet, but I will implements other PR. - Elasticsearch - Kinesis Firehose - Kinesis Stream - http - IoT Analytics - IoT Events - IoT SiteWise - kafka - Step Functions - [x] write README ---- ## Design ### TopicRule and IAction ![image](https://user-images.githubusercontent.com/11013683/136200920-9aa1aa58-2e9f-4a0d-a161-bbe251d02f7d.png) ### Implements of IAction ![image](https://user-images.githubusercontent.com/11013683/136201053-4f693683-3318-4fbf-9a7e-cd3f8ac1a93e.png) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is the next step of aws#16681 refar: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is the next step of aws#16681 refar: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…s#17225) I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I'm trying to implement aws-iot L2 Constructs. This PR is one of steps after following PR: - aws#16681 (comment) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
I tried to implement aws-iot L2 Constructs.
I did following:
resolves: #16602
I should do following for undrafting:
Following is not implemented yet, but I will implements other PR.
Design
TopicRule and IAction
Implements of IAction
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license