Greeting all! I have a client application in React that uses an AppSync GraphQL API back end. I have added storage to amplify and can upload files to the storage. When a file is uploaded to the Storage a Lambda function is triggered and I am able to iterate through the contents. I have configured my AWS AppSync API with Cognito User Pool authentication My requirement is I need to make GraphQL mutation from the Lambda Function(written in python) to an AppSync API.
The requirement in Short:
- Upload an Excel file to the S3 Storage bucket using AppSync
- Trigger a lambda function(python) on upload to extract contents of the Excel file
- Send a GraphQL mutation to the AppSync GraphQL from the Lambda function with the contents of the file using the schema as required.
I need to use the Cognito user credentials, as I need to get details of the user making the mutations/
With the last update, I am able to upload content to the Client app, which dumps the Excel sheet in the S3 bucket triggering the Lambda function.
I tried to use "Assume role" but was getting the below error
[ERROR] ClientError: An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::#############:assumed-role/S3Accessfunction/uploadProcessor is not authorized to perform: sts:AssumeRole on resource: AWS:#######################:CognitoIdentityCredentials