{"id":26752,"library":"aws-cdk-aws-dynamodb","title":"AWS CDK DynamoDB Construct Library","description":"The CDK Construct Library for AWS::DynamoDB provides high-level constructs for defining Amazon DynamoDB tables in AWS CDK applications. Version 1.204.0 is part of the AWS CDK v1 (maintenance mode). Releases follow the CDK release cadence. Note: v1 is in maintenance; prefer CDK v2.","status":"maintenance","version":"1.204.0","language":"python","source_language":"en","source_url":"https://github.com/aws/aws-cdk","tags":["aws","cdk","dynamodb","infrastructure-as-code"],"install":[{"cmd":"pip install aws-cdk-aws-dynamodb==1.204.0","lang":"bash","label":"Install specific version"}],"dependencies":[{"reason":"Core CDK library, but v1 uses separate packages. For v1, you need aws-cdk.core and aws-cdk.aws-dynamodb.","package":"aws-cdk-lib","optional":false}],"imports":[{"note":"TableProps is a different construct; Table is the main resource.","wrong":"from aws_cdk.aws_dynamodb import TableProps","symbol":"Table","correct":"from aws_cdk.aws_dynamodb import Table"}],"quickstart":{"code":"import aws_cdk as cdk\nfrom aws_cdk.aws_dynamodb import Table, Attribute, AttributeType, BillingMode\n\nclass MyStack(cdk.Stack):\n    def __init__(self, scope: cdk.App, id: str, **kwargs):\n        super().__init__(scope, id, **kwargs)\n        Table(self, 'MyTable',\n              partition_key=Attribute(name='id', type=AttributeType.STRING),\n              billing_mode=BillingMode.PAY_PER_REQUEST)\n\napp = cdk.App()\nMyStack(app, 'MyStack')\napp.synth()","lang":"python","description":"Creates a DynamoDB table with a simple partition key and on-demand billing."},"warnings":[{"fix":"Upgrade to aws-cdk-lib (v2) by changing imports: from aws_cdk.aws_dynamodb import ... (works in both v1 and v2 but v2 requires aws-cdk-lib).","message":"CDK v1 entered maintenance on June 1, 2022, and will end support on June 1, 2023. New features and updates are not released. Migrate to CDK v2.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use from aws_cdk.aws_dynamodb import ... after installing aws-cdk-lib.","message":"In CDK v2, this library is included in aws-cdk-lib. Installing aws-cdk-aws-dynamodb separately is not supported and may cause conflicts.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Explicitly set billing_mode to BillingMode.PAY_PER_REQUEST to avoid unexpected charges.","message":"If you set point_in_time_recovery to True without specifying a billing mode, the table defaults to PROVISIONED with a default read/write capacity (5 each), which may incur costs.","severity":"gotcha","affected_versions":"*"},{"fix":"Use time_to_live_attribute='timetolive' when defining the table.","message":"The attribute 'ttlAttribute' has been deprecated. Use 'time_to_live_attribute' instead.","severity":"deprecated","affected_versions":">=1.90.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"For CDK v1: pip install aws-cdk-aws-dynamodb. For CDK v2: pip install aws-cdk-lib.","cause":"Missing package installation or using CDK v2 without aws-cdk-lib installed.","error":"ModuleNotFoundError: No module named 'aws_cdk.aws_dynamodb'"},{"fix":"Install core: pip install aws-cdk.core (or for v2, install aws-cdk-lib).","cause":"Required dependency aws-cdk.core not installed.","error":"jsii.errors.JSIIError: Cannot use \"aws-cdk-aws-dynamodb\" module without \"aws-cdk\" module"},{"fix":"Ensure each table has a unique logical ID (e.g., by using different construct IDs).","cause":"Two table constructs with the same logical ID in the same stack.","error":"jsii.errors.JSIIError: Resource of type 'AWS::DynamoDB::Table' already exists in stack"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}