aws / aws/aws-cdk-cli

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

Open
#525 4 comments 1 reaction 0 assignees View on GitHub
bug effort/medium p1
Dominant language
TypeScript
Stars
105
Forks
122
Avg merge
1d 17h
Merged PRs (30d)
71

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.