Skip to content

Instantly share code, notes, and snippets.

@dblencowe
Created August 13, 2020 09:32
Show Gist options
  • Save dblencowe/e1cc7b3f90fbdee79150c13adb851d47 to your computer and use it in GitHub Desktop.
Save dblencowe/e1cc7b3f90fbdee79150c13adb851d47 to your computer and use it in GitHub Desktop.
Load objects from Amplify for use in CDK
import {TableNames} from "../tables.json"
const applicationTables: {[id: string]: string} = {}
for (const DynamoTable of TableNames) {
applicationTables[DynamoTable.split('-')[0]] = DynamoTable
}
console.log(applicationTables.MyGraphqlTable)
{
"scripts": {
"build:env": "aws dynamodb list-tables > tables.json"
}
}
{
"TableNames": [
"MyGraqhqlTable-lv3rfamxxxxxxxxxxxbiigvwi-env"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment