https://pulumi.com logo
Title
d

damp-school-17708

03/02/2021, 4:27 PM
Hi there, is there a way to 'modify' an existing dynamodb table with Pulumi? I've a bunch of tables which get created with a DMS task, I'd like to add streaming to all of them an a lambda handler, if I create a new table I get ... a new table..
w

witty-candle-66007

03/02/2021, 4:41 PM
If the main goal is to create lambda handler that uses the tables, you can create the handler in pulumi and use
getTable
(https://www.pulumi.com/docs/reference/pkg/aws/dynamodb/gettable/) to get the information you need to pass to the handler. If the bigger picture is to bring the tables under Pulumi management, you can import them as per: https://www.pulumi.com/docs/guides/adopting/import/
d

damp-school-17708

03/02/2021, 4:54 PM
would option 1) modify the table and add a stream?
w

witty-candle-66007

03/02/2021, 5:10 PM
getTable will not bring the table under management and so you would not be able to modify it. Instead, you would have to import the table(s) and then you would be able to modify the resource in your pulumi code. There are a couple of ways to import as described in that document. The command line approach may be best since it can take as input a json of table to import and will produce scaffolding code you can then put in a pulumi program to manage/modify the table(s) going forward.
d

damp-school-17708

03/02/2021, 5:12 PM
yep trying that thanks a lot