-
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): allow setting description
and enabled
of TopicRule
#17225
Conversation
1. add properties `description` and `enabled` 2. add tests
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.
Looks great @yamatatsu! One small comment that will make your life easier I'm pretty sure 🙂.
@@ -102,6 +116,8 @@ export class TopicRule extends Resource implements ITopicRule { | |||
topicRulePayload: { | |||
actions: Lazy.any({ produce: () => this.actions }), | |||
awsIotSqlVersion: sqlConfig.awsIotSqlVersion, | |||
description: props.description, | |||
ruleDisabled: !(props.enabled ?? true), |
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 leave this as undefined
if enabled
is undefined
(I assume the default in CloudFormation is false
for the RuleDisabled
property):
ruleDisabled: !(props.enabled ?? true), | |
ruleDisabled: props.enabled === undefined ? undefined : !props.enabled, |
This way, there will be no changes in the existing templates.
Pull request has been modified.
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.
👍
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). |
@@ -72,3 +74,12 @@ const topicRule = new iot.TopicRule(this, 'TopicRule', { | |||
}); | |||
topicRule.addAction(new actions.LambdaFunctionAction(func)) | |||
``` | |||
|
|||
If you wanna make the topic rule disable, add property `enabled: false` as following: |
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.
"If you wanna make the topic rule disable" -> "If you want to make the topic rule disasbled"
…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:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license