hey guys, how should I go about sharing a table co...
# help
a
hey guys, how should I go about sharing a table construct across multiple stacks? Basically, I’ve an AppStack has my Table and then I’ve multiple Stacks which use Api constructs. I wan’t to addPermissions to the previously created Table in all these Apis.
I used the approach as described in the Auth construct docs to share the Table construct, worked fine.
f
Yup, just to add that if you need to give permission to ALL of ur Lambda, you can do this in ur
lib/index
Copy code
app.setDefaultFunctionProps({
  permissions: [table]
});
a
oh, that’s nice to have, but I’m separating tables by services, anything that needs to be shared is duplicated using events ensuring minimum dependency.