score:30

I have experienced the same problem in my first build.

The Amplify documentation is not specific about how you should maintain your builds when using the Amplify Console, but the routine that worked for me was:

You generate your aws-exports file when you run a successful amplify push command.

aws-exports.js file This file is generated only for JavaScript projects. It contains the consolidated outputs from all the categories and is placed under the src directory that the user (the developer) specified during the init process. It is updated after each successful execution of the amplify push command, that has created or updated the cloud resources.

Based on that I updated my configuration in the Amplify console to also deploy my backend. You can learn how to configure your own at https://docs.aws.amazon.com/amplify/latest/userguide/build-settings.html

backend:
  phases:
    build:
      commands:
        - '# Execute Amplify CLI with the helper script'
        - amplifyPush --simple

After the backend build is done the file is generated for my next job which is the frontend build that consumes the aws-exports file.

Note: If you're using eslint you can have a problem with the file output format. You can add a eslint --fix command in your frontend preBuild

Update: As lucdenz mentioned, you also need to setup a service role

Sources I used:


Related Query

More Query from same tag