{"id":44346,"library":"aws-cdk-aws-msk-alpha","title":"AWS CDK Amazon MSK Alpha Construct Library","description":"The CDK Construct Library for AWS::MSK provides resource definitions for Amazon Managed Streaming for Apache Kafka (MSK). Currently at version 2.258.0a0, it is part of the AWS CDK Alpha module set, which may undergo breaking changes without notice. Requires Python >=3.10.","status":"active","version":"2.258.0a0","language":"python","source_language":"en","source_url":"https://github.com/aws/aws-cdk/tree/main/packages/%40aws-cdk%2Faws-msk-alpha","tags":["cdk","aws","msk","kafka","infrastructure"],"install":[{"cmd":"pip install aws-cdk-aws-msk-alpha","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core CDK library; must be compatible version (2.x).","package":"aws-cdk-lib","optional":false},{"reason":"Required base class for all CDK constructs.","package":"constructs","optional":false}],"imports":[{"note":"Cluster exists in both stable and alpha; use alpha for latest features.","wrong":"from aws_cdk.aws_msk import Cluster","symbol":"Cluster","correct":"from aws_cdk.aws_msk_alpha import Cluster"},{"note":"","wrong":"","symbol":"KafkaVersion","correct":"from aws_cdk.aws_msk_alpha import KafkaVersion"},{"note":"","wrong":"","symbol":"BrokerLogging","correct":"from aws_cdk.aws_msk_alpha import BrokerLogging"}],"quickstart":{"code":"from aws_cdk import App, Stack\nfrom aws_cdk.aws_msk_alpha import Cluster, KafkaVersion\nfrom aws_cdk.aws_ec2 import Vpc, SubnetSelection, SubnetType\n\napp = App()\nstack = Stack(app, \"MskStack\", env={\"region\": \"us-east-1\"})\nvpc = Vpc(stack, \"MyVpc\", max_azs=2)\n\ncluster = Cluster(\n    stack, \"MyCluster\",\n    cluster_name=\"my-cluster\",\n    kafka_version=KafkaVersion.V2_8_1,\n    number_of_broker_nodes=2,\n    vpc=vpc,\n    vpc_subnets=SubnetSelection(subnet_type=SubnetType.PRIVATE_WITH_EGRESS),\n)\n\napp.synth()","lang":"python","description":"Creates a basic MSK cluster in a VPC with two broker nodes."},"warnings":[{"fix":"Use `aws-cdk-aws-msk-alpha==2.258.0a0` in requirements.txt.","message":"Alpha modules break compatibility without notice. Pin exact version in requirements.","severity":"deprecated","affected_versions":"all"},{"fix":"Check the reference docs at https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_msk_alpha.html.","message":"Some properties may be renamed or removed in future alpha releases. Always reference the latest CDK API reference.","severity":"breaking","affected_versions":"all"},{"fix":"Set `encryption_in_transit=EncryptionInTransitConfig(client_broker=ClientBrokerEncryption.TLS)` and `iam_auth=True`.","message":"IAM authentication requires enabling `iam_auth` and setting `encryption_in_transit.client_broker` to `ClientBrokerEncryption.TLS` with plaintext disabled.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.258.0':29 '3.10':50 'a0':30 'alpha':5,38 'amazon':3,19 'apach':23 'aw':1,13,36,52 'break':44 'cdk':2,9,37,51 'chang':45 'construct':6,10 'current':26 'definit':17 'infrastructur':55 'kafka':24,54 'librari':7,11 'manag':20 'may':42 'modul':39 'msk':4,14,25,53 'notic':47 'part':33 'provid':15 'python':49 'requir':48 'resourc':16 'set':40 'stream':21 'undergo':43 'version':28 'without':46","created_at":"2026-06-07T12:49:41.364032+00:00","updated_at":"2026-06-07T12:49:41.364032+00:00","problems":[{"fix":"Run `pip install aws-cdk-aws-msk-alpha` and ensure Python >=3.10.","cause":"Package not installed or wrong Python version.","error":"ModuleNotFoundError: No module named 'aws_cdk.aws_msk_alpha'"},{"fix":"This is a known SDK limitation; ensure you are using the latest CDK CLI and installed the package correctly.","cause":"Attempting to use alpha constructs without accepting the CDK Alpha module's stability disclaimer.","error":"jsii.errors.JSIIError: Cannot use AWS MSK Alpha resources without subscribing to the AWS CDK Alpha module"},{"fix":"Update the package: `pip install --upgrade aws-cdk-aws-msk-alpha` and adjust code to current API.","cause":"Using an outdated version of the library where the API was different.","error":"aws_cdk.aws_msk_alpha.Cluster does not accept 'kafka_version' argument"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/aws/aws-cdk","github":"https://github.com/aws/aws-cdk.git","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}