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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠