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.
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-actionspackage (see my comments), with like 1 or 2IActionimplementations? - (and higher) Separate PRs for new
@aws-cdk/aws-iot-actionsimplementations - 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 |
skinny85
left a comment
There was a problem hiding this comment.
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.
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.
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.
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>
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@skinny85 I appreciate your help. arigato gozaimashita !! |
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 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