class DeliveryStream (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.KinesisFirehose.DeliveryStream |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awskinesisfirehose#DeliveryStream |
Java | software.amazon.awscdk.services.kinesisfirehose.DeliveryStream |
Python | aws_cdk.aws_kinesisfirehose.DeliveryStream |
TypeScript (source) | aws-cdk-lib » aws_kinesisfirehose » DeliveryStream |
Implements
IConstruct, IDependable, IResource, IEnvironment, IDelivery, IGrantable, IConnectable
Create a Amazon Data Firehose delivery stream.
Example
import * as firehose from 'aws-cdk-lib/aws-kinesisfirehose';
const bucket = new s3.Bucket(this, 'MyBucket');
const stream = new firehose.DeliveryStream(this, 'MyStream', {
destination: new firehose.S3Bucket(bucket),
});
const topicRule = new iot.TopicRule(this, 'TopicRule', {
sql: iot.IotSql.fromStringAsVer20160323("SELECT * FROM 'device/+/data'"),
actions: [
new actions.FirehosePutRecordAction(stream, {
batchMode: true,
recordSeparator: actions.FirehoseRecordSeparator.NEWLINE,
}),
],
});
Initializer
new DeliveryStream(scope: Construct, id: string, props: DeliveryStreamProps)
Parameters
- scope
Construct - id
string - props
DeliveryStream Props
Construct Props
| Name | Type | Description |
|---|---|---|
| destination | IDestination | The destination that this delivery stream will deliver data to. |
| delivery | string | A name for the delivery stream. |
| encryption? | Stream | Indicates the type of customer master key (CMK) to use for server-side encryption, if any. |
| role? | IRole | The IAM role associated with this delivery stream. |
| source? | ISource | The Kinesis data stream to use as a source for this delivery stream. |
destination
Type:
IDestination
The destination that this delivery stream will deliver data to.
deliveryStreamName?
Type:
string
(optional, default: a name is generated by CloudFormation.)
A name for the delivery stream.
encryption?
Type:
Stream
(optional, default: StreamEncryption.unencrypted())
Indicates the type of customer master key (CMK) to use for server-side encryption, if any.
role?
Type:
IRole
(optional, default: a role will be created with default permissions.)
The IAM role associated with this delivery stream.
Assumed by Amazon Data Firehose to read from sources and encrypt data server-side.
source?
Type:
ISource
(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
| Name | Type | Description |
|---|---|---|
| connections | Connections | Network connections between Amazon Data Firehose and other resources, i.e. Redshift cluster. |
| delivery | string | The ARN of the delivery stream. |
| delivery | string | The name of the delivery stream. |
| env | Resource | The environment this resource belongs to. |
| grant | IPrincipal | The principal to grant permissions to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
connections
Type:
Connections
Network connections between Amazon 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:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they 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.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| grant(grantee, ...actions) | Grant the grantee identity permissions to perform actions. |
| grant | 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. |
| metric | Metric for the number of bytes delivered to Amazon S3 for backup over the specified time period. |
| metric | Metric for the age (from getting into Amazon Data Firehose to now) of the oldest record in Amazon Data Firehose. |
| metric | Metric for the number of records delivered to Amazon S3 for backup over the specified time period. |
| metric | Metric for the number of bytes ingested successfully into the delivery stream over the specified time period after throttling. |
| metric | Metric for the number of records ingested successfully into the delivery stream over the specified time period after throttling. |
| to | Returns a string representation of this construct. |
| static from | Import an existing delivery stream from its ARN. |
| static from | Import an existing delivery stream from its attributes. |
| static from | 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 the grantee identity permissions to perform actions.
grantPutRecords(grantee)
public grantPutRecords(grantee: IGrantable): Grant
Parameters
- grantee
IGrantable
Returns
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
Return the given named metric for this delivery stream.
metricBackupToS3Bytes(props?)
public metricBackupToS3Bytes(props?: MetricOptions): Metric
Parameters
- props
MetricOptions
Returns
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 for the age (from getting into Amazon Data Firehose to now) of the oldest record in Amazon 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 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 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 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
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
DeliveryStream Attributes
Returns
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
Import an existing delivery stream from its name.

.NET
Go
Java
Python
TypeScript (