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 Risposta
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
ESPERTO
con risposta 2 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande