Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws_kinesisfirehose: Unable to set Kinesis Stream as Source #33414

Closed
1 task done
dfdf opened this issue Feb 12, 2025 · 3 comments
Closed
1 task done

aws_kinesisfirehose: Unable to set Kinesis Stream as Source #33414

dfdf opened this issue Feb 12, 2025 · 3 comments
Labels
@aws-cdk/aws-kinesisfirehose Related to Amazon Kinesis Data Firehose bug This issue is a bug. p3 potential-regression Marking this issue as a potential regression to be checked by team member response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@dfdf
Copy link

dfdf commented Feb 12, 2025

Describe the bug

I recently updated our stack to cdk 2.178, however I am facing some issues with the new stable version of aws_cdk.aws_kinesisfirehose.
When I try to synth the stack I get the error.

Below is part of the code:

       ...
        firehose_id = "dev-delivery--test"
        test = Stream(self, "MyStream" )
        
        firehose_stream = DeliveryStream(
            self,
            id=firehose_id,
            delivery_stream_name=firehose_id,
            source=test,
            destination=s3_destination,
        )
       ...

But I got this error (the full stack is below)

RuntimeError: props.source?._bind is not a function

When I remove the source parameter, the stack completes the synth successfully
Example:

       ...
        firehose_id = "dev-delivery--test"
        test = Stream(self, "MyStream" )
        
        firehose_stream = DeliveryStream(
            self,
            id=firehose_id,
            delivery_stream_name=firehose_id,
            destination=s3_destination,
        )
       ...

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Version

2.131.0

Expected Behavior

The stack should complete the synth command successfully.

Current Behavior

The stack is failing to complete the synth command. With the error:

jsii.errors.JavaScriptError: 
  TypeError: props.source?._bind is not a function
      at new DeliveryStream (/var/folders/lg/dxpltkkx3b133x3p08yyr8l00000gn/T/jsii-kernel-Rg2m4z/node_modules/aws-cdk-lib/aws-kinesisfirehose/lib/delivery-stream.js:1:6181)
      at Kernel._Kernel_create (/private/var/folders/lg/dxpltkkx3b133x3p08yyr8l00000gn/T/tmpkerj9f0v/lib/program.js:9128:25)
      at Kernel.create (/private/var/folders/lg/dxpltkkx3b133x3p08yyr8l00000gn/T/tmpkerj9f0v/lib/program.js:8798:93)
      at KernelHost.processRequest (/private/var/folders/lg/dxpltkkx3b133x3p08yyr8l00000gn/T/tmpkerj9f0v/lib/program.js:10718:36)
      at KernelHost.run (/private/var/folders/lg/dxpltkkx3b133x3p08yyr8l00000gn/T/tmpkerj9f0v/lib/program.js:10678:22)
      at Immediate._onImmediate (/private/var/folders/lg/dxpltkkx3b133x3p08yyr8l00000gn/T/tmpkerj9f0v/lib/program.js:10679:46)
      at process.processImmediate (node:internal/timers:491:21)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dfdf/Documents/GitHub/cdk-repo/app.py", line 170, in <module>
    FlowIngestionStack(scope=app, product="flow")
  File "/Users/dfdf/Documents/GitHub/cdk-repo/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
  File "/Users/dfdf/Documents/GitHub/cdk-repo/stacks/flow_ingestion.py", line 43, in __init__
    self.create_data_firehose(af_event, data_stream)
  File "/Users/dfdf/Documents/GitHub/cdk-repo/stacks/flow_ingestion.py", line 121, in create_data_firehose
    firehose_stream = DeliveryStream(
  File "/Users/dfdf/Documents/GitHub/cdk-repo/.venv/lib/python3.9/site-packages/jsii/_runtime.py", line 118, in __call__
    inst = super(JSIIMeta, cast(JSIIMeta, cls)).__call__(*args, **kwargs)
  File "/Users/dfdf/Documents/GitHub/cdk-repo/.venv/lib/python3.9/site-packages/aws_cdk/aws_kinesisfirehose/__init__.py", line 12115, in __init__
    jsii.create(self.__class__, self, [scope, id, props])
  File "/Users/dfdf/Documents/GitHub/cdk-repo/.venv/lib/python3.9/site-packages/jsii/_kernel/__init__.py", line 334, in create
    response = self.provider.create(
  File "/Users/dfdf/Documents/GitHub/cdk-repo/.venv/lib/python3.9/site-packages/jsii/_kernel/providers/process.py", line 365, in create
    return self._process.send(request, CreateResponse)
  File "/Users/dfdf/Documents/GitHub/cdk-repo/.venv/lib/python3.9/site-packages/jsii/_kernel/providers/process.py", line 342, in send
    raise RuntimeError(resp.error) from JavaScriptError(resp.stack)
RuntimeError: props.source?._bind is not a function
Subprocess exited with error 1

Reproduction Steps

The DeliveryStream is not working with any kind of "Stream" construct from aws_cdk.aws_kinesis library. More details in the description.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.178.1

Framework Version

No response

Node.js Version

v22.7.0

OS

MacOs 15.2

Language

Python

Language Version

Python (3.9.19)

Other information

No response

@dfdf dfdf added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Feb 12, 2025
@github-actions github-actions bot added potential-regression Marking this issue as a potential regression to be checked by team member @aws-cdk/aws-kinesisfirehose Related to Amazon Kinesis Data Firehose labels Feb 12, 2025
@pahud pahud self-assigned this Feb 12, 2025
@pahud
Copy link
Contributor

pahud commented Feb 12, 2025

Hi

In 2.131.0 https://github.com/aws/aws-cdk/tree/v2.131.0/packages/aws-cdk-lib/aws-kinesisfirehose
aws-kinesisfirehose did not have any L2 and was still in alpha, which was subject to breaking changes.

It went to stable last week #33296 and there might be some API changes.
Check the latest README here for more details - https://github.com/aws/aws-cdk/tree/main/packages/aws-cdk-lib/aws-kinesisfirehose

@pahud pahud added p3 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Feb 12, 2025
@pahud pahud removed their assignment Feb 12, 2025
@dfdf
Copy link
Author

dfdf commented Feb 12, 2025

Thank you for your reply @pahud , the README that you sent helped me find the problem.

I had to change the source parameter to add the KinesisStreamSource object and not the Stream object:

firehose_stream = DeliveryStream(
            self,
            id=firehose_id,
            delivery_stream_name=firehose_id,
            source=KinesisStreamSource(test),
            destination=s3_destination,
        )

This is working as expected now.
Thank you again!

@dfdf dfdf closed this as completed Feb 12, 2025
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-kinesisfirehose Related to Amazon Kinesis Data Firehose bug This issue is a bug. p3 potential-regression Marking this issue as a potential regression to be checked by team member response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants