Amplify-cli: Add User To Dynamo DB in PostConfirmation Cognito Trigger

Created on 12 Apr 2020  路  3Comments  路  Source: aws-amplify/amplify-cli

Which Category is your question related to?
AWS Amplify, Amplify GraphQL Api, AWS Cognito

Amplify CLI Version
4.13.1

What AWS Services are you utilizing?
AWS Amplify, Amplify GraphQL Api, AWS Cognito

Provide additional details e.g. code snippets
In the POSTCONFIRMATION trigger lambda function of Cognito, I want to call my APPSYNC GRAPHQL using amplify and API_KEY authentication to add the new user to my Dynamo DB.
Here is what I tried:

  1. Amplify update function (Post Confirmation lambda function)
  2. Provide access to appsync api.
  3. Run "amplify push"

It gave the following error:

"Circular dependency between resources: [apisampleApi, UpdateRolesWithIDPFunctionOutputs, UpdateRolesWithIDPFunction, authsample644f88cf, functionsample644f88cfPostConfirmation]
An error occured during the push operation: Circular dependency
between resources: [apisampleApi, UpdateRolesWithIDPFunctionOutputs, UpdateRolesWithIDPFunction, authsample644f88cf, functionsample644f88cfPostConfirmation]"

Can you please guide me on how to fix this and how to achieve what I am trying to achieve.

Note: I do not want to call Dynamo DB directly using aws-sdk.

Most helpful comment

Any solution? They mentioned how to solve this with cloudformation, but I don't know how to use it... Maybe is there any other way?

All 3 comments

You can find some answers to you problem here: https://github.com/aws-amplify/amplify-cli/issues/3430

Closing as a duplicate of #3430

Any solution? They mentioned how to solve this with cloudformation, but I don't know how to use it... Maybe is there any other way?

Was this page helpful?
0 / 5 - 0 ratings