StreamConsumer
- class aws_cdk.aws_kinesis.StreamConsumer(scope, id, *, stream, stream_consumer_name)
- Bases: - Resource- A Kinesis Stream Consumer. - ExampleMetadata:
- infused 
 - Example: - lambda_role = iam.Role(self, "Role", assumed_by=iam.ServicePrincipal("lambda.amazonaws.com"), description="Example role..." ) stream = kinesis.Stream(self, "MyEncryptedStream", encryption=kinesis.StreamEncryption.KMS ) stream_consumer = kinesis.StreamConsumer(self, "MyStreamConsumer", stream_consumer_name="MyStreamConsumer", stream=stream ) # give lambda permissions to read stream via the stream consumer stream_consumer.grant_read(lambda_role) - Parameters:
 - Methods - add_to_resource_policy(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 to- addToResourcePolicy. If the stream is imported (- StreamConsumer.from), then this is a no-op.- Parameters:
- statement ( - PolicyStatement)
- Return type:
 
 - apply_removal_policy(policy)
- Apply the given removal policy to this resource. - The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced. - The resource can be deleted ( - RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (- RemovalPolicy.RETAIN).- Parameters:
- policy ( - RemovalPolicy)
- Return type:
- None
 
 - grant(grantee, *actions)
- Grant the indicated permissions on this stream consumer to the given IAM principal (Role/Group/User). - Parameters:
- grantee ( - IGrantable)
- actions ( - str)
 
- Return type:
 
 - grant_read(grantee)
- Grant read permissions for this stream consumer and its associated stream to an IAM principal (Role/Group/User). - Parameters:
- grantee ( - IGrantable)
- Return type:
 
 - to_string()
- Returns a string representation of this construct. - Return type:
- str
 
 - Attributes - PROPERTY_INJECTION_ID = 'aws-cdk-lib.aws-kinesis.StreamConsumer'
 - env
- The environment this resource belongs to. - For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into. 
 - node
- The tree node. 
 - stack
- The stack in which this resource is defined. 
 - stream
- The Kinesis data stream this consumer is associated with. 
 - stream_consumer_arn
- The Amazon Resource Name (ARN) of the stream consumer. 
 - stream_consumer_name
- The name of the stream consumer. 
 - Static Methods - classmethod from_stream_consumer_arn(scope, id, stream_consumer_arn)
- Imports an existing Kinesis Stream Consumer by its arn. - Parameters:
- scope ( - Construct) – the Construct scope.
- id ( - str) – the ID of the construct.
- stream_consumer_arn ( - str) – the arn of the existing stream consumer.
 
- Return type:
 
 - classmethod from_stream_consumer_attributes(scope, id, *, stream_consumer_arn)
- Imports an existing Kinesis Stream Consumer by its attributes. - Parameters:
- scope ( - Construct) – the Construct scope.
- id ( - str) – the ID of the construct.
- stream_consumer_arn ( - str) – The Amazon Resource Name (ARN) of the stream consumer.
 
- Return type:
 
 - classmethod is_construct(x)
- Checks if - xis a construct.- Use this method instead of - instanceofto properly detect- Constructinstances, even when the construct library is symlinked.- Explanation: in JavaScript, multiple copies of the - constructslibrary on disk are seen as independent, completely different libraries. As a consequence, the class- Constructin each copy of the- constructslibrary is seen as a different class, and an instance of one class will not test as- instanceofthe other class.- npm installwill not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the- constructslibrary can be accidentally installed, and- instanceofwill behave unpredictably. It is safest to avoid using- instanceof, and using this type-testing method instead.- Parameters:
- x ( - Any) – Any object.
- Return type:
- bool
- Returns:
- true if - xis an object created from a class which extends- Construct.
 
 - classmethod is_owned_resource(construct)
- Returns true if the construct was created by CDK, and false otherwise. - Parameters:
- construct ( - IConstruct)
- Return type:
- bool
 
 - classmethod is_resource(construct)
- Check whether the given construct is a Resource. - Parameters:
- construct ( - IConstruct)
- Return type:
- bool