https://pulumi.com logo
#aws
Title
h

hundreds-receptionist-31352

01/28/2021, 2:15 PM
Hi, I'm trying to get some items from dynamodb, I could get it using aws-sdk, I wonder if someone have an example using this function: https://www.pulumi.com/docs/reference/pkg/aws/dynamodb/tableitem/#look-up
b

brave-planet-10645

01/28/2021, 2:57 PM
Are you looking to use the items retrieved in your pulumi program?
h

hundreds-receptionist-31352

01/28/2021, 3:24 PM
yes right
b

brave-planet-10645

01/28/2021, 5:07 PM
So I did some experimenting and the ID that you can get out of the tableItem resource is of the format
{tablename}|{hashkeyname}||{hashkeyvalue}||{rangekeyname}||{rangekeyvalue}|
(so swap the {} values for what you have - in the example that you get from https://www.pulumi.com/docs/reference/pkg/aws/dynamodb/tableitem/ you get something like
exampleTable-9d70e8a|exampleHashKey||something|
(because it doesn't have a rangekey). So you can pass that into the ID parameter of the look up function
h

hundreds-receptionist-31352

01/28/2021, 5:31 PM
thanks Pier, I will try that