UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

603 lines (602 loc) 28.1 kB
import * as cdk from "../../core/lib"; import * as constructs from "constructs"; import * as cfn_parse from "../../core/lib/helpers-internal"; import { IResourcePolicyRef, IStreamConsumerRef, IStreamRef, ResourcePolicyReference, StreamConsumerReference, StreamReference } from "../../interfaces/generated/aws-kinesis-interfaces.generated"; import { aws_kinesis as kinesisRefs } from "../../interfaces"; /** * Creates a Kinesis stream that captures and transports data records that are emitted from data sources. * * For information about creating streams, see [CreateStream](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_CreateStream.html) in the Amazon Kinesis API Reference. * * @cloudformationResource AWS::Kinesis::Stream * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html */ export declare class CfnStream extends cdk.CfnResource implements cdk.IInspectable, IStreamRef, cdk.ITaggable { /** * The CloudFormation resource type name for this resource class. */ static readonly CFN_RESOURCE_TYPE_NAME: string; /** * Build a CfnStream from CloudFormation properties * * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnStream; /** * Checks whether the given object is a CfnStream */ static isCfnStream(x: any): x is CfnStream; /** * Creates a new IStreamRef from an ARN */ static fromStreamArn(scope: constructs.Construct, id: string, arn: string): IStreamRef; /** * Creates a new IStreamRef from a streamName */ static fromStreamName(scope: constructs.Construct, id: string, streamName: string): IStreamRef; static arnForStream(resource: IStreamRef): string; /** * A list of shard-level metrics in properties to enable enhanced monitoring mode. */ private _desiredShardLevelMetrics?; /** * The maximum record size of a single record in kibibyte (KiB) that you can write to, and read from a stream. */ private _maxRecordSizeInKiB?; /** * The name of the Kinesis stream. */ private _name?; /** * The number of hours for the data records that are stored in shards to remain accessible. */ private _retentionPeriodHours?; /** * The number of shards that the stream uses. */ private _shardCount?; /** * When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream. */ private _streamEncryption?; /** * Specifies the capacity mode to which you want to set your data stream. */ private _streamModeDetails?; /** * Tag Manager which manages the tags for this resource */ readonly tags: cdk.TagManager; /** * An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream. */ private _tagsRaw?; /** * The target warm throughput in MB/s that the stream should be scaled to handle. */ private _warmThroughputMiBps?; /** * Create a new `AWS::Kinesis::Stream`. * * @param scope Scope in which this resource is defined * @param id Construct identifier for this resource (unique in its scope) * @param props Resource properties */ constructor(scope: constructs.Construct, id: string, props?: CfnStreamProps); get streamRef(): StreamReference; /** * A list of shard-level metrics in properties to enable enhanced monitoring mode. */ get desiredShardLevelMetrics(): Array<string> | undefined; /** * A list of shard-level metrics in properties to enable enhanced monitoring mode. */ set desiredShardLevelMetrics(value: Array<string> | undefined); /** * The maximum record size of a single record in kibibyte (KiB) that you can write to, and read from a stream. */ get maxRecordSizeInKiB(): number | undefined; /** * The maximum record size of a single record in kibibyte (KiB) that you can write to, and read from a stream. */ set maxRecordSizeInKiB(value: number | undefined); /** * The name of the Kinesis stream. */ get name(): string | undefined; /** * The name of the Kinesis stream. */ set name(value: string | undefined); /** * The number of hours for the data records that are stored in shards to remain accessible. */ get retentionPeriodHours(): number | undefined; /** * The number of hours for the data records that are stored in shards to remain accessible. */ set retentionPeriodHours(value: number | undefined); /** * The number of shards that the stream uses. */ get shardCount(): number | undefined; /** * The number of shards that the stream uses. */ set shardCount(value: number | undefined); /** * When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream. */ get streamEncryption(): cdk.IResolvable | CfnStream.StreamEncryptionProperty | undefined; /** * When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream. */ set streamEncryption(value: cdk.IResolvable | CfnStream.StreamEncryptionProperty | undefined); /** * Specifies the capacity mode to which you want to set your data stream. */ get streamModeDetails(): cdk.IResolvable | CfnStream.StreamModeDetailsProperty | undefined; /** * Specifies the capacity mode to which you want to set your data stream. */ set streamModeDetails(value: cdk.IResolvable | CfnStream.StreamModeDetailsProperty | undefined); /** * An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream. */ get tagsRaw(): Array<cdk.CfnTag> | undefined; /** * An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream. */ set tagsRaw(value: Array<cdk.CfnTag> | undefined); /** * The target warm throughput in MB/s that the stream should be scaled to handle. */ get warmThroughputMiBps(): number | undefined; /** * The target warm throughput in MB/s that the stream should be scaled to handle. */ set warmThroughputMiBps(value: number | undefined); /** * The Amazon resource name (ARN) of the Kinesis stream, such as `arn:aws:kinesis:us-east-2:123456789012:stream/mystream` . * * @cloudformationAttribute Arn */ get attrArn(): string; /** * Warm throughput configuration details for the stream. Only present for ON_DEMAND streams. * * @cloudformationAttribute WarmThroughputObject */ get attrWarmThroughputObject(): cdk.IResolvable; protected get cfnProperties(): Record<string, any>; /** * Examines the CloudFormation resource and discloses attributes * * @param inspector tree inspector to collect and process attributes */ inspect(inspector: cdk.TreeInspector): void; protected renderProperties(props: Record<string, any>): Record<string, any>; } export declare namespace CfnStream { /** * Specifies the capacity mode to which you want to set your data stream. * * Currently, in Kinesis Data Streams, you can choose between an *on-demand* capacity mode and a *provisioned* capacity mode for your data streams. * * @struct * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-streammodedetails.html */ interface StreamModeDetailsProperty { /** * Specifies the capacity mode to which you want to set your data stream. * * Currently, in Kinesis Data Streams, you can choose between an *on-demand* capacity mode and a *provisioned* capacity mode for your data streams. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-streammodedetails.html#cfn-kinesis-stream-streammodedetails-streammode */ readonly streamMode: string; } /** * Enables or updates server-side encryption using an AWS KMS key for a specified stream. * * > When invoking this API, you must use either the `StreamARN` or the `StreamName` parameter, or both. It is recommended that you use the `StreamARN` input parameter when you invoke this API. * * Starting encryption is an asynchronous operation. Upon receiving the request, Kinesis Data Streams returns immediately and sets the status of the stream to `UPDATING` . After the update is complete, Kinesis Data Streams sets the status of the stream back to `ACTIVE` . Updating or applying encryption normally takes a few seconds to complete, but it can take minutes. You can continue to read and write data to your stream while its status is `UPDATING` . Once the status of the stream is `ACTIVE` , encryption begins for records written to the stream. * * API Limits: You can successfully apply a new AWS KMS key for server-side encryption 25 times in a rolling 24-hour period. * * Note: It can take up to 5 seconds after the stream is in an `ACTIVE` status before all records written to the stream are encrypted. After you enable encryption, you can verify that encryption is applied by inspecting the API response from `PutRecord` or `PutRecords` . * * @struct * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-streamencryption.html */ interface StreamEncryptionProperty { /** * The encryption type to use. * * The only valid value is `KMS` . * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-streamencryption.html#cfn-kinesis-stream-streamencryption-encryptiontype */ readonly encryptionType: string; /** * The GUID for the customer-managed AWS KMS key to use for encryption. * * This value can be a globally unique identifier, a fully specified Amazon Resource Name (ARN) to either an alias or a key, or an alias name prefixed by "alias/".You can also use a master key owned by Kinesis Data Streams by specifying the alias `aws/kinesis` . * * - Key ARN example: `arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012` * - Alias ARN example: `arn:aws:kms:us-east-1:123456789012:alias/MyAliasName` * - Globally unique key ID example: `12345678-1234-1234-1234-123456789012` * - Alias name example: `alias/MyAliasName` * - Master key owned by Kinesis Data Streams: `alias/aws/kinesis` * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-streamencryption.html#cfn-kinesis-stream-streamencryption-keyid */ readonly keyId: string; } /** * Represents the warm throughput configuration on the stream. * * This is only present for On-Demand Kinesis Data Streams in accounts that have `MinimumThroughputBillingCommitment` enabled. * * @struct * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-warmthroughputobject.html */ interface WarmThroughputObjectProperty { /** * The current warm throughput value on the stream. * * This is the write throughput in MiBps that the stream is currently scaled to handle. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-warmthroughputobject.html#cfn-kinesis-stream-warmthroughputobject-currentmibps */ readonly currentMiBps?: number; /** * The target warm throughput value on the stream. * * This indicates that the stream is currently scaling towards this target value. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesis-stream-warmthroughputobject.html#cfn-kinesis-stream-warmthroughputobject-targetmibps */ readonly targetMiBps?: number; } } /** * Properties for defining a `CfnStream` * * @struct * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html */ export interface CfnStreamProps { /** * A list of shard-level metrics in properties to enable enhanced monitoring mode. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-desiredshardlevelmetrics */ readonly desiredShardLevelMetrics?: Array<string>; /** * The maximum record size of a single record in kibibyte (KiB) that you can write to, and read from a stream. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-maxrecordsizeinkib */ readonly maxRecordSizeInKiB?: number; /** * The name of the Kinesis stream. * * If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the stream name. For more information, see [Name Type](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html) . * * If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-name */ readonly name?: string; /** * The number of hours for the data records that are stored in shards to remain accessible. * * The default value is 24. For more information about the stream retention period, see [Changing the Data Retention Period](https://docs.aws.amazon.com/streams/latest/dev/kinesis-extended-retention.html) in the Amazon Kinesis Developer Guide. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-retentionperiodhours */ readonly retentionPeriodHours?: number; /** * The number of shards that the stream uses. * * For greater provisioned throughput, increase the number of shards. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-shardcount */ readonly shardCount?: number; /** * When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream. * * Removing this property from your stack template and updating your stack disables encryption. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-streamencryption */ readonly streamEncryption?: cdk.IResolvable | CfnStream.StreamEncryptionProperty; /** * Specifies the capacity mode to which you want to set your data stream. * * Currently, in Kinesis Data Streams, you can choose between an *on-demand* capacity mode and a *provisioned* capacity mode for your data streams. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-streammodedetails */ readonly streamModeDetails?: cdk.IResolvable | CfnStream.StreamModeDetailsProperty; /** * An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream. * * For information about constraints for this property, see [Tag Restrictions](https://docs.aws.amazon.com/streams/latest/dev/tagging.html#tagging-restrictions) in the *Amazon Kinesis Developer Guide* . * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-tags */ readonly tags?: Array<cdk.CfnTag>; /** * The target warm throughput in MB/s that the stream should be scaled to handle. * * This represents the throughput capacity that will be immediately available for write operations. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-stream.html#cfn-kinesis-stream-warmthroughputmibps */ readonly warmThroughputMiBps?: number; } /** * Use the AWS CloudFormation `AWS::Kinesis::StreamConsumer` resource to register a consumer with a Kinesis data stream. * * The consumer you register can then call [SubscribeToShard](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_SubscribeToShard.html) to receive data from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every shard you subscribe to. This rate is unaffected by the total number of consumers that read from the same stream. * * You can register up to 20 consumers per stream. However, you can request a limit increase using the [Kinesis Data Streams limits form](https://docs.aws.amazon.com/support/v1?#/) . A given consumer can only be registered with one stream at a time. * * For more information, see [Using Consumers with Enhanced Fan-Out](https://docs.aws.amazon.com/streams/latest/dev/introduction-to-enhanced-consumers.html) . * * @cloudformationResource AWS::Kinesis::StreamConsumer * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html */ export declare class CfnStreamConsumer extends cdk.CfnResource implements cdk.IInspectable, IStreamConsumerRef, cdk.ITaggableV2 { /** * The CloudFormation resource type name for this resource class. */ static readonly CFN_RESOURCE_TYPE_NAME: string; /** * Build a CfnStreamConsumer from CloudFormation properties * * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnStreamConsumer; /** * Checks whether the given object is a CfnStreamConsumer */ static isCfnStreamConsumer(x: any): x is CfnStreamConsumer; /** * Tag Manager which manages the tags for this resource */ readonly cdkTagManager: cdk.TagManager; /** * The name of the consumer is something you choose when you register the consumer. */ private _consumerName; /** * The ARN of the stream with which you registered the consumer. */ private _streamArn; /** * An array of tags to be added to a specified Kinesis resource. */ private _tags?; /** * Create a new `AWS::Kinesis::StreamConsumer`. * * @param scope Scope in which this resource is defined * @param id Construct identifier for this resource (unique in its scope) * @param props Resource properties */ constructor(scope: constructs.Construct, id: string, props: CfnStreamConsumerProps); get streamConsumerRef(): StreamConsumerReference; /** * The name of the consumer is something you choose when you register the consumer. */ get consumerName(): string; /** * The name of the consumer is something you choose when you register the consumer. */ set consumerName(value: string); /** * The ARN of the stream with which you registered the consumer. */ get streamArn(): string; /** * The ARN of the stream with which you registered the consumer. */ set streamArn(value: string); /** * An array of tags to be added to a specified Kinesis resource. */ get tags(): Array<cdk.CfnTag> | undefined; /** * An array of tags to be added to a specified Kinesis resource. */ set tags(value: Array<cdk.CfnTag> | undefined); /** * When you register a consumer, Kinesis Data Streams generates an ARN for it. You need this ARN to be able to call [SubscribeToShard](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_SubscribeToShard.html) . * * If you delete a consumer and then create a new one with the same name, it won't have the same ARN. That's because consumer ARNs contain the creation timestamp. This is important to keep in mind if you have IAM policies that reference consumer ARNs. * * @cloudformationAttribute ConsumerARN */ get attrConsumerArn(): string; /** * The time at which the consumer was created. * * @cloudformationAttribute ConsumerCreationTimestamp */ get attrConsumerCreationTimestamp(): string; /** * The name you gave the consumer when you registered it. * * @cloudformationAttribute ConsumerName */ get attrConsumerName(): string; /** * A consumer can't read data while in the `CREATING` or `DELETING` states. * * @cloudformationAttribute ConsumerStatus */ get attrConsumerStatus(): string; /** * The ARN of the data stream with which the consumer is registered. * * @cloudformationAttribute StreamARN */ get attrStreamArn(): string; protected get cfnProperties(): Record<string, any>; /** * Examines the CloudFormation resource and discloses attributes * * @param inspector tree inspector to collect and process attributes */ inspect(inspector: cdk.TreeInspector): void; protected renderProperties(props: Record<string, any>): Record<string, any>; } /** * Properties for defining a `CfnStreamConsumer` * * @struct * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html */ export interface CfnStreamConsumerProps { /** * The name of the consumer is something you choose when you register the consumer. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html#cfn-kinesis-streamconsumer-consumername */ readonly consumerName: string; /** * The ARN of the stream with which you registered the consumer. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html#cfn-kinesis-streamconsumer-streamarn */ readonly streamArn: string; /** * An array of tags to be added to a specified Kinesis resource. * * A tag consists of a required key and an optional value. You can specify up to 50 tag key-value pairs. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html#cfn-kinesis-streamconsumer-tags */ readonly tags?: Array<cdk.CfnTag>; } /** * Attaches a resource-based policy to a data stream or registered consumer. * * If you are using an identity other than the root user of the AWS account that owns the resource, the calling identity must have the `PutResourcePolicy` permissions on the specified Kinesis Data Streams resource and belong to the owner's account in order to use this operation. If you don't have `PutResourcePolicy` permissions, Amazon Kinesis Data Streams returns a `403 Access Denied error` . If you receive a `ResourceNotFoundException` , check to see if you passed a valid stream or consumer resource. * * Request patterns can be one of the following: * * - Data stream pattern: `arn:aws.*:kinesis:.*:\d{12}:.*stream/\S+` * - Consumer pattern: `^(arn):aws.*:kinesis:.*:\d{12}:.*stream\/[a-zA-Z0-9_.-]+\/consumer\/[a-zA-Z0-9_.-]+:[0-9]+` * * For more information, see [Controlling Access to Amazon Kinesis Data Streams Resources Using IAM](https://docs.aws.amazon.com/streams/latest/dev/controlling-access.html) . * * @cloudformationResource AWS::Kinesis::ResourcePolicy * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-resourcepolicy.html */ export declare class CfnResourcePolicy extends cdk.CfnResource implements cdk.IInspectable, IResourcePolicyRef { /** * The CloudFormation resource type name for this resource class. */ static readonly CFN_RESOURCE_TYPE_NAME: string; /** * Build a CfnResourcePolicy from CloudFormation properties * * A factory method that creates a new instance of this class from an object * containing the CloudFormation properties of this resource. * Used in the @aws-cdk/cloudformation-include module. * * @internal */ static _fromCloudFormation(scope: constructs.Construct, id: string, resourceAttributes: any, options: cfn_parse.FromCloudFormationOptions): CfnResourcePolicy; /** * Checks whether the given object is a CfnResourcePolicy */ static isCfnResourcePolicy(x: any): x is CfnResourcePolicy; /** * Returns the Amazon Resource Name (ARN) of the resource-based policy. */ private _resourceArn; /** * This is the description for the resource policy. */ private _resourcePolicy; /** * Create a new `AWS::Kinesis::ResourcePolicy`. * * @param scope Scope in which this resource is defined * @param id Construct identifier for this resource (unique in its scope) * @param props Resource properties */ constructor(scope: constructs.Construct, id: string, props: CfnResourcePolicyProps); get resourcePolicyRef(): ResourcePolicyReference; /** * Returns the Amazon Resource Name (ARN) of the resource-based policy. */ get resourceArn(): string; /** * Returns the Amazon Resource Name (ARN) of the resource-based policy. */ set resourceArn(value: string); /** * This is the description for the resource policy. */ get resourcePolicy(): any | cdk.IResolvable; /** * This is the description for the resource policy. */ set resourcePolicy(value: any | cdk.IResolvable); protected get cfnProperties(): Record<string, any>; /** * Examines the CloudFormation resource and discloses attributes * * @param inspector tree inspector to collect and process attributes */ inspect(inspector: cdk.TreeInspector): void; protected renderProperties(props: Record<string, any>): Record<string, any>; } /** * Properties for defining a `CfnResourcePolicy` * * @struct * @stability external * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-resourcepolicy.html */ export interface CfnResourcePolicyProps { /** * Returns the Amazon Resource Name (ARN) of the resource-based policy. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-resourcepolicy.html#cfn-kinesis-resourcepolicy-resourcearn */ readonly resourceArn: kinesisRefs.IStreamConsumerRef | kinesisRefs.IStreamRef | string; /** * This is the description for the resource policy. * * @see http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-resourcepolicy.html#cfn-kinesis-resourcepolicy-resourcepolicy */ readonly resourcePolicy: any | cdk.IResolvable; } export type { IStreamRef, StreamReference }; export type { IStreamConsumerRef, StreamConsumerReference }; export type { IResourcePolicyRef, ResourcePolicyReference };