@aws-cdk_aws-kinesisfirehose-alpha.DeliveryStream

class DeliveryStream (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.KinesisFirehose.Alpha.DeliveryStream
Gogithub.com/aws/aws-cdk-go/awscdkkinesisfirehosealpha/v2#DeliveryStream
Javasoftware.amazon.awscdk.services.kinesisfirehose.alpha.DeliveryStream
Pythonaws_cdk.aws_kinesisfirehose_alpha.DeliveryStream
TypeScript (source)@aws-cdk/aws-kinesisfirehose-alpha ยป DeliveryStream

Implements IConstruct, IDependable, IResource, IDeliveryStream, IGrantable, IConnectable

Create a Kinesis Data Firehose delivery stream.

Example

// Create service roles for the delivery stream and destination.
// These can be used for other purposes and granted access to different resources.
// They must include the Kinesis Data Firehose service principal in their trust policies.
// Two separate roles are shown below, but the same role can be used for both purposes.
const deliveryStreamRole = new iam.Role(this, 'Delivery Stream Role', {
  assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'),
});
const destinationRole = new iam.Role(this, 'Destination Role', {
  assumedBy: new iam.ServicePrincipal('firehose.amazonaws.com'),
});

// Specify the roles created above when defining the destination and delivery stream.
declare const bucket: s3.Bucket;
const destination = new destinations.S3Bucket(bucket, { role: destinationRole });
new firehose.DeliveryStream(this, 'Delivery Stream', {
  destinations: [destination],
  role: deliveryStreamRole,
});

Initializer

new DeliveryStream(scope: Construct, id: string, props: DeliveryStreamProps)

Parameters

  • scope Construct
  • id string
  • props DeliveryStreamProps

Construct Props

NameTypeDescription
destinations๐Ÿ”นIDestination[]The destinations that this delivery stream will deliver data to.
deliveryStreamName?๐Ÿ”นstringA name for the delivery stream.
encryption?๐Ÿ”นStreamEncryptionIndicates the type of customer master key (CMK) to use for server-side encryption, if any.
encryptionKey?๐Ÿ”นIKeyCustomer managed key to server-side encrypt data in the stream.
role?๐Ÿ”นIRoleThe IAM role associated with this delivery stream.
sourceStream?๐Ÿ”นIStreamThe Kinesis data stream to use as a source for this delivery stream.

destinations๐Ÿ”น

Type: IDestination[]

The destinations that this delivery stream will deliver data to.

Only a singleton array is supported at this time.


deliveryStreamName?๐Ÿ”น

Type: string (optional, default: a name is generated by CloudFormation.)

A name for the delivery stream.


encryption?๐Ÿ”น

Type: StreamEncryption (optional, default: StreamEncryption.UNENCRYPTED - unless encryptionKey is provided, in which case this will be implicitly set to StreamEncryption.CUSTOMER_MANAGED)

Indicates the type of customer master key (CMK) to use for server-side encryption, if any.


encryptionKey?๐Ÿ”น

Type: IKey (optional, default: no KMS key will be used; if encryption is set to CUSTOMER_MANAGED, a KMS key will be created for you)

Customer managed key to server-side encrypt data in the stream.


role?๐Ÿ”น

Type: IRole (optional, default: a role will be created with default permissions.)

The IAM role associated with this delivery stream.

Assumed by Kinesis Data Firehose to read from sources and encrypt data server-side.


sourceStream?๐Ÿ”น

Type: IStream (optional, default: data must be written to the delivery stream via a direct put.)

The Kinesis data stream to use as a source for this delivery stream.

Properties

NameTypeDescription
connections๐Ÿ”นConnectionsNetwork connections between Kinesis Data Firehose and other resources, i.e. Redshift cluster.
deliveryStreamArn๐Ÿ”นstringThe ARN of the delivery stream.
deliveryStreamName๐Ÿ”นstringThe name of the delivery stream.
env๐Ÿ”นResourceEnvironmentThe environment this resource belongs to.
grantPrincipal๐Ÿ”นIPrincipalThe principal to grant permissions to.
node๐Ÿ”นNodeThe tree node.
stack๐Ÿ”นStackThe stack in which this resource is defined.

connections๐Ÿ”น

Type: Connections

Network connections between Kinesis Data Firehose and other resources, i.e. Redshift cluster.


deliveryStreamArn๐Ÿ”น

Type: string

The ARN of the delivery stream.


deliveryStreamName๐Ÿ”น

Type: string

The name of the delivery stream.


env๐Ÿ”น

Type: ResourceEnvironment

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.


grantPrincipal๐Ÿ”น

Type: IPrincipal

The principal to grant permissions to.


node๐Ÿ”น

Type: Node

The tree node.


stack๐Ÿ”น

Type: Stack

The stack in which this resource is defined.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
grant(grantee, ...actions)๐Ÿ”นGrant the grantee identity permissions to perform actions.
grantPutRecords(grantee)๐Ÿ”นGrant the grantee identity permissions to perform firehose:PutRecord and firehose:PutRecordBatch actions on this delivery stream.
metric(metricName, props?)๐Ÿ”นReturn the given named metric for this delivery stream.
metricBackupToS3Bytes(props?)๐Ÿ”นMetric for the number of bytes delivered to Amazon S3 for backup over the specified time period.
metricBackupToS3DataFreshness(props?)๐Ÿ”นMetric for the age (from getting into Kinesis Data Firehose to now) of the oldest record in Kinesis Data Firehose.
metricBackupToS3Records(props?)๐Ÿ”นMetric for the number of records delivered to Amazon S3 for backup over the specified time period.
metricIncomingBytes(props?)๐Ÿ”นMetric for the number of bytes ingested successfully into the delivery stream over the specified time period after throttling.
metricIncomingRecords(props?)๐Ÿ”นMetric for the number of records ingested successfully into the delivery stream over the specified time period after throttling.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromDeliveryStreamArn(scope, id, deliveryStreamArn)๐Ÿ”นImport an existing delivery stream from its ARN.
static fromDeliveryStreamAttributes(scope, id, attrs)๐Ÿ”นImport an existing delivery stream from its attributes.
static fromDeliveryStreamName(scope, id, deliveryStreamName)๐Ÿ”นImport an existing delivery stream from its name.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

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).


grant(grantee, ...actions)๐Ÿ”น

public grant(grantee: IGrantable, ...actions: string[]): Grant

Parameters

  • grantee IGrantable
  • actions string

Returns

  • Grant

Grant the grantee identity permissions to perform actions.


grantPutRecords(grantee)๐Ÿ”น

public grantPutRecords(grantee: IGrantable): Grant

Parameters

  • grantee IGrantable

Returns

  • Grant

Grant the grantee identity permissions to perform firehose:PutRecord and firehose:PutRecordBatch actions on this delivery stream.


metric(metricName, props?)๐Ÿ”น

public metric(metricName: string, props?: MetricOptions): Metric

Parameters

  • metricName string
  • props MetricOptions

Returns

  • Metric

Return the given named metric for this delivery stream.


metricBackupToS3Bytes(props?)๐Ÿ”น

public metricBackupToS3Bytes(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Metric for the number of bytes delivered to Amazon S3 for backup over the specified time period.

By default, this metric will be calculated as an average over a period of 5 minutes.


metricBackupToS3DataFreshness(props?)๐Ÿ”น

public metricBackupToS3DataFreshness(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Metric for the age (from getting into Kinesis Data Firehose to now) of the oldest record in Kinesis Data Firehose.

Any record older than this age has been delivered to the Amazon S3 bucket for backup.

By default, this metric will be calculated as an average over a period of 5 minutes.


metricBackupToS3Records(props?)๐Ÿ”น

public metricBackupToS3Records(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Metric for the number of records delivered to Amazon S3 for backup over the specified time period.

By default, this metric will be calculated as an average over a period of 5 minutes.


metricIncomingBytes(props?)๐Ÿ”น

public metricIncomingBytes(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Metric for the number of bytes ingested successfully into the delivery stream over the specified time period after throttling.

By default, this metric will be calculated as an average over a period of 5 minutes.


metricIncomingRecords(props?)๐Ÿ”น

public metricIncomingRecords(props?: MetricOptions): Metric

Parameters

  • props MetricOptions

Returns

  • Metric

Metric for the number of records ingested successfully into the delivery stream over the specified time period after throttling.

By default, this metric will be calculated as an average over a period of 5 minutes.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromDeliveryStreamArn(scope, id, deliveryStreamArn)๐Ÿ”น

public static fromDeliveryStreamArn(scope: Construct, id: string, deliveryStreamArn: string): IDeliveryStream

Parameters

  • scope Construct
  • id string
  • deliveryStreamArn string

Returns

  • IDeliveryStream

Import an existing delivery stream from its ARN.


static fromDeliveryStreamAttributes(scope, id, attrs)๐Ÿ”น

public static fromDeliveryStreamAttributes(scope: Construct, id: string, attrs: DeliveryStreamAttributes): IDeliveryStream

Parameters

  • scope Construct
  • id string
  • attrs DeliveryStreamAttributes

Returns

  • IDeliveryStream

Import an existing delivery stream from its attributes.


static fromDeliveryStreamName(scope, id, deliveryStreamName)๐Ÿ”น

public static fromDeliveryStreamName(scope: Construct, id: string, deliveryStreamName: string): IDeliveryStream

Parameters

  • scope Construct
  • id string
  • deliveryStreamName string

Returns

  • IDeliveryStream

Import an existing delivery stream from its name.