Skip to content

Conversation

@evzzk
Copy link
Contributor

@evzzk evzzk commented Jun 20, 2025

Issue # (if applicable)

Closes #34778.

Reason for this change

The AWS Lambda service recently added support for Schema Registry integration with Kafka event sources. This feature allows customers to use a schema registry (Confluent or Glue) to deserialize events from Kafka topics. While the CDK code support for this feature has been implemented, the documentation was incomplete, making it difficult for users to discover and properly configure this feature.

Description of changes

  • Enhanced the Schema Registry documentation section in aws-lambda-event-sources README
  • Added a comprehensive explanation of the feature and its requirements
  • Added a note about IAM authentication requirements for MSK clusters
  • Added detailed examples for both ManagedKafkaEventSource and SelfManagedKafkaEventSource
  • Added information about required fields and automatic IAM permission generation
  • Added a complete example that shows how to set up IAM permissions properly

Describe any new or updated permissions being added

No new permissions are being added in this PR. The documentation describes the existing permissions that are automatically generated when using Glue Schema Registry with Lambda.

Description of how you validated changes

  • Verified that the documentation accurately reflects the current implementation
  • Ensured the examples are consistent with the code implementation in schema-registry.ts
  • Manually reviewed the updated documentation to ensure it matches the feature's behavior

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the valued-contributor [Pilot] contributed between 6-12 PRs to the CDK label Jun 20, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team June 20, 2025 20:50
@github-actions github-actions bot added the p2 label Jun 20, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jun 24, 2025
@ozelalisen ozelalisen self-assigned this Jun 30, 2025
@ozelalisen
Copy link
Member

Build is failed due to JSII error, could you fix this:
@example must be code only, no code block fences allowed.

Copy link
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build is in failure mode

import { CfnRegistry } from 'aws-cdk-lib/aws-glue';
import * as iam from 'aws-cdk-lib/aws-iam';

export class MskGlueSchemaRegistryStack extends Stack {
Copy link
Contributor

@mrgrain mrgrain Jul 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an usual pattern for readme examples. Consider if Stack and App are needed here and if they are adding anything to the examples. Typically that's only the case if you want to show interaction between multiple stacks.

Rosetta is failing because the example is inlined into this fixture: https://github.com/aws/aws-cdk/blob/c8d61c9929ef461ccafab2a6e90f11ce635c5750/packages/aws-cdk-lib/rosetta/aws_lambda_event_sources/default.ts-fixture

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, if you decide that a full example is the right way to go about this, you can add a new fixture into this directory that doesn't wrap the code inside a stack.

Then specify the fixture you want to use like this:

```ts fixture=some-fixture
new Stack();
```

See https://github.com/aws/jsii-rosetta?tab=readme-ov-file#fixtures

I'd still recommend that this new fixture contains as much of the setup as possible, e.g. like the imports of Stack and App.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally you may use nofixture, but that's really a last resort.

```ts nofixture
new Stack();
```

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 1bd28ad
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution/core This is a PR that came from AWS. p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(lambda-event-sources): Add documentation for Schema Registry integration with Kafka event sources

5 participants