miraquee
miraquee

Reputation: 199

amplify init fails constantly

I don't know whats really wrong with my amplify. I run amplify init and get this error message. I have downloaded my amplify cli using npm and have successfully run 'amplify configure'.

init failed
InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

The Canonical String for this request should have been
'POST
/apps

host:amplify.ap-south-1.amazonaws.com
x-amz-content-sha256:79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29
x-amz-date:20210121T154050Z

host;x-amz-content-sha256;x-amz-date
79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29'

The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210121T154050Z
20210121/ap-south-1/amplify/aws4_request
b150344845c2c575fd957d63172173a367f2bacf0e817764a02e5b20d03c3811'

Upvotes: 2

Views: 2935

Answers (2)

Clifford Fajardo
Clifford Fajardo

Reputation: 1447

On Mac: I was also getting the same error while using the aws amplify CLI tool in my nodejs project.

Like @miraquee noted above about the issue being a white space. I suspected that I also had the same issue. What I did to start clean was:

  1. Delete the local .aws folder in my home folder on mac to start clean
rm -rf ~/.aws/
  1. Ran amplify init again. This time when reaching the step where it asks you to create an IAM user, which subsequently takes opens your web browser to finish the creation of the new IAM user, I was very careful about copying in the Access Key Id and Secret Access Key enter image description here

This time when I went through the flow in the CLI it worked.

If you want to see a video of these steps, checkout this YouTube video built by one of the engineers on the AWS amplify team AWS Amplify CLI walkthrough

Upvotes: 1

miraquee
miraquee

Reputation: 199

Okay, so I finally found out what was bugging me for last three days. A whitespace ( ). Yes!

I had my folder inside the user with a whitespace in it, as in "First Last". Instead what I should have done is changed my folder name inside my C:\Users\First Last to C:\Users\FirstLast before starting, and then try to install my amplify CLI using the command curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd and proceed as mentioned in the documentation here.

To change the name of the User folder in windows 10, I watched this great YT! video

Upvotes: 2

Related Questions