{"id":23303,"library":"aws-cdk-aws-bedrock-alpha","title":"AWS CDK Bedrock Alpha Construct Library","description":"Alpha version of the AWS CDK construct library for Amazon Bedrock, enabling generative AI application deployment (foundation models, agents, knowledge bases). Current version 2.252.0a0, updated frequently with CDK releases, pre-GA so breaking changes are common.","status":"active","version":"2.252.0a0","language":"python","source_language":"en","source_url":"https://github.com/aws/aws-cdk","tags":["aws","bedrock","cdk","generative-ai","alpha"],"install":[{"cmd":"pip install aws-cdk-aws-bedrock-alpha","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Required for CDK core constructs and infrastructure","package":"aws-cdk-lib","optional":false},{"reason":"Required for construct base class","package":"constructs","optional":false}],"imports":[{"note":"The alpha module uses aws_bedrock_alpha, not aws_bedrock. aws_bedrock exists but is a different (stable) module.","wrong":"from aws_cdk.aws_bedrock import Bedrock","symbol":"Bedrock","correct":"from aws_cdk.aws_bedrock_alpha import Bedrock"},{"note":"FoundationModel is only available in the alpha module.","wrong":"from aws_cdk.aws_bedrock import FoundationModel","symbol":"FoundationModel","correct":"from aws_cdk.aws_bedrock_alpha import FoundationModel"},{"note":"Agent construct is only in the alpha module.","wrong":null,"symbol":"Agent","correct":"from aws_cdk.aws_bedrock_alpha import Agent"}],"quickstart":{"code":"from aws_cdk import App, Stack\nfrom aws_cdk.aws_bedrock_alpha import FoundationModel, Bedrock\n\napp = App()\nstack = Stack(app, \"BedrockStack\")\n\n# Use a foundation model (requires Bedrock access in region)\nmodel = FoundationModel.from_foundation_model_id(\n    stack, \"Model\",\n    foundation_model_id=\"anthropic.claude-v2\"\n)\n\n# Create a Bedrock agent\nagent = Agent(\n    stack, \"MyAgent\",\n    foundation_model=model,\n    instruction=\"You are a helpful assistant.\"\n)\n\napp.synth()","lang":"python","description":"Minimal stack creating a Bedrock agent with a foundation model."},"warnings":[{"fix":"Use `aws-cdk-aws-bedrock-alpha==2.252.0a0` in requirements.txt.","message":"Alpha module API is unstable — methods and properties may change without notice in new versions. Pin to a specific version in production.","severity":"breaking","affected_versions":"all alpha versions (2.x.a0)"},{"fix":"Check CDK changelog for deprecation notices and migrate to suggested method.","message":"FromFoundationModelId may be deprecated in favor of new model selection patterns in future releases.","severity":"deprecated","affected_versions":"2.240.0a0 - 2.252.0a0"},{"fix":"Request model access via AWS console or CLI before deploying.","message":"You must have Bedrock model access enabled in your AWS account for the chosen region. CDK deployment will succeed but runtime calls will fail.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install aws-cdk-aws-bedrock-alpha` and ensure import is `from aws_cdk.aws_bedrock_alpha import ...`","cause":"Missing alpha module installation or incorrect import path.","error":"ModuleNotFoundError: No module named 'aws_cdk.aws_bedrock_alpha'"},{"fix":"Change import to `from aws_cdk.aws_bedrock_alpha import FoundationModel`","cause":"Importing from the stable aws_bedrock module instead of the alpha module.","error":"AttributeError: module 'aws_cdk.aws_bedrock' has no attribute 'FoundationModel'"},{"fix":"Ensure you pass all required constructor props (e.g., foundation_model, instruction) and CDK version ≥ 2.100.0a0.","cause":"Attempting to instantiate Agent without required properties or using outdated CDK version.","error":"jsii.errors.JSIIError: Cannot instantiate abstract class 'Agent'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}