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(kinesis): support stream consumers #32087

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a004785
feat(kinesis): support stream consumers
humanzz Nov 10, 2024
f04a688
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 11, 2024
4185ff9
update README
humanzz Nov 11, 2024
af07f89
Merge branch 'kinesis-stream-consumer' of https://github.com/humanzz/…
humanzz Nov 11, 2024
07aaa24
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 13, 2024
46f08ec
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 14, 2024
8f520cd
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 17, 2024
6878126
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 20, 2024
6e2e571
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 22, 2024
3e72f85
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 23, 2024
54bf771
add KinesisConsumerEventSource
humanzz Nov 25, 2024
66e3ab5
Merge branch 'kinesis-stream-consumer' of https://github.com/humanzz/…
humanzz Nov 25, 2024
5521931
update README
humanzz Nov 25, 2024
1f7e00d
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 25, 2024
b49c772
restore readonly in event source constructor
humanzz Nov 25, 2024
3af8d07
update awslint rules
humanzz Nov 25, 2024
ffe51fe
Merge branch 'main' into kinesis-stream-consumer
humanzz Nov 26, 2024
f1f7ef6
Merge branch 'main' into kinesis-stream-consumer
humanzz Dec 2, 2024
ddca03b
Merge branch 'main' into kinesis-stream-consumer
humanzz Dec 18, 2024
e96a945
Merge branch 'main' into kinesis-stream-consumer
humanzz Dec 28, 2024
4a998cc
Merge branch 'main' into kinesis-stream-consumer
humanzz Dec 28, 2024
87d17e5
Merge branch 'main' into kinesis-stream-consumer
humanzz Jan 8, 2025
64b60a2
Merge branch 'main' into kinesis-stream-consumer
humanzz Jan 9, 2025
2ee960a
Merge branch 'main' into kinesis-stream-consumer
humanzz Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,65 @@
"Version": "2012-10-17"
}
}
},
"StreamConsumer58240CBA": {
"Type": "AWS::Kinesis::StreamConsumer",
"Properties": {
"ConsumerName": "stream-consumer",
"StreamARN": {
"Fn::GetAtt": [
"MyStream5C050E93",
"Arn"
]
}
}
},
"StreamConsumerPolicy925BAE36": {
"Type": "AWS::Kinesis::ResourcePolicy",
"Properties": {
"ResourceArn": {
"Fn::GetAtt": [
"StreamConsumer58240CBA",
"ConsumerARN"
]
},
"ResourcePolicy": {
"Statement": [
{
"Action": [
"kinesis:DescribeStreamConsumer",
"kinesis:SubscribeToShard"
],
"Effect": "Allow",
"Principal": {
"AWS": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
{
"Ref": "AWS::AccountId"
},
":root"
]
]
}
},
"Resource": {
"Fn::GetAtt": [
"StreamConsumer58240CBA",
"ConsumerARN"
]
}
}
],
"Version": "2012-10-17"
}
}
}
},
"Conditions": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { App, Stack } from 'aws-cdk-lib';
import { Stream } from 'aws-cdk-lib/aws-kinesis';
import { Stream, StreamConsumer } from 'aws-cdk-lib/aws-kinesis';
import { AccountPrincipal, PolicyStatement } from 'aws-cdk-lib/aws-iam';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

Expand All @@ -8,6 +8,11 @@ const stack = new Stack(app, 'kinesis-resource-policy');

const stream = new Stream(stack, 'MyStream');

const streamConsumer = new StreamConsumer(stack, 'StreamConsumer', {
streamConsumerName: 'stream-consumer',
stream: stream,
});

stream.addToResourcePolicy(new PolicyStatement({
resources: [stream.streamArn],
actions: [
Expand All @@ -17,6 +22,15 @@ stream.addToResourcePolicy(new PolicyStatement({
principals: [new AccountPrincipal(stack.account)],
}));

streamConsumer.addToResourcePolicy(new PolicyStatement({
resources: [streamConsumer.streamConsumerArn],
actions: [
'kinesis:DescribeStreamConsumer',
'kinesis:SubscribeToShard',
],
principals: [new AccountPrincipal(stack.account)],
}));

new IntegTest(app, 'integ-kinesis-resource-policy', {
testCases: [stack],
stackUpdateWorkflow: false,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading