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 source mapping, unnecessary validation of input) #22932

Closed
nikovirtala opened this issue Nov 16, 2022 · 2 comments · Fixed by #22993
Closed

(aws-lambda): (event source mapping, unnecessary validation of input) #22932

nikovirtala opened this issue Nov 16, 2022 · 2 comments · Fixed by #22993
Assignees
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug. effort/small Small work item – less than a day of effort p1

Comments

@nikovirtala
Copy link
Contributor

Describe the bug

SelfManagedKafkaEventSource tries to validate the input value of consumerGroupId which is generally good behavior, but if the user wants to pass a value that gets resolved while synth, it is not possible.

Expected Behavior

SelfManagedKafkaEventSource should not validate consumerGroupId value, if the value is unresolved Token.

Current Behavior

While synthesizing the code CDK throws an error: Error: kafkaConsumerGroupId contain ivalid characters. Allowed values are "[a-zA-Z0-9-/*:_+=.@-]"

Reproduction Steps

  • Create Lambda Function, e.g. with NodejsFunction
  • Use .addEventSource method to add the new SelfManagedKafkaEventSource
  • For SelfManagedKafkaEventSource give consumerGroupId that is a unresolved Token, e.g. Lambda Function, .functionName

Possible Solution

@RomainMuller suggested disabling the validation for unresolved tokens.

Additional Information/Context

No response

CDK CLI Version

2.50.0 (build 4c11af6)

Framework Version

No response

Node.js Version

v16.18.1

OS

macOS 13.1 Beta (22C5044e)

Language

Typescript

Language Version

No response

Other information

No response

@nikovirtala nikovirtala added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 16, 2022
@github-actions github-actions bot added the @aws-cdk/aws-lambda Related to AWS Lambda label Nov 16, 2022
@peterwoodworth peterwoodworth added p1 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 Nov 26, 2022
@peterwoodworth
Copy link
Contributor

Thanks for reporting this, we've had similar bugs in the past so this makes sense. Based on your PR it looks like you got it 🙂 Hopefully it won't be too long until we're able to give a proper review for your PR

@mergify mergify bot closed this as completed in #22993 Nov 30, 2022
mergify bot pushed a commit that referenced this issue Nov 30, 2022
- fix(lambda): allow token kafka consumer group id
- fix(lambda): typo in kafka consumer group id validation

Fixes: #22932

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing 
guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*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

⚠️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.

brennanho pushed a commit to brennanho/aws-cdk that referenced this issue Dec 9, 2022
- fix(lambda): allow token kafka consumer group id
- fix(lambda): typo in kafka consumer group id validation

Fixes: aws#22932

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing 
guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
brennanho pushed a commit to brennanho/aws-cdk that referenced this issue Jan 20, 2023
- fix(lambda): allow token kafka consumer group id
- fix(lambda): typo in kafka consumer group id validation

Fixes: aws#22932

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing 
guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
brennanho pushed a commit to brennanho/aws-cdk that referenced this issue Feb 22, 2023
- fix(lambda): allow token kafka consumer group id
- fix(lambda): typo in kafka consumer group id validation

Fixes: aws#22932

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing 
guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*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 Related to AWS Lambda bug This issue is a bug. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants