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(iot): allow setting description and enabled of TopicRule #17225

Merged
merged 6 commits into from Nov 1, 2021

Conversation

yamatatsu
Copy link
Contributor

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

1. add properties `description` and `enabled`
2. add tests
@gitpod-io
Copy link

gitpod-io bot commented Oct 29, 2021

@github-actions github-actions bot added the @aws-cdk/aws-iot Related to AWS IoT label Oct 29, 2021
Copy link
Contributor

@skinny85 skinny85 left a 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),
Copy link
Contributor

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):

Suggested change
ruleDisabled: !(props.enabled ?? true),
ruleDisabled: props.enabled === undefined ? undefined : !props.enabled,

This way, there will be no changes in the existing templates.

@mergify mergify bot dismissed skinny85’s stale review October 30, 2021 01:29

Pull request has been modified.

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

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

👍

@mergify
Copy link
Contributor

mergify bot commented Nov 1, 2021

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 5530922
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@mergify mergify bot merged commit a9aae09 into aws:master Nov 1, 2021
@mergify
Copy link
Contributor

mergify bot commented Nov 1, 2021

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).

@yamatatsu yamatatsu deleted the aws-iot-description-and-enabled branch November 5, 2021 01:39
@@ -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:

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"

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…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*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-iot Related to AWS IoT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants