Created
April 10, 2022 22:40
-
-
Save louislatreille/c7cc35cc4f48ae4e9475d5bd3cd202f0 to your computer and use it in GitHub Desktop.
Serverless Streamlined - dynamodbMainTable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { varToString } from "./utilities"; | |
export const createMainTable = () => { | |
const mainTable = { | |
Type: "AWS::DynamoDB::Table", | |
Properties: { | |
AttributeDefinitions: [ | |
{ | |
AttributeName: "PK", | |
AttributeType: "S", | |
}, | |
{ | |
AttributeName: "SK", | |
AttributeType: "S", | |
}, | |
], | |
BillingMode: "PAY_PER_REQUEST", | |
KeySchema: [ | |
{ | |
AttributeName: "PK", | |
KeyType: "HASH", | |
}, | |
{ | |
AttributeName: "SK", | |
KeyType: "RANGE", | |
}, | |
], | |
}, | |
}; | |
return { | |
resources: { mainTable }, | |
name: { Ref: varToString({ mainTable }) }, | |
arn: { "Fn::GetAtt": [varToString({ mainTable }), "Arn"] }, | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment