AWS CDK Kinesis Firehose Destinations (Alpha - Deprecated)
This Python package provided experimental (alpha) AWS CDK constructs for defining destinations for Kinesis Firehose delivery streams. It is officially deprecated as of CDK v2.186.0a0, and all its constructs have been merged into the main `aws-cdk-lib` package. Users should migrate to the equivalent constructs within `aws_cdk.aws_kinesisfirehose_destinations` for stable and actively maintained functionality. This package will no longer receive updates.
Common errors
-
ModuleNotFoundError: No module named 'aws_cdk_aws_kinesisfirehose_destinations_alpha'
cause You are trying to import from the deprecated standalone alpha package, which is either not installed or has been explicitly uninstalled.fixInstall `aws-cdk-lib` and update your import statements to `from aws_cdk.aws_kinesisfirehose_destinations import ...`. -
AttributeError: module 'aws_cdk_aws_kinesisfirehose_destinations_alpha' has no attribute 'S3BucketDestination'
cause Even if the deprecated package is installed, the specific construct name or its API might have changed during its migration from alpha to the stable `aws-cdk-lib`.fixConsult the `aws-cdk-lib` documentation for `aws_cdk.aws_kinesisfirehose_destinations` to find the correct class names and their usage.
Warnings
- breaking This entire module is deprecated and its constructs have been moved into `aws-cdk-lib`. Relying on `aws-cdk-aws-kinesisfirehose-destinations-alpha` will lead to broken deployments and lack of future support.
- gotcha Using 'alpha' modules in AWS CDK signifies experimental, potentially unstable APIs. These modules can change significantly or be merged into the main library without traditional major version bumps, leading to unexpected breaking changes.
- deprecated The AWS CDK CLI or synthesis process will emit warnings if it detects usage of deprecated alpha constructs. For example, 'The "@aws-cdk/aws-kinesisfirehose-destinations-alpha" module has been deprecated and its constructs are now available in the "@aws-cdk/aws-kinesisfirehose" module.'
Install
-
pip install aws-cdk-lib -
pip install aws-cdk-aws-kinesisfirehose-destinations-alpha
Imports
- S3BucketDestination
from aws_cdk_aws_kinesisfirehose_destinations_alpha import S3BucketDestination
from aws_cdk.aws_kinesisfirehose_destinations import S3BucketDestination
Quickstart
import os
from aws_cdk import (
App,
Stack,
Environment,
aws_s3 as s3,
aws_kinesisfirehose as kinesisfirehose,
aws_kinesisfirehose_destinations as kinesisfirehose_destinations,
)
from constructs import Construct
class MyFirehoseStack(Stack):
def __init__(self, scope: Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
# Create an S3 Bucket for the Firehose destination
bucket = s3.Bucket(
self, "FirehoseDestinationBucket",
bucket_name=f"my-firehose-target-{self.account}-{self.region}",
)
# Define the S3 destination for Kinesis Firehose using the stable module
s3_destination = kinesisfirehose_destinations.S3BucketDestination(
bucket,
# Optional: configure compression, buffer, etc.
# compression=kinesisfirehose_destinations.Compression.GZIP,
)
# Create a Kinesis Firehose Delivery Stream
firehose_stream = kinesisfirehose.DeliveryStream(
self, "MyFirehoseStream",
destinations=[s3_destination],
delivery_stream_name="my-app-firehose-stream-stable",
)
app = App()
MyFirehoseStack(app, "MyFirehoseStack",
env=Environment(
account=os.environ.get('CDK_DEFAULT_ACCOUNT', '123456789012'),
region=os.environ.get('CDK_DEFAULT_REGION', 'us-east-1')
)
)
app.synth()