aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

kinesisfirehose: support Iceberg Destination

Open mazyu36 opened this issue 1 year ago • 6 comments

Describe the feature

Firehose supports the destination settings for Apache Iceberg Table. https://docs.aws.amazon.com/firehose/latest/dev/apache-iceberg-destination.html

But at the present, L2 Construct does not support it.

Ref: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisfirehose-deliverystream-icebergdestinationconfiguration.html

Use Case

To use Iceberg Destination feature.

Proposed Solution

Add a L2 Construct for Iceberg Destination.

Other Information

No response

Acknowledgements

  • [x] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

CDK version used

2.180.0

Environment details (OS name and version, etc.)

all

mazyu36 avatar Mar 01 '25 12:03 mazyu36

They seem to be available in the Cfn resource though.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_kinesisfirehose.CfnDeliveryStream.html

Main problem to me, that I'm observing, is that nor the Cfn resource include the automatic tables creation in Glue:

https://docs.aws.amazon.com/firehose/latest/APIReference/API_TableCreationConfiguration.html

Seems to be only supported through UI, API, SDK, but not in the CDK.

juliomaroto avatar Mar 02 '25 03:03 juliomaroto

Thank you @mazyu36 ! We appreciate your PR as always! :-)

pahud avatar Mar 02 '25 03:03 pahud

Is this feature under active development?

matt-challe avatar Jul 14 '25 16:07 matt-challe

For anyone else, I did the following to add an iceberg destination

const firehoseStream = new firehose.DeliveryStream(this, 'FirehoseStream', {
  deliveryStreamName: props.firehoseStreamName,
  destination: new firehose.S3Bucket(randomBucket, {
    role: role.withoutPolicyUpdates(),
  }),
  role: role.withoutPolicyUpdates(),
  encryption: firehose.StreamEncryption.awsOwnedKey(),
});

const icebergDestination: firehose.CfnDeliveryStream.IcebergDestinationConfigurationProperty =
  {
    catalogConfiguration: {
      catalogArn: `arn:aws:glue:${this.region}:${this.account}:catalog`,
    },
    roleArn: role.roleArn,
    s3Configuration: {
      bucketArn: destinationBucket,
      bufferingHints: {intervalInSeconds: 300},
      roleArn: role.roleArn,
    },
    processingConfiguration: {
      enabled: true,
      processors: [
        {
          type: 'Lambda',
          parameters: [
            {parameterName: 'LambdaArn', parameterValue: fn.functionArn},
          ],
        },
      ],
    },
  };

const cfnFirehoseStream = firehoseStream.node
  .defaultChild as firehose.CfnDeliveryStream;

cfnFirehoseStream.icebergDestinationConfiguration = icebergDestination;
cfnFirehoseStream.s3DestinationConfiguration = undefined;
cfnFirehoseStream.extendedS3DestinationConfiguration = undefined;

It's a barebones example, but the gist is to use the L1 escape hatch for the time being

Rizxcviii avatar Oct 02 '25 12:10 Rizxcviii

I am working on this implementation.

konippi avatar Oct 10 '25 09:10 konippi

Hi @konippi, any update on your implementation?

miloszwatroba avatar Sep 03 '26 11:09 miloszwatroba