Class StreamConsumer
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.kinesis.StreamConsumer
- All Implemented Interfaces:
IEnvironmentAware,IResource,IStreamConsumer,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-20T23:37:23.835Z")
@Stability(Stable)
public class StreamConsumer
extends Resource
implements IStreamConsumer
A Kinesis Stream Consumer.
Example:
Role lambdaRole = Role.Builder.create(this, "Role")
.assumedBy(new ServicePrincipal("lambda.amazonaws.com"))
.description("Example role...")
.build();
Stream stream = Stream.Builder.create(this, "MyEncryptedStream")
.encryption(StreamEncryption.KMS)
.build();
StreamConsumer streamConsumer = StreamConsumer.Builder.create(this, "MyStreamConsumer")
.streamConsumerName("MyStreamConsumer")
.stream(stream)
.build();
// give lambda permissions to read stream via the stream consumer
streamConsumer.grantRead(lambdaRole);
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.kinesis.IStreamConsumer
IStreamConsumer.Jsii$Default, IStreamConsumer.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedStreamConsumer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedStreamConsumer(software.amazon.jsii.JsiiObjectRef objRef) StreamConsumer(software.constructs.Construct scope, String id, StreamConsumerProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddToResourcePolicy(PolicyStatement statement) Adds a statement to the IAM resource policy associated with this stream consumer.static IStreamConsumerfromStreamConsumerArn(software.constructs.Construct scope, String id, String streamConsumerArn) Imports an existing Kinesis Stream Consumer by its arn.static IStreamConsumerfromStreamConsumerAttributes(software.constructs.Construct scope, String id, StreamConsumerAttributes attrs) Imports an existing Kinesis Stream Consumer by its attributes.protected BooleanIndicates if a resource policy should automatically be created upon the first call toaddToResourcePolicy.The Kinesis data stream this consumer is associated with.The Amazon Resource Name (ARN) of the stream consumer.The name of the stream consumer.grant(IGrantable grantee, String... actions) Grant the indicated permissions on this stream consumer to the given IAM principal (Role/Group/User).grantRead(IGrantable grantee) Grant read permissions for this stream consumer and its associated stream to an IAM principal (Role/Group/User).Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
StreamConsumer
protected StreamConsumer(software.amazon.jsii.JsiiObjectRef objRef) -
StreamConsumer
protected StreamConsumer(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
StreamConsumer
@Stability(Stable) public StreamConsumer(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull StreamConsumerProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromStreamConsumerArn
@Stability(Stable) @NotNull public static IStreamConsumer fromStreamConsumerArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String streamConsumerArn) Imports an existing Kinesis Stream Consumer by its arn.- Parameters:
scope- the Construct scope. This parameter is required.id- the ID of the construct. This parameter is required.streamConsumerArn- the arn of the existing stream consumer. This parameter is required.
-
fromStreamConsumerAttributes
@Stability(Stable) @NotNull public static IStreamConsumer fromStreamConsumerAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull StreamConsumerAttributes attrs) Imports an existing Kinesis Stream Consumer by its attributes.- Parameters:
scope- the Construct scope. This parameter is required.id- the ID of the construct. This parameter is required.attrs- the attributes of the existing stream consumer. This parameter is required.
-
addToResourcePolicy
@Stability(Stable) @NotNull public AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement) Adds a statement to the IAM resource policy associated with this stream consumer.If this stream consumer was created in this stack (
new StreamConsumer), a resource policy will be automatically created upon the first call toaddToResourcePolicy. If the stream is imported (StreamConsumer.from), then this is a no-op.- Specified by:
addToResourcePolicyin interfaceIStreamConsumer- Parameters:
statement- This parameter is required.
-
grant
@Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions) Grant the indicated permissions on this stream consumer to the given IAM principal (Role/Group/User).- Specified by:
grantin interfaceIStreamConsumer- Parameters:
grantee- This parameter is required.actions- This parameter is required.
-
grantRead
Grant read permissions for this stream consumer and its associated stream to an IAM principal (Role/Group/User).- Specified by:
grantReadin interfaceIStreamConsumer- Parameters:
grantee- This parameter is required.
-
getAutoCreatePolicy
Indicates if a resource policy should automatically be created upon the first call toaddToResourcePolicy.Set by subclasses.
-
getStream
The Kinesis data stream this consumer is associated with.- Specified by:
getStreamin interfaceIStreamConsumer
-
getStreamConsumerArn
The Amazon Resource Name (ARN) of the stream consumer.- Specified by:
getStreamConsumerArnin interfaceIStreamConsumer
-
getStreamConsumerName
The name of the stream consumer.- Specified by:
getStreamConsumerNamein interfaceIStreamConsumer
-