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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ