"AWS access credentials can not be found" getting this error when trying to deploy the react app on amplify

0

Hi Guys, I need urgent help on this issue. There isn't any accurate help available on the internet for this.

"AWS access credentials can not be found" getting this error when trying to deploy the react app on @amplify . Everything's working fine on localhost. Here's the error log-

2023-05-20T09:21:17.184Z [INFO]: # Cloning repository: git@github.com:myrepos
2023-05-20T09:21:19.101Z [INFO]: 
2023-05-20T09:21:19.103Z [INFO]: Cloning into 'zeeepy'...
2023-05-20T09:21:19.104Z [INFO]: # Switching to commit: bd45c7afa30c9e71643a0e0a2991d0fc8440c7aa
2023-05-20T09:21:19.124Z [INFO]: Note: switching to 'bd45c7afa30c9e71643a0e0a2991d0fc8440c7aa'.
                                 You are in 'detached HEAD' state. You can look around, make experimental
                                 changes and commit them, and you can discard any commits you make in this
                                 state without impacting any branches by switching back to a branch.
                                 If you want to create a new branch to retain commits you create, you may
                                 do so (now or later) by using -c with the switch command. Example:
                                 git switch -c <new-branch-name>
                                 Or undo this operation with:
                                 git switch -
                                 Turn off this advice by setting config variable advice.detachedHead to false
                                 HEAD is now at bd45c7a Backend integrated
2023-05-20T09:21:19.180Z [INFO]: Successfully cleaned up Git credentials
2023-05-20T09:21:19.180Z [INFO]: # Checking for Git submodules at: /codebuild/output/src242373753/src/zeeepy/.gitmodules
2023-05-20T09:21:19.189Z [INFO]: # Retrieving environment cache...
2023-05-20T09:21:19.796Z [INFO]: # Retrieved environment cache
2023-05-20T09:21:19.797Z [INFO]: ---- Setting Up SSM Secrets ----
2023-05-20T09:21:19.797Z [INFO]: SSM params {"Path":"/amplify/d3ia74jrzqfroo/main/","WithDecryption":true}
2023-05-20T09:21:19.836Z [WARNING]: !Failed to set up process.env.secrets
2023-05-20T09:21:42.406Z [INFO]: # Patching NPM package '@aws-amplify/cli' from 10.5.2 to 12.0.0...
2023-05-20T09:22:02.567Z [INFO]: # Done patching NPM package '@aws-amplify/cli' to version 12.0.0
2023-05-20T09:22:02.630Z [INFO]: # Retrieving cache...
2023-05-20T09:22:05.748Z [INFO]: # Extracting cache...
2023-05-20T09:22:10.438Z [INFO]: # Extraction completed
2023-05-20T09:22:11.441Z [INFO]: # Retrieved cache
2023-05-20T09:22:15.475Z [INFO]: ## Starting Backend Build
                                 # Starting phase: build
2023-05-20T09:22:17.637Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2023-05-20T09:22:17.652Z [INFO]: 🛑 AWS access credentials can not be found.
2023-05-20T09:22:17.652Z [INFO]: Learn more at: https://docs.amplify.aws/cli/project/troubleshooting/
2023-05-20T09:22:17.696Z [INFO]: 
2023-05-20T09:22:17.697Z [INFO]: Session Identifier: 5668b0c6-8dc5-4dcd-8b00-38754fa06b84
2023-05-20T09:22:17.715Z [ERROR]: !!! Build failed
2023-05-20T09:22:17.716Z [ERROR]: !!! Non-Zero Exit Code detected
2023-05-20T09:22:17.716Z [INFO]: # Starting environment caching...
2023-05-20T09:22:17.716Z [INFO]: # Uploading environment cache artifact...
2023-05-20T09:22:17.824Z [INFO]: # Uploaded environment cache artifact
2023-05-20T09:22:17.824Z [INFO]: # Environment caching completed
Terminating logging...

Here's the link to stackoverflow with error logs - https://stackoverflow.com/questions/76296636/aws-access-credentials-can-not-be-found-error-when-deploying-on-amplify

could you please help me with this?

1 Answer
1

Hi

It seems that your amplify configuration lacks the required IAM permissions.

Follow this guide to create the required role for Amplify -> https://docs.aws.amazon.com/amplify/latest/userguide/how-to-service-role-amplify-console.html#step-3-return-to-the-amplify-console

profile picture
Bisina
answered a year ago

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