Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(aws-dynamodb): TableV2 : CREATE_FAILED (An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index) #32080

Closed
1 task
MastanaGuru opened this issue Nov 10, 2024 · 4 comments
Labels
@aws-cdk/aws-dynamodb Related to Amazon DynamoDB bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p3 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@MastanaGuru
Copy link

MastanaGuru commented Nov 10, 2024

Describe the bug

When creating a TableV2 with GSI, even the ReadCapacity and WriteCapacity are specified, getting error "No provisioned throughput specified for the global secondary index"

Created the construct as show in the docs . As per the doc, also tried "If TableV2 is configured with provisioned billing but readCapacity or writeCapacity are not configured on a globalSecondaryIndex, then they will be inherited from the capacity settings specified with the billing configuration"

import * as cdk from 'aws-cdk-lib';
import {
  Billing,
  Capacity,
  TableV2
} from 'aws-cdk-lib/aws-dynamodb';
import { Construct } from 'constructs';
import { dynamoDBTables } from '../appConfig/dynamodb-config';
import { DynamoDBTableConfig, } from '../interface/dynamodb';

interface DynamoDBConstructProps {
  stackName: string;
}

export class DynamoDBConstruct extends Construct {
  public readonly tables: { [tableId: string]: TableV2 } = {};

  constructor(scope: Construct, id: string, props: DynamoDBConstructProps) {
    super(scope, id);

    const { stackName } = props;

    dynamoDBTables.forEach((tableConfig: DynamoDBTableConfig) => {
      const { tableId } = tableConfig;
      const prefixedTableName = `${stackName}-${tableConfig.tableName}`;

      let billingMode: Billing;

      if (tableConfig.billingMode === 'PROVISIONED') {
        if (!tableConfig.readCapacity || !tableConfig.writeCapacity) {
          throw new Error(
            `Read and write capacity must be specified for provisioned billing mode on table "${tableConfig.tableName}"`
          );
        }

        // Configure fixed read capacity
        const readCapacity = Capacity.fixed(tableConfig.readCapacity.fixedCapacity);

        // Configure autoscaled write capacity
        const writeCapacity = Capacity.autoscaled({
          maxCapacity: tableConfig.writeCapacity.maxCapacity,
          // minCapacity: tableConfig.writeCapacity.minCapacity || 1, // Optional
          // targetUtilizationPercent: tableConfig.writeCapacity.targetUtilization || 70, // Optional
        });

        billingMode = Billing.provisioned({
          readCapacity,
          writeCapacity,
        });
      } else {
        billingMode = Billing.onDemand();
      }

      const dynamoTable = new TableV2(this, `Table-${prefixedTableName}`, {
        tableName: prefixedTableName,
        partitionKey: {
          name: tableConfig.keySchema.partitionKey.name,
          type: tableConfig.keySchema.partitionKey.type,
        },
        sortKey: tableConfig.keySchema.sortKey
          ? {
              name: tableConfig.keySchema.sortKey.name,
              type: tableConfig.keySchema.sortKey.type,
            }
          : undefined,
        billing: billingMode,
        pointInTimeRecovery: true,
        removalPolicy: cdk.RemovalPolicy.RETAIN,
        timeToLiveAttribute: tableConfig.ttlAttribute,
      });

      // Add Global Secondary Indexes (GSIs)
      if (tableConfig.globalSecondaryIndexes) {
        tableConfig.globalSecondaryIndexes.forEach((gsi) => {
          if (tableConfig.billingMode === 'PROVISIONED') {
            if (!gsi.readCapacity || !gsi.writeCapacity) {
              throw new Error(
                `Read and write capacity must be specified for GSI "${gsi.indexName}" when using PROVISIONED billing mode`
              );
            }

            // Configure fixed read capacity for GSI
            const gsiReadCapacity = Capacity.fixed(gsi.readCapacity.fixedCapacity);

            // Configure autoscaled write capacity for GSI
            const gsiWriteCapacity = Capacity.autoscaled({
              maxCapacity: gsi.writeCapacity.maxCapacity,
              // minCapacity: gsi.writeCapacity.minCapacity || 1, // Optional
              // targetUtilizationPercent: gsi.writeCapacity.targetUtilization || 70, // Optional
            });

            const gsiConfig = {
              indexName: gsi.indexName,
              partitionKey: {
                name: gsi.keySchema.partitionKey.name,
                type: gsi.keySchema.partitionKey.type,
              },
              sortKey: gsi.keySchema.sortKey
                ? {
                    name: gsi.keySchema.sortKey.name,
                    type: gsi.keySchema.sortKey.type,
                  }
                : undefined,
              projectionType: gsi.projection.projectionType,
              nonKeyAttributes: gsi.projection.nonKeyAttributes,
              readCapacity: gsiReadCapacity,
              writeCapacity: gsiWriteCapacity,
            };
            dynamoTable.addGlobalSecondaryIndex(gsiConfig);
          }else{
            const gsiConfig = {
              indexName: gsi.indexName,
              partitionKey: {
                name: gsi.keySchema.partitionKey.name,
                type: gsi.keySchema.partitionKey.type,
              },
              sortKey: gsi.keySchema.sortKey
                ? {
                    name: gsi.keySchema.sortKey.name,
                    type: gsi.keySchema.sortKey.type,
                  }
                : undefined,
              projectionType: gsi.projection.projectionType,
              nonKeyAttributes: gsi.projection.nonKeyAttributes,
            };
            dynamoTable.addGlobalSecondaryIndex(gsiConfig);
          }
        });
      }
      // Store the table instance using the tableId as the key
      this.tables[tableId] = dynamoTable;
    });
  }
}

cdk synth template.json

  "malwareanalysissv1devDynamoDBConstructTablemalwareanalysissv1devScanResultsEAD68F9D": {
   "Type": "AWS::DynamoDB::GlobalTable",
   "Properties": {
    "AttributeDefinitions": [
     {
      "AttributeName": "objectKey",
      "AttributeType": "S"
     },
     {
      "AttributeName": "createdAt",
      "AttributeType": "N"
     },
     {
      "AttributeName": "scanStatus",
      "AttributeType": "S"
     },
     {
      "AttributeName": "submissionId",
      "AttributeType": "S"
     }
    ],
    "BillingMode": "PROVISIONED",
    "GlobalSecondaryIndexes": [
     {
      "IndexName": "scanStatus-createdAt-index",
      "KeySchema": [
       {
        "AttributeName": "scanStatus",
        "KeyType": "HASH"
       },
       {
        "AttributeName": "createdAt",
        "KeyType": "RANGE"
       }
      ],
      "Projection": {
       "ProjectionType": "ALL"
      },
      "WriteProvisionedThroughputSettings": {
       "WriteCapacityAutoScalingSettings": {
        "MaxCapacity": 5,
        "MinCapacity": 1,
        "TargetTrackingScalingPolicyConfiguration": {
         "TargetValue": 70
        }
       }
      }
     },
     {
      "IndexName": "submissionId-index",
      "KeySchema": [
       {
        "AttributeName": "submissionId",
        "KeyType": "HASH"
       }
      ],
      "Projection": {
       "ProjectionType": "ALL"
      },
      "WriteProvisionedThroughputSettings": {
       "WriteCapacityAutoScalingSettings": {
        "MaxCapacity": 5,
        "MinCapacity": 1,
        "TargetTrackingScalingPolicyConfiguration": {
         "TargetValue": 70
        }
       }
      }
     }
    ],
    "KeySchema": [
     {
      "AttributeName": "objectKey",
      "KeyType": "HASH"
     },
     {
      "AttributeName": "createdAt",
      "KeyType": "RANGE"
     }
    ],
    "Replicas": [
     {
      "GlobalSecondaryIndexes": [
       {
        "IndexName": "scanStatus-createdAt-index",
        "ReadProvisionedThroughputSettings": {
         "ReadCapacityUnits": 5
        }
       },
       {
        "IndexName": "submissionId-index",
        "ReadProvisionedThroughputSettings": {
         "ReadCapacityUnits": 5
        }
       }
      ],
      "PointInTimeRecoverySpecification": {
       "PointInTimeRecoveryEnabled": true
      },
      "ReadProvisionedThroughputSettings": {
       "ReadCapacityUnits": 5
      },
      "Region": {
       "Ref": "AWS::Region"
      }
     }
    ],
    "TableName": "malware-analysis-sv1-dev-ScanResults",
    "TimeToLiveSpecification": {
     "AttributeName": "expiryDt",
     "Enabled": true
    },
    "WriteProvisionedThroughputSettings": {
     "WriteCapacityAutoScalingSettings": {
      "MaxCapacity": 5,
      "MinCapacity": 1,
      "TargetTrackingScalingPolicyConfiguration": {
       "TargetValue": 70
      }
     }
    }
   },
   "UpdateReplacePolicy": "Retain",
   "DeletionPolicy": "Retain",
   "Metadata": {
    "aws:cdk:path": "malware-analysis-sv1-dev-InfrastructureStack/malware-analysis-sv1-dev-DynamoDBConstruct/Table-malware-analysis-sv1-dev-ScanResults/Resource"
   }
  },

Regression Issue

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

Last Known Working CDK Version

No response

Expected Behavior

As both readCapacity and writeCapacity is specified for GSI, table should be created.

Current Behavior

CDK Deploy throws error
malware-analysis-sv1-dev-InfrastructureStack/malware-analysis-sv1-dev-DynamoDBConstruct/Table-malware-analysis-sv1-dev-ScanResults (malwareanalysissv1devDynamoDBConstructTablemalwareanalysissv1devScanResultsEAD68F9D) An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index

Reproduction Steps

Create a TableV2 having billing mode as PROVISIONED w/o readCapacity and WriteCapacity in GSI.

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.166.0 (build 7bb9203)

Framework Version

No response

Node.js Version

20.14.9

OS

MAC

Language

TypeScript

Language Version

~5.6.3

Other information

No response

@MastanaGuru MastanaGuru added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 10, 2024
@github-actions github-actions bot added the @aws-cdk/aws-dynamodb Related to Amazon DynamoDB label Nov 10, 2024
@khushail khushail added the needs-reproduction This issue needs reproduction. label Nov 11, 2024
@pahud pahud self-assigned this Nov 11, 2024
@khushail khushail added p2 and removed needs-triage This issue or PR still needs to be triaged. labels Nov 11, 2024
@khushail khushail assigned khushail and pahud and unassigned pahud and khushail Nov 11, 2024
@pahud
Copy link
Contributor

pahud commented Nov 11, 2024

Hi, let me simplify the provided snippet.

I just tested the TableV2

export class DynamoDBTableStack extends Stack {
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    const table = new ddb.TableV2(this, 'MyTable', {
      partitionKey: { name: 'id', type: ddb.AttributeType.STRING },
      billing: ddb.Billing.provisioned({
        readCapacity: ddb.Capacity.fixed(5),
        writeCapacity: ddb.Capacity.autoscaled({ maxCapacity: 10 }),
      }),
      globalSecondaryIndexes: [
        {
          indexName: 'GSI',
          partitionKey: { name: 'gsiKey', type: ddb.AttributeType.STRING },
          projectionType: ddb.ProjectionType.ALL
        }
      ]
    });
  }
}

cdk synth

pahud@MBA issue-triage % npx cdk synth
Resources:
  MyTable794EDED1:
    Type: AWS::DynamoDB::GlobalTable
    Properties:
      AttributeDefinitions:
        - AttributeName: id
          AttributeType: S
        - AttributeName: gsiKey
          AttributeType: S
      BillingMode: PROVISIONED
      GlobalSecondaryIndexes:
        - IndexName: GSI
          KeySchema:
            - AttributeName: gsiKey
              KeyType: HASH
          Projection:
            ProjectionType: ALL
          WriteProvisionedThroughputSettings:
            WriteCapacityAutoScalingSettings:
              MaxCapacity: 10
              MinCapacity: 1
              TargetTrackingScalingPolicyConfiguration:
                TargetValue: 70
      KeySchema:
        - AttributeName: id
          KeyType: HASH
      Replicas:
        - GlobalSecondaryIndexes:
            - IndexName: GSI
              ReadProvisionedThroughputSettings:
                ReadCapacityUnits: 5
          ReadProvisionedThroughputSettings:
            ReadCapacityUnits: 5
          Region: us-east-1
      WriteProvisionedThroughputSettings:
        WriteCapacityAutoScalingSettings:
          MaxCapacity: 10
          MinCapacity: 1
          TargetTrackingScalingPolicyConfiguration:
            TargetValue: 70
    UpdateReplacePolicy: Retain
    DeletionPolicy: Retain
    Metadata:
      aws:cdk:path: MyDynamoDBTableStack/MyTable/Resource

As you can see I didn't specify the capacity in the GSI but I do see that from the console.

image

I'm not sure if this clarifies but if it doesn't, can you elaborate more about this using TableV2 construct?

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort p3 and removed needs-reproduction This issue needs reproduction. p2 labels Nov 11, 2024
@pahud pahud removed their assignment Nov 11, 2024
@MastanaGuru
Copy link
Author

MastanaGuru commented Nov 11, 2024

Hello @pahud , I have tried removing the GSI capacity specification, so that it inherits from parent tableV2, but I still get the same error.

import * as cdk from 'aws-cdk-lib';
import {
  Billing,
  Capacity,
  TableV2
} from 'aws-cdk-lib/aws-dynamodb';
import { Construct } from 'constructs';
import { dynamoDBTables } from '../appConfig/dynamodb-config';
import { DynamoDBTableConfig, } from '../interface/dynamodb';

interface DynamoDBConstructProps {
  stackName: string;
}

export class DynamoDBConstruct extends Construct {
  public readonly tables: { [tableId: string]: TableV2 } = {};

  constructor(scope: Construct, id: string, props: DynamoDBConstructProps) {
    super(scope, id);

    const { stackName } = props;

    dynamoDBTables.forEach((tableConfig: DynamoDBTableConfig) => {
      const { tableId } = tableConfig;
      const prefixedTableName = `${stackName}-${tableConfig.tableName}`;

      let billingMode: Billing;

      if (tableConfig.billingMode === 'PROVISIONED') {
        if (!tableConfig.readCapacity || !tableConfig.writeCapacity) {
          throw new Error(
            `Read and write capacity must be specified for provisioned billing mode on table "${tableConfig.tableName}"`
          );
        }

        // Configure fixed read capacity
        const readCapacity = Capacity.fixed(tableConfig.readCapacity.fixedCapacity);

        // Configure autoscaled write capacity
        const writeCapacity = Capacity.autoscaled({
          maxCapacity: tableConfig.writeCapacity.maxCapacity,
          // minCapacity: tableConfig.writeCapacity.minCapacity || 1, // Optional
          // targetUtilizationPercent: tableConfig.writeCapacity.targetUtilization || 70, // Optional
        });

        billingMode = Billing.provisioned({
          readCapacity,
          writeCapacity,
        });
      } else {
        billingMode = Billing.onDemand();
      }

      const dynamoTable = new TableV2(this, `Table-${prefixedTableName}`, {
        tableName: prefixedTableName,
        partitionKey: {
          name: tableConfig.keySchema.partitionKey.name,
          type: tableConfig.keySchema.partitionKey.type,
        },
        sortKey: tableConfig.keySchema.sortKey
          ? {
              name: tableConfig.keySchema.sortKey.name,
              type: tableConfig.keySchema.sortKey.type,
            }
          : undefined,
        billing: billingMode,
        pointInTimeRecovery: true,
        removalPolicy: cdk.RemovalPolicy.RETAIN,
        timeToLiveAttribute: tableConfig.ttlAttribute,
      });

      // Add Global Secondary Indexes (GSIs)
      if (tableConfig.globalSecondaryIndexes) {
        tableConfig.globalSecondaryIndexes.forEach((gsi) => {
          if (tableConfig.billingMode === 'PROVISIONED') {
            const gsiConfig = {
              indexName: gsi.indexName,
              partitionKey: {
                name: gsi.keySchema.partitionKey.name,
                type: gsi.keySchema.partitionKey.type,
              },
              sortKey: gsi.keySchema.sortKey
                ? {
                    name: gsi.keySchema.sortKey.name,
                    type: gsi.keySchema.sortKey.type,
                  }
                : undefined,
              projectionType: gsi.projection.projectionType,
              nonKeyAttributes: gsi.projection.nonKeyAttributes,
            };
            dynamoTable.addGlobalSecondaryIndex(gsiConfig);
          }else{
            const gsiConfig = {
              indexName: gsi.indexName,
              partitionKey: {
                name: gsi.keySchema.partitionKey.name,
                type: gsi.keySchema.partitionKey.type,
              },
              sortKey: gsi.keySchema.sortKey
                ? {
                    name: gsi.keySchema.sortKey.name,
                    type: gsi.keySchema.sortKey.type,
                  }
                : undefined,
              projectionType: gsi.projection.projectionType,
              nonKeyAttributes: gsi.projection.nonKeyAttributes,
            };
            dynamoTable.addGlobalSecondaryIndex(gsiConfig);
          }
        });
      }
      // Store the table instance using the tableId as the key
      this.tables[tableId] = dynamoTable;
    });
  }
}

dynamodb-config.ts

export const dynamoDBTables: DynamoDBTableConfig[] = [
  {
    tableId: 'ScanResults',
    tableName: 'ScanResults', // Base table name without prefixes
    keySchema: {
      partitionKey: { name: 'objectKey', type: AttributeType.STRING },
      sortKey: { name: 'createdAt', type: AttributeType.NUMBER },
    },
    billingMode: 'PROVISIONED',
    readCapacity: {
      fixedCapacity: 5, // Fixed read capacity units
    },
    writeCapacity: {
      maxCapacity: 5, // Autoscaled write capacity with only maxCapacity
      minCapacity: 1, // aws defaults
      targetUtilization: 70 // aws defaults
    },
    globalSecondaryIndexes: [
      {
        indexName: 'scanStatus-createdAt-index',
        keySchema: {
          partitionKey: { name: 'scanStatus', type: AttributeType.STRING },
          sortKey: { name: 'createdAt', type: AttributeType.NUMBER },
        },
        projection: {
          projectionType: ProjectionType.ALL,
        },
      },
      {
        indexName: 'submissionId-index',
        keySchema: {
          partitionKey: { name: 'submissionId', type: AttributeType.STRING },
        },
        projection: {
          projectionType: ProjectionType.ALL,
        },
      },
    ],
    ttlAttribute: 'expiryDt',
  },
  // Add more tables if necessary
];

cdk synth shows the settings,

  malwareanalysissv1devDynamoDBConstructTablemalwareanalysissv1devScanResultsEAD68F9D:
    Type: AWS::DynamoDB::GlobalTable
    Properties:
      AttributeDefinitions:
        - AttributeName: objectKey
          AttributeType: S
        - AttributeName: createdAt
          AttributeType: "N"
        - AttributeName: scanStatus
          AttributeType: S
        - AttributeName: submissionId
          AttributeType: S
      BillingMode: PROVISIONED
      GlobalSecondaryIndexes:
        - IndexName: scanStatus-createdAt-index
          KeySchema:
            - AttributeName: scanStatus
              KeyType: HASH
            - AttributeName: createdAt
              KeyType: RANGE
          Projection:
            ProjectionType: ALL
          WriteProvisionedThroughputSettings:
            WriteCapacityAutoScalingSettings:
              MaxCapacity: 5
              MinCapacity: 1
              TargetTrackingScalingPolicyConfiguration:
                TargetValue: 70
        - IndexName: submissionId-index
          KeySchema:
            - AttributeName: submissionId
              KeyType: HASH
          Projection:
            ProjectionType: ALL
          WriteProvisionedThroughputSettings:
            WriteCapacityAutoScalingSettings:
              MaxCapacity: 5
              MinCapacity: 1
              TargetTrackingScalingPolicyConfiguration:
                TargetValue: 70
      KeySchema:
        - AttributeName: objectKey
          KeyType: HASH
        - AttributeName: createdAt
          KeyType: RANGE
      Replicas:
        - GlobalSecondaryIndexes:
            - IndexName: scanStatus-createdAt-index
              ReadProvisionedThroughputSettings:
                ReadCapacityUnits: 5
            - IndexName: submissionId-index
              ReadProvisionedThroughputSettings:
                ReadCapacityUnits: 5
          PointInTimeRecoverySpecification:
            PointInTimeRecoveryEnabled: true
          ReadProvisionedThroughputSettings:
            ReadCapacityUnits: 5
          Region:
            Ref: AWS::Region
      TableName: malware-analysis-sv1-dev-ScanResults
      TimeToLiveSpecification:
        AttributeName: expiryDt
        Enabled: true
      WriteProvisionedThroughputSettings:
        WriteCapacityAutoScalingSettings:
          MaxCapacity: 5
          MinCapacity: 1
          TargetTrackingScalingPolicyConfiguration:
            TargetValue: 70
    UpdateReplacePolicy: Retain
    DeletionPolicy: Retain
    Metadata:
      aws:cdk:path: malware-analysis-sv1-dev-InfrastructureStack/malware-analysis-sv1-dev-DynamoDBConstruct/Table-malware-analysis-sv1-dev-ScanResults/Resource

cdk deploy -vvv --debug error

malware-analysis-sv1-dev | 15/69 | 3:53:30 PM | CREATE_FAILED        | AWS::CloudFormation::Stack        | malware-analysis-sv1-dev An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index
malware-analysis-sv1-dev | 15/69 | 3:53:30 PM | CREATE_FAILED        | AWS::DynamoDB::GlobalTable        | malware-analysis-sv1-dev-InfrastructureStack/malware-analysis-sv1-dev-DynamoDBConstruct/Table-malware-analysis-sv1-dev-ScanResults (malwareanalysissv1devDynamoDBConstructTablemalwareanalysissv1devScanResultsEAD68F9D) An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index
	new TableV2 (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/aws-cdk-lib/aws-dynamodb/lib/table-v2.js:1:4602)
	\_ /Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/lib/constructs/dynamodb-construct.ts:54:27
	\_ Array.forEach (<anonymous>)
	\_ new DynamoDBConstruct (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/lib/constructs/dynamodb-construct.ts:23:20)
	\_ new InfrastructureStack (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/lib/infrastructure-stack.ts:197:31)
	\_ Object.<anonymous> (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/bin/infrastructure.ts:25:1)
	\_ Module._compile (node:internal/modules/cjs/loader:1504:14)
	\_ Module.m._compile (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/ts-node/src/index.ts:1618:23)
	\_ Module._extensions..js (node:internal/modules/cjs/loader:1588:10)
	\_ Object.require.extensions.<computed> [as .ts] (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/ts-node/src/index.ts:1621:12)
	\_ Module.load (node:internal/modules/cjs/loader:1282:32)
	\_ Function.Module._load (node:internal/modules/cjs/loader:1098:12)
	\_ TracingChannel.traceSync (node:diagnostics_channel:315:14)
	\_ wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
	\_ Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:5)
	\_ phase4 (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/ts-node/src/bin.ts:649:14)
	\_ bootstrap (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/ts-node/src/bin.ts:95:10)
	\_ main (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/ts-node/src/bin.ts:55:10)
	\_ Object.<anonymous> (/Users/xxxxxx/git/CDK-Malware-Analysis/infrastructure/node_modules/ts-node/src/bin.ts:800:3)
	\_ Module._compile (node:internal/modules/cjs/loader:1504:14)
	\_ Object.Module._extensions..js (node:internal/modules/cjs/loader:1588:10)
	\_ Module.load (node:internal/modules/cjs/loader:1282:32)
	\_ Function.Module._load (node:internal/modules/cjs/loader:1098:12)
	\_ TracingChannel.traceSync (node:diagnostics_channel:315:14)
	\_ wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
	\_ Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:5)
	\_ node:internal/main/run_main_module:30:49
[15:53:34] [AWS cloudformation 200 0.013s 0 retries] describeStackEvents({ StackName: 'malware-analysis-sv1-dev', NextToken: undefined })

Failed resources:
[15:53:34] Reading cached notices from /Users/xxxxxx/.cdk/cache/notices.json
❌  malware-analysis-sv1-dev failed: The stack named malware-analysis-sv1-dev failed to deploy: CREATE_FAILED (An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index)
[15:53:34] Error: ❌  malware-analysis-sv1-dev failed: The stack named malware-analysis-sv1-dev failed to deploy: CREATE_FAILED (An error occurred (ValidationException) when calling the CreateTable operation: No provisioned throughput specified for the global secondary index)
    at Object.deployStack2 [as deployStack] (/opt/homebrew/lib/node_modules/aws-cdk/lib/cdk-toolkit.ts:446:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at /opt/homebrew/lib/node_modules/aws-cdk/lib/util/work-graph.ts:105:11

Thanks
Raj

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 12, 2024
@pahud
Copy link
Contributor

pahud commented Nov 12, 2024

Hi,

Are you able to simplify your provided code snippets and just create one single table with minimal required properties without using conditions like if/else or foreach loops so we can solely focus on what's happening in this single Table? This would help us better address and focus on what's going wrong there rather then dealing many conditions in the snippets. If you prefer, you can extend my provided sample above if you like. Thank you.

Also, I've seen codes like

import { dynamoDBTables } from '../appConfig/dynamodb-config';
import { DynamoDBTableConfig, } from '../interface/dynamodb';

As I can't access those imported codes, it adds unnecessary complexity to address the issue.

Appreciated if you could provide a very minimal self-contained reproducible code snippets for us.

@pahud pahud added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Nov 12, 2024
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-dynamodb Related to Amazon DynamoDB bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p3 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants