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?

已提問 2 年前檢視次數 934 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南