I'm creating an apollo graphql lambda where the re...
# sst
a
I'm creating an apollo graphql lambda where the resolvers invoke other lambdas directly. I'm getting a permissions error. Any idea on how to pass the permissions to the resolver lambda. I'm doing this:
Copy code
const apollo = new sst.ApolloApi();
const resolver = new sst.Function();

resolver.attachPermissions([apollo]);
f
Hey @Abdul Taleb, try this
Copy code
resolver.attachPermissions(["lambda:InvokeFunction"]);
a
Thanks Frank, but it still is giving me the same error
Copy code
User: arn:aws:sts::********:assumed-role/apolloGraphqlLambda/graphql-api-dev is not authorized to perform: lambda:InvokeFunction on resource: arn:aws:lambda:us-west-2:**********:function:resolver-dev
f
Hmm.. I think we are attaching the permission to the wrong Lambda. Where is the
resolver
function used? The
ApolloApi
has a
server
prop, is that set to the
resolver
function?
a
I was able to get it to work doing this
Copy code
apollo.attachPermissions(["lambda:InvokeFunction"])
Thanks!
f
Nice!👍