I have been looking into using pulumi for a serverless app using AppSync and DynamoDB.
To get started, I have decided to use the following template to get started, so authentication etc is handled for me: https://github.com/SimonHoiberg/saas-template
Going through the project, it looks like a lot of work to set up just a single table with CRUD operations for a given entity.
It it possible for anyone to provide a simple CRUD example for a given test entity in the context of the github repo linked? I have a hard time finding examples online, which I can use to figure it out myself.
E.g. for a table to store an entity with a create operation, to me it looks like the steps are:
• Create model in back-end/src/types
• Create file and export "create" function in back-end/src/dynamodb/
• Create type and mutation in back-end/resources/schema/schema.graphql
• Add table, set dynamoDBTables and export table id in back-end/resources/pulumi/dynamodb.ts
• Create folder for each CRUD operation containing source-file and callback-file in back-end/resources/pulumi/resolvers/
So for a single operation, a folder with these two files: (back-end/resources/pulumi/resolvers/create-test-entity/create-test-entity.ts) and (back-end/resources/pulumi/resolvers/create-test-entity/source.ts)
• Call setup<entity>Source file in back-end/resources/pulumi/appSync.ts
Creating just the CRUD operations for a single entity is a lot of folders, files and code, and I still haven't even figured out how to pass parameters from the source.ts file to its corresponding callback handler (E.g. the object to be put in the database). Can it be as complex as I make it out to be?