{"id":7955,"library":"aws-cdk-core","title":"AWS Cloud Development Kit Core Library (v1 - Deprecated)","description":"The `aws-cdk-core` package is the foundational library for AWS Cloud Development Kit (CDK) v1. AWS CDK is an open-source software development framework for defining cloud infrastructure as code using familiar programming languages (like Python, TypeScript, Java, C#, Go). It synthesizes infrastructure definitions into AWS CloudFormation templates for deployment. Version 1 of AWS CDK officially reached end-of-support on June 1, 2023, and this package is no longer maintained or updated.","status":"deprecated","version":"1.204.0","language":"en","source_language":"en","source_url":"https://github.com/aws/aws-cdk.git","tags":["aws","cdk","infrastructure-as-code","iac","cloudformation","deprecated","v1"],"install":[{"cmd":"pip install aws-cdk-core==1.204.0","lang":"bash","label":"Install specific v1 version"},{"cmd":"npm install -g aws-cdk@1","lang":"bash","label":"Install AWS CDK Toolkit (CLI) for v1"}],"dependencies":[{"reason":"The AWS CDK Toolkit (CLI) is built on Node.js and is essential for synthesizing and deploying CDK applications.","package":"Node.js","optional":false}],"imports":[{"symbol":"App","correct":"from aws_cdk import core"},{"symbol":"Stack","correct":"from aws_cdk import core"},{"note":"The `aws-cdk-lib` package and its submodules are for AWS CDK v2. In CDK v1, service constructs were imported from separate `aws_cdk.aws_*` packages.","wrong":"from aws_cdk_lib.aws_s3 import Bucket","symbol":"Bucket","correct":"from aws_cdk.aws_s3 import Bucket"}],"quickstart":{"code":"# 1. Initialize a new CDK project (requires Node.js and 'aws-cdk' CLI installed)\n# mkdir my-cdk-app\n# cd my-cdk-app\n# cdk init app --language python\n\n# 2. Install dependencies\n# pip install -r requirements.txt\n\n# 3. Define a simple stack (in my_cdk_app/my_cdk_app_stack.py)\nfrom aws_cdk import core as cdk\nfrom aws_cdk import aws_s3 as s3\n\nclass MyCdkAppStack(cdk.Stack):\n    def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None:\n        super().__init__(scope, construct_id, **kwargs)\n\n        s3.Bucket(self, \"MyFirstBucket\",\n                  versioned=True,\n                  bucket_name=f\"my-first-cdk-bucket-{cdk.Aws.ACCOUNT_ID}\")\n\n# 4. Instantiate the app and stack (in app.py)\nimport os\n\napp = cdk.App()\nMyCdkAppStack(app, \"MyCdkAppStack\",\n              env=cdk.Environment(\n                  account=os.environ.get('CDK_DEFAULT_ACCOUNT', ''),\n                  region=os.environ.get('CDK_DEFAULT_REGION', 'us-east-1'))\n             )\napp.synth() # Generates CloudFormation template\n\n# 5. Deploy (from terminal)\n# cdk bootstrap  # First-time setup per AWS account/region\n# cdk deploy MyCdkAppStack","lang":"python","description":"This quickstart demonstrates how to create a basic AWS CDK v1 application in Python, define an S3 bucket, and synthesize it into a CloudFormation template. It assumes the AWS CDK CLI (Node.js based) is already installed globally. Replace `CDK_DEFAULT_ACCOUNT` and `CDK_DEFAULT_REGION` with your AWS account ID and desired region, respectively. The `cdk bootstrap` command is typically a one-time setup per AWS account and region to provision resources required by the CDK."},"warnings":[{"fix":"Migrate your applications to AWS CDK v2 as soon as possible. AWS provides a detailed migration guide.","message":"AWS CDK v1, including `aws-cdk-core`, reached its official end-of-support on June 1, 2023. This means it no longer receives maintenance, updates, security patches, or technical support. Continued use can expose applications to security vulnerabilities and unaddressed bugs.","severity":"breaking","affected_versions":"All 1.x versions"},{"fix":"Update `requirements.txt` to `aws-cdk-lib` and `constructs`. Adjust import statements (e.g., `from aws_cdk import App, Stack` instead of `from aws_cdk import core`). Run `cdk bootstrap` with a v2-compatible CLI. Review the official AWS CDK v2 migration guide.","message":"Migrating from AWS CDK v1 (`aws-cdk-core`) to v2 (`aws-cdk-lib`) involves significant breaking changes. These include a consolidated single package (`aws-cdk-lib`) for stable constructs, changes in import statements, and a requirement to re-bootstrap AWS accounts with the modern bootstrap stack.","severity":"breaking","affected_versions":"All 1.x to 2.x migration"},{"fix":"Always use a supported Python version. For CDK v2, ensure Python 3.9+ is installed. It is also critical to ensure the global `aws-cdk` CLI version is compatible with your project's CDK library version, ideally keeping them in sync.","message":"The Python version specified in `pyproject.toml` or `requirements.txt` (`~=3.7` for `aws-cdk-core`) for the CDK library itself might be different from the Python version required by the global AWS CDK CLI for optimal compatibility or newer features. For AWS CDK v2, Python 3.9 or later is required.","severity":"gotcha","affected_versions":"All 1.x versions, especially when using a newer CLI"},{"fix":"Leverage IDEs with good type validation support and consult CDK API documentation for expected parameter types. Implement unit tests for your constructs.","message":"Due to Python's dynamic typing, it's easy to pass an incorrect type of value to an AWS CDK construct, which can lead to runtime errors when the JSII layer (which translates between Python and the CDK's TypeScript core) fails.","severity":"gotcha","affected_versions":"All 1.x versions"},{"fix":"Modularize your infrastructure into smaller, interconnected stacks. Use higher-level constructs (L2/L3 patterns) which abstract multiple underlying CloudFormation resources.","message":"Complex CDK applications can quickly hit AWS CloudFormation resource limits (e.g., maximum number of resources in a stack), leading to synthesis errors.","severity":"gotcha","affected_versions":"All 1.x versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the IAM role performing the `cdk deploy` command has sufficient permissions. Check the CloudFormation Events tab in the AWS Console for specific permission errors. Follow the principle of least privilege.","cause":"The IAM role used by the CDK deployment or the CloudFormation execution role lacks necessary permissions for the resources being deployed.","error":"Deployment failure due to missing permissions"},{"fix":"Run `cdk context --reset` or `cdk synth` / `cdk deploy` again to refresh the context values in `cdk.context.json`. Ensure your AWS CLI is configured with correct credentials and region.","cause":"CDK cannot retrieve specific environment information (e.g., existing VPC IDs) which are often fetched from your AWS account during `cdk synth`.","error":"Context value not found for lookup (e.g., VPC, availability zones)"},{"fix":"Restructure your stacks to break circular dependencies. Use `cdk.Fn.importValue` or AWS SSM Parameter Store for cross-stack references where direct dependencies are problematic.","cause":"Your CDK stacks have circular dependencies, meaning Stack A depends on Stack B, and Stack B simultaneously depends on Stack A.","error":"Cyclic dependencies are not allowed"},{"fix":"Ensure you are running `cdk` commands from the root directory of your CDK project, or explicitly specify the app entry point using `cdk synth --app 'python app.py'` (or similar for other languages).","cause":"The CDK CLI cannot locate your application's entry point, typically `app.py` for Python projects.","error":"--app is required either in command-line in cdk.json or in ~/.cdk.json"}]}