以下のようなコードでtableの作成を試みています。
const param: DynamoDB.CreateTableInput = { TableName: this.tableName, KeySchema: [ { AttributeName: 'id', KeyType: 'HASH' }, { AttributeName: 'expiredAt', KeyType: 'RANGE' }, { AttributeName: 'status', KeyType: 'RANGE' }, ], AttributeDefinitions: [ { AttributeName: 'id', AttributeType: 'S' }, { AttributeName: 'expiredAt', AttributeType: 'N' }, { AttributeName: 'status', AttributeType: 'S' }, ], ProvisionedThroughput: { ReadCapacityUnits: 10, WriteCapacityUnits: 10, }, } console.log(param) await this.dynamodb.createTable(param).promise()
ところが実行すると以下のようなエラーになってしまいます。
ValidationException: 1 validation error detected: Value '[xxxxa, xxxx, xxxx]' at 'keySchema' failed to satisfy constraint: Member must have length less than or equal to 2
項目数を2個以下に絞れと怒られているように見えます。
確かにプライマリキーに当たるのはidで十分ですが、どのような書き方にすればテーブル作成できますでしょうか?

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。