AppSync JS Resolvers with CDK: How to get a DynamoDB Table Name for all your Transact Operations

Kieron Mckenna
1 min readFeb 9, 2023

This article assumes familiarity with the CDK and AppSync in general.

Using the new AppSync JS resolvers is a joy compared to VTL, but I find myself writing a lot of transact operations. To use a transact operation you need the DynamoDB table name for each operation. The problem with this is that even with the Datasource set as the DynamoDB table theres no way to access the table name in the resolvers. You could hard code the table name but at least in my case I’ve got…

--

--

Kieron Mckenna

Twitter: @kieronjmckenna | Cyber Security Masters at Queens University Belfast | Working at Chakray Consulting UK