AWS Amplify environment 'dev' not found

Viewed 1165

I'm working with AWS Amplify, specifically following this tutorial AWS-Hands-On-Tutorial.

I'm getting a build failure when I try to deploy the application.

enter image description here

So far I have tried creating multiple backend environments and connecting them with the frontend, hoping that this would alleviate the issue. The error message leads me to believe that the deploy is not set up to also detect the backend environment, despite that I have it set to do so.

enter image description here

Also, I have tried changing the environment that is set to deploy with the frontend by creating another develop branch to see if that is the issue.

enter image description here

I've had no success with trying any of these, the build continues to fail. I have also tried running the 'amplify env add' command as the error message states. I have not however tried "restoring its definition in your team-provider-info.json" as I'm not sure what that entails and can't find any information on it. Regardless, I would think creating a new environment would solve the potential issues there, and it didn't. Any help is appreciated.

1 Answers

Due to the documentation being out of date, I completed the steps below to resolve this issue:

  1. Under Build Settings > Add package version override for Amplify CLI and leave it as 'latest'

  2. When the tutorial advises to "update your front end branch to point to the backend environment you just created. Under the branch name, choose Edit...", where the tutorial advises to use 'dev' it actually had us setup 'staging', choose that instead.

  3. Lastly, we need to setup a 'Service Role' under General. Select General > Edit > Create New Service Role > Select the default options and save the role, it should have a name of amplifyconsole-backend-role. Once the role is saved, you can go back to General > Edit > Select your role from the dropdown, if it doesn't show by default start typing it in.

After completing these steps, I was able to successfully redeploy my build and get it pushed to prod with authentication working. Hope it helps anyone who is running into this issue on Module 3 of the AWS Amplify Starter Tutorial!

Related