Question in Global dynamo DB tables


We use terraform with AWS . There are 2 pipelines that we have created, 1 for Prod and another one for Disaster recovery. these 2 environments are in 2 different region. we are creating global dynamo db tables so that data is shared between these 2 regions . The idea is to spin up just service layer in DR region in case of any DR incident.

Our Prod Pipeline creates the global table , the table resources are required for some lambda functions which is in the service layer. So when we create the DR environment, since the tables are not created with in the deployment, terraform errors out complaining about resource not found on dynamo db tables. So to connect to global table from DR, what is the best strategy?


Generally you would use a Terraform data source (data block) to look up information about existing infrastructure, so you can reference it elsewhere in a Terraform configuration that does not itself create it.