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-lambda-event-sources): kafka event source unsupported properties #17934

Closed
BrianHaak opened this issue Dec 9, 2021 · 2 comments · Fixed by #17965
Closed

(aws-lambda-event-sources): kafka event source unsupported properties #17934

BrianHaak opened this issue Dec 9, 2021 · 2 comments · Fixed by #17965
Labels
@aws-cdk/aws-lambda-event-sources bug This issue is a bug. effort/small Small work item – less than a day of effort p2

Comments

@BrianHaak
Copy link

General Issue

Kafka event source properties includes unsupported properties

The Question

The SelfManagedKafkaEventSourceProps interface includes properties such as: bisectBatchOnError, retryAttempts, maxBatchingWindow, onFailure, maxRecordAge, and parallelizationFactor however, per API docs (ref), these properties are only supported by Kinesis and Dynamo Stream event sources.
This causes confusion during deployment as it appears these features are available, but the deploy fails.

CDK CLI Version

1.134.0 (build dd5e12d)

Framework Version

1.134.0

Node.js Version

v14.18.2

OS

Debian

Language

Typescript

Language Version

No response

Other information

Attempting to deploy returns an error:
9:25:56 PM | CREATE_FAILED | AWS::Lambda::EventSourceMapping | test...B0194DF1 Resource handler returned message: "Invalid request provided: Unsupported 'maximumRetryAttempts' parameter for given event source mapping type. (Service: Lambda, Status Code: 400, Request ID: 2f6..., Ext ended Request ID: null)" (RequestToken: 324..., HandlerErrorCode: InvalidRequest)

@BrianHaak BrianHaak added guidance Question that needs advice or information. needs-triage This issue or PR still needs to be triaged. labels Dec 9, 2021
@peterwoodworth peterwoodworth added bug This issue is a bug. p2 effort/small Small work item – less than a day of effort and removed needs-triage This issue or PR still needs to be triaged. labels Dec 9, 2021
@peterwoodworth
Copy link
Contributor

Thanks for the report @BrianHaak,

This is because under the hood, KafkaEventSourceProps extends StreamEventSourceProps

export interface KafkaEventSourceProps extends StreamEventSourceProps {

None of the other non-dynamodb/kineses EventSourceProps extend StreamEventSourceProps, this is isolated to kafka

@peterwoodworth peterwoodworth removed the guidance Question that needs advice or information. label Dec 9, 2021
@kaizencc kaizencc removed their assignment Dec 13, 2021
@mergify mergify bot closed this as completed in #17965 Jan 7, 2022
mergify bot pushed a commit that referenced this issue Jan 7, 2022
…KafkaEventSource and ManagedKafkaEventSource (#17965)

This PR fixes a bug in the CDK where some `kafkaEventSource` properties are actually unsupported. These properties exist only for kinesis and dynamodb streams. The existing KafkaEventSourceProps Interface erroneously extends an interface that includes kinesis and dynamodb specific properties. This PR separates these properties into a `Base` interface with shared stream properties for all 3, as well as an interface for `kinesis` and `dynamodb` specific properties. 

Unit testing unavailable because the scope of the PR is to remove properties. It is enough to ensure that current tests still succeed.

We are allowing the breaking changes specified in  `allowed-breaking-changes.txt` because they never worked in the first place.

Fixes #17934.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Jan 7, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
…KafkaEventSource and ManagedKafkaEventSource (aws#17965)

This PR fixes a bug in the CDK where some `kafkaEventSource` properties are actually unsupported. These properties exist only for kinesis and dynamodb streams. The existing KafkaEventSourceProps Interface erroneously extends an interface that includes kinesis and dynamodb specific properties. This PR separates these properties into a `Base` interface with shared stream properties for all 3, as well as an interface for `kinesis` and `dynamodb` specific properties. 

Unit testing unavailable because the scope of the PR is to remove properties. It is enough to ensure that current tests still succeed.

We are allowing the breaking changes specified in  `allowed-breaking-changes.txt` because they never worked in the first place.

Fixes aws#17934.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-event-sources bug This issue is a bug. effort/small Small work item – less than a day of effort p2
Projects
None yet
3 participants