Support adding policy statements in function created with defineFunction() #2385
Labels
function
Issue pertaining to Amplify Function
pending-triage
Incoming issues that need categorization
Environment information
Describe the feature
At the moment, there's no way to customize policy statements for the role of a lambda created using defineFunction().
This is a very basic requirement.
Use case
My use case is to add a mutation for deleting user data. Therefore, I created a function using defineFunction so I can reference it in the data schema as a mutation (notice I already had to workaround the env vars by using values generated by output creating a nasty dependency with a build artifact during build time, which should also be improved):
Then I have something like this in my data schena:
I dont want to use Amplify's API in this function for accessing data because it's inefficient for this use case, and as far as I've seen, it also involves more workarounds. We should be able to access the DB directly.
I've also tried something like this, but
functions
is undefined:I've tried to access it for example through backend.data.resources.functions, but functions is undefined.
The text was updated successfully, but these errors were encountered: