AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

ResourcePolicy

The policy for a data stream or registered consumer. Policies define the operations that are allowed on this resource. You almost never need to define this construct directly. All AWS resources that support resource policies have a method called `addToResourcePolicy()`, which will automatically create a new resource policy if one doesn't exist yet, otherwise it will add to the existing policy. Prefer to use `addToResourcePolicy()` instead.

Import

import { ResourcePolicy } from 'aws-cdk-lib/aws-kinesis';

Or use the module namespace:

import * as kinesis from 'aws-cdk-lib/aws-kinesis';
// kinesis.ResourcePolicy

Properties

Configuration passed to the constructor as ResourcePolicyProps.

policyDocumentOptional
PolicyDocument

IAM policy document to apply to a data stream.

Default: - empty policy document

streamOptional
IStream

The stream this policy applies to. Note: only one of `stream` and `streamConsumer` must be set.

Default: - policy is not associated to a stream

streamConsumerOptional
IStreamConsumer

The stream consumer this policy applies to. Note: only one of `stream` and `streamConsumer` must be set.

Default: - policy is not associated to a consumer

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter