How to set permissions to a table.
# sst
s
How to set permissions to a table.
f
Hey @Sakar, do you mean granting a Lambda function permissions to access a DynamoDB table?
Can you share a snippet of how ur Lambda function is created (ie. via Api, Topic, etc)?
s
Hi, Frank I made it work putting api.attachPermissions(sst.PermissionType.ALL) in my stack.
f
You could also put it inside ur Api’s `defaultFunctionProps`:
Copy code
new sst.Api(this, "MyApi", {
  defaultFunctionProps: {
    permissions: [sst.PermissionType.ALL],
  },
  routes: ...
});
This does the same thing as ur solution above.
s
Thank you.