Skip to content

Instantly share code, notes, and snippets.

@tanveerprottoy
Last active May 3, 2022 11:49
Show Gist options
  • Save tanveerprottoy/b2b742cf5bd68cb60fd8d0a11611ddc6 to your computer and use it in GitHub Desktop.
Save tanveerprottoy/b2b742cf5bd68cb60fd8d0a11611ddc6 to your computer and use it in GitHub Desktop.
app.schema.ts
import { CreateTableInput } from "@aws-sdk/client-dynamodb";
import { Constants } from "../../constants";
import { DbControlOpsInstance } from "../../libs/dynamodb";
const appTableParams: CreateTableInput = {
TableName: "Apps",
KeySchema: [
{
AttributeName: "id",
KeyType: "HASH"
}
],
AttributeDefinitions: [
{ AttributeName: "id", AttributeType: "S" },
// { AttributeName: "name", AttributeType: "S" }
],
ProvisionedThroughput: {
ReadCapacityUnits: 1,
WriteCapacityUnits: 1
}
}
export function initAppTable() {
console.log("initAppTable");
DbControlOpsInstance.create(appTableParams);
DbControlOpsInstance.list();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment