Amplify headless - need help on setting up the app automated

0

I am trying to setup my app using headless feature for CI/CD. It has been a challenge doing this as I find AWS Amplify online documentation is not adequate. I had to go through amplify-cli code on github to figure out some payloads. That is not only time consuming but also didn't help beyond a point.

I am able to do the following steps manually through interactive CLI and have been using amplify for several months now. I am not able to do some of this with headless option. Exact challenges faced are listed later.

  1. Create Auth service using Cognito userpool. UserId/pwd signin with email for verification. "admin" and "user" groups.
  2. Create API that uses Cognito user groups and API based authentication for Auth.
  3. PostConfirmation Lambda trigger of Cognito that will have my custom code to update DynamoDB for user profile and assign user a default role ("user" role).

I have the following challenges for headless option:

  1. Not clearly defined guide for the payload of all these commands, preferably 1:1 mapping of command line options and its equivalent JSON payload.
  2. How to query certain data and get it in JSON form if it has to be given to the next command e.g. user pool id from Auth to be given to API for authorisation.
  3. How to set order/priority for user groups? CLI guides us but I didn't find this in Auth payload.
  4. I didn't find separate command for function for headless. How and under which service (cli) to create PostConfirmation Cognito Trigger with custom code? I didn't see any provision in Auth service payload for trigger. However, in CLI "amplify add auth" sets this up. Does it happen in "auth" or in "amplify init ... --headless" through "categories"? When init is called, auth service is not added yet. How can I create PostConfirmation trigger through init then?

I may not be able to summarise every scenario. It would be good to get answers and sample code/payloads (preferred) or tips on how to navigate through current documentation to find answers.

Amplify should save my time. If I have to spend a lot of time figuring this all out then that defeats the purpose of doing things quicker with Amplify.

Looking forward to your guidance.

NOTE: Please add tag "AWS Amplify Headless" under you tags. I feel this is important topic.

JSW
asked 2 years ago94 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions