Skip to content

migrate: DynamoUatStack could not be generated because WarmThroughput is not a valid property for resource DynamoDBTableAPI of type AWS::DynamoDB::Table #525

Open
@JaredAAT

Description

@JaredAAT

Describe the bug

The property in question is in the CF documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-dynamodb-table.html and in the L1 construct https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_dynamodb.Table.html. However, it looks like you depend on a library cdklabs/cdk-from-cfn which does not have the property in its https://github.com/cdklabs/cdk-from-cfn/blob/main/src/specification/cdk-resources.json file.

Regression Issue

  • Select this option if this issue appears to be a regression.

Last Known Working CDK Library Version

No response

Expected Behavior

Migration occurs

Current Behavior

npx cdk migrate --from-stack --stack-name 'Dynamo-uat' --profile uat-admin

This command is an experimental feature.
 ❌  Migrate failed for `Dynamo-uat`: DynamoUatStack could not be generated because WarmThroughput is not a valid property for resource DynamoDBTableAPI of type AWS::DynamoDB::Table
DynamoUatStack could not be generated because WarmThroughput is not a valid property for resource DynamoDBTableAPI of type AWS::DynamoDB::Table

Reproduction Steps

Using an example YAML file of:

AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS CloudFormation Sample Template
  DynamoDB.template: Sample template showing how to create a
  DynamoDB Table'
Resources:
  myDynamoDBTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: 'Album'
          AttributeType: 'S'
        - AttributeName: 'Artist'
          AttributeType: 'S'
        - AttributeName: 'Sales'
          AttributeType: 'N'
        - AttributeName: 'NumberOfSongs'
          AttributeType: 'N'
      KeySchema:
        - AttributeName: 'Album'
          KeyType: 'HASH'
        - AttributeName: 'Artist'
          KeyType: 'RANGE'
      ProvisionedThroughput:
        ReadCapacityUnits: '5'
        WriteCapacityUnits: '5'
      TableName: 'myTableName'
      GlobalSecondaryIndexes:
        - IndexName: 'myGSI'
          KeySchema:
            - AttributeName: 'Sales'
              KeyType: 'HASH'
            - AttributeName: 'Artist'
              KeyType: 'RANGE'
          Projection:
            NonKeyAttributes:
              - 'Album'
              - 'NumberOfSongs'
            ProjectionType: 'INCLUDE'
          ProvisionedThroughput:
            ReadCapacityUnits: '5'
            WriteCapacityUnits: '5'
        - IndexName: 'myGSI2'
          KeySchema:
            - AttributeName: 'NumberOfSongs'
              KeyType: 'HASH'
            - AttributeName: 'Sales'
              KeyType: 'RANGE'
          Projection:
            NonKeyAttributes:
              - 'Album'
              - 'Artist'
            ProjectionType: 'INCLUDE'
          ProvisionedThroughput:
            ReadCapacityUnits: '5'
            WriteCapacityUnits: '5'
      LocalSecondaryIndexes:
        - IndexName: 'myLSI'
          KeySchema:
            - AttributeName: 'Album'
              KeyType: 'HASH'
            - AttributeName: 'Sales'
              KeyType: 'RANGE'
          Projection:
            NonKeyAttributes:
              - 'Artist'
              - 'NumberOfSongs'
            ProjectionType: 'INCLUDE'
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain

Followed by the command: cdk migrate --stack-name CDK-Local-Template-Migrate-Demo --language typescript --from-path ./test.yaml will generate a migration.

Changing the YAML to include WarmThroughput:

AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS CloudFormation Sample Template
  DynamoDB.template: Sample template showing how to create a
  DynamoDB Table'
Resources:
  myDynamoDBTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: 'Album'
          AttributeType: 'S'
        - AttributeName: 'Artist'
          AttributeType: 'S'
        - AttributeName: 'Sales'
          AttributeType: 'N'
        - AttributeName: 'NumberOfSongs'
          AttributeType: 'N'
      KeySchema:
        - AttributeName: 'Album'
          KeyType: 'HASH'
        - AttributeName: 'Artist'
          KeyType: 'RANGE'
      ProvisionedThroughput:
        ReadCapacityUnits: '5'
        WriteCapacityUnits: '5'
      TableName: 'myTableName'
      WarmThroughput:
        ReadUnitsPerSecond: 12000
        WriteUnitsPerSecond: 4000
      GlobalSecondaryIndexes:
        - IndexName: 'myGSI'
          KeySchema:
            - AttributeName: 'Sales'
              KeyType: 'HASH'
            - AttributeName: 'Artist'
              KeyType: 'RANGE'
          Projection:
            NonKeyAttributes:
              - 'Album'
              - 'NumberOfSongs'
            ProjectionType: 'INCLUDE'
          ProvisionedThroughput:
            ReadCapacityUnits: '5'
            WriteCapacityUnits: '5'
        - IndexName: 'myGSI2'
          KeySchema:
            - AttributeName: 'NumberOfSongs'
              KeyType: 'HASH'
            - AttributeName: 'Sales'
              KeyType: 'RANGE'
          Projection:
            NonKeyAttributes:
              - 'Album'
              - 'Artist'
            ProjectionType: 'INCLUDE'
          ProvisionedThroughput:
            ReadCapacityUnits: '5'
            WriteCapacityUnits: '5'
      LocalSecondaryIndexes:
        - IndexName: 'myLSI'
          KeySchema:
            - AttributeName: 'Album'
              KeyType: 'HASH'
            - AttributeName: 'Sales'
              KeyType: 'RANGE'
          Projection:
            NonKeyAttributes:
              - 'Artist'
              - 'NumberOfSongs'
            ProjectionType: 'INCLUDE'
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain

Followed by the same command: cdk migrate --stack-name CDK-Local-Template-Migrate-Demo --language typescript --from-path ./test.yaml

Leads to the error:

This command is an experimental feature.
 ❌  Migrate failed for `CDK-Local-Template-Migrate-Demo`: CdkLocalTemplateMigrateDemoStack could not be generated because WarmThroughput is not a valid property for resource myDynamoDBTable of type AWS::DynamoDB::Table
CdkLocalTemplateMigrateDemoStack could not be generated because WarmThroughput is not a valid property for resource myDynamoDBTable of type AWS::DynamoDB::Table

Possible Solution

No response

Additional Information/Context

No response

AWS CDK Library version (aws-cdk-lib)

2.196.0

AWS CDK CLI version

2.1016.1

Node.js Version

20.18.3

OS

OS X 15.4

Language

TypeScript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions