AWS DynamoDB noSQL example of creating a table with schema

Example of creating a blog table using a schema for AWS DynamoDB using node.Js JavaScript. module.exports.PrepareDB = () => { let config = require('../config/dynamoConfigLocal') let dynamoConfig = process.env.NODE_ENV === 'production' ? {} : {endpoint: config.endpoint, port: config.port} let dynamoDB = require('@stacksavings/dynamodb') dynamoDB = new dynamoDB(dynamoConfig) const crearTablaBlog = async () => { const parametros = { TableName: 'blog', KeySchema: [ {AttributeName: 'id', 'KeyType': 'HASH'}, {AttributeName: 'fechaCreacion', 'KeyType': 'RANGE'} ], AttributeDefinitions: [ { AttributeName: 'id', 'AttributeType': 'S' }, { AttributeName: 'fechaCreacion', 'AttributeType': 'S' }, { AttributeName: 'idUsuario', 'AttributeType': 'S' } ], ProvisionedThroughput: { 'ReadCapacityUnits': 15, 'WriteCapacityUnits': 15 }, GlobalSecondaryIndexes: [ { IndexName: 'idUsuario_index', KeySchema: [ { AttributeName: 'idUsuario', KeyType: 'HASH' } ], Projection: { ProjectionType: 'ALL' }, ProvisionedThroughput: { ReadCapacityUnits: 1, WriteCapacityUnits: 1 } } ] } const promise = await dynamoDB.createTable(parametros) return promise } return { crearTablaBlog: crearTablaBlog } } const prepareRun = this.PrepareDB() prepareRun.crearTablaBlog() .then(res => console.log(res)) .catch(err => { console.error(err) })