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

kinesis: model AWS::Kinesis::StreamConsumer (L2 construct) #32050

Open
1 of 2 tasks
humanzz opened this issue Nov 7, 2024 · 3 comments · May be fixed by #32087
Open
1 of 2 tasks

kinesis: model AWS::Kinesis::StreamConsumer (L2 construct) #32050

humanzz opened this issue Nov 7, 2024 · 3 comments · May be fixed by #32087
Labels
@aws-cdk/aws-kinesis Related to Amazon Kinesis effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2

Comments

@humanzz
Copy link
Contributor

humanzz commented Nov 7, 2024

Describe the feature

AWS::Kinesis::StreamConsumer is not covered by an L2 construct.

StreamConsumer enables enhanced fan out.

Having been waiting for cloudformation to model kinesis resource policies, to leverage that for a cross-account lambda consumer, I saw that in 2.166.0 release, that the cfn resource has been introduced, and covered by an L2 construct, and utility methods in stream but realized that StreamConsumer is unmodeled in cdk.

This is a request for AWS::Kinesis::StreamConsumer to be covered by an L2 construct, including resource policy utility methods

Use Case

Cross-account lambda kinesis conumer with enhanced fan out

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.166.0

Environment details (OS name and version, etc.)

macOS

@humanzz humanzz added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2024
@github-actions github-actions bot added the @aws-cdk/aws-kinesis Related to Amazon Kinesis label Nov 7, 2024
@ashishdhingra ashishdhingra self-assigned this Nov 7, 2024
@ashishdhingra ashishdhingra added p2 investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 7, 2024
@ashishdhingra
Copy link
Contributor

CDK Lib already has L1 construct CfnStreamConsumer. Perhaps something that could be supported at Stream L2 construct level, like exposing a method named registerConsumer().

@ashishdhingra ashishdhingra added effort/small Small work item – less than a day of effort and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Nov 7, 2024
@ashishdhingra ashishdhingra removed their assignment Nov 7, 2024
@humanzz
Copy link
Contributor Author

humanzz commented Nov 7, 2024

I think a couple of things to consider

  • Adding an L2 construct for consumer
  • As part of that, supporting adding a resource policy, similar to the merged PR for resource policy on streams, on the new L2 construct
  • consider ur suggested utility method on stream

Thing is, given how simple the StreamConsumer construct would be, am not sure that an RFC is required.
@ashishdhingra If I get time to make a PR, will I be faced with saying an RFC is required?

@humanzz
Copy link
Contributor Author

humanzz commented Nov 10, 2024

Just an update, I'm working on a PR for this

humanzz added a commit to humanzz/aws-cdk that referenced this issue Nov 11, 2024
- introduce `StreamConsumer` construct to model `AWS::Kinesis::StreamConsumer`
  - introduce `addToResourcePolicy` to enable creating/configuring a resource policy for the consumer
  - introduce `grant` and `grantRead` for granting permissions
  - leverage `iam.Grant.addToPrincipalOrResource` in `grant` to be able to use `grant` methods cross environments to update the grantee's iam policy and the consumer's resource policy as needed
- update `ResourcePolicy` to support both `Stream` and `StreamConsumer`
- update `Stream`'s `grant` to leverage `iam.Grant.addToPrincipalOrResource` for cross-environment support

closes aws#32050
@humanzz humanzz linked a pull request Nov 11, 2024 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-kinesis Related to Amazon Kinesis effort/small Small work item – less than a day of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants