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

(iot): TopicRule action for Kinesis Data Streams in AWS IoT #17703

Closed
2 tasks
yamatatsu opened this issue Nov 25, 2021 · 3 comments · Fixed by #18321
Closed
2 tasks

(iot): TopicRule action for Kinesis Data Streams in AWS IoT #17703

yamatatsu opened this issue Nov 25, 2021 · 3 comments · Fixed by #18321
Labels
@aws-cdk/aws-iot Related to AWS IoT effort/small Small work item – less than a day of effort feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature-request A feature should be added or improved. p2

Comments

@yamatatsu
Copy link
Contributor

Description

The CDK has no support to put records to Kinesis Data Streams via AWS IoT Rule.

Use Case

Adding the action that puts records to Kinesis Data Streams to AWS IoT topic rule.

Proposed Solution

Implementing action class.

Probably, following PRs help coding.

Other information

Follofing documentation will be help.

It will be good first issue for learning implement feature in CDK!

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@yamatatsu yamatatsu added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 25, 2021
@github-actions github-actions bot added the @aws-cdk/aws-iot Related to AWS IoT label Nov 25, 2021
@peterwoodworth peterwoodworth added effort/small Small work item – less than a day of effort p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 26, 2021
@peterwoodworth peterwoodworth added the feature/service-integration Add functionality to an L2 construct to enable easier integration with another service label Nov 26, 2021
@grousseva
Copy link

Hi, does this mean that currently there is no way to records to Kinesis Data Streams via AWS IoT Rule?

@yamatatsu
Copy link
Contributor Author

@grousseva Yes, there is.
You can use escape-hatch as following:

const stream = new kinesis.Stream(this, 'MyStream');

const role = new iam.Role(this, 'MyRole', {
  assumedBy: new iam.ServicePrincipal('iot.amazonaws.com'),
});
role.addToPrincipalPolicy(new iam.PolicyStatement({
  actions: ['kinesis:PutRecord'],
  resources: [stream.streamArn],
}));

new iot.TopicRule(this, 'TopicRule', {
  sql: iot.IotSql.fromStringAsVer20151008("SELECT topic(2) as device_id FROM 'device/+/data'"),
  actions: [
    {
      bind: () => ({
        configuration: {
          kinesis: {
            streamName: stream.streamName,
            roleArn: role.roleArn,
          },
        },
      }),
    },
  ],
});

@mergify mergify bot closed this as completed in #18321 Jan 19, 2022
mergify bot pushed a commit that referenced this issue Jan 19, 2022
Fixes #17703

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Fixes aws#17703

----

*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 effort/small Small work item – less than a day of effort feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants