How to share one dynamo db table with multiple stacks?

0

I am new to AWS. I have a problem statement. I have to code in .net core application where multiple stacks shares single Dynamo db table. Suppose i have two cdk stacks - credit and debit. Both the stacks use single table name- 'Account' which has column 'Type'. If the call is from credit then column -Type should get updated with 'credit' and if the call is from debit then it should get updated 'debit'. These stacks are written in typescript file(.ts) .Can someone help with the code and explain the flow?

1 回答
1

You are unable to have multiple stacks manage the same resource, each resource must be maintained by a single stack. For this reason you would need to use the nested stack construct where your table exists in the parent stack and other resources in the child stacks can access it.

Alternatively, you can access resources which belong in other stacks but managing these can become cumbersome. More info here: resource_stack

profile pictureAWS
专家
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则