From @littleredshack on Wed Dec 13 2017 06:13:36 GMT+0000 (UTC)
Strange one. I have got all the way through the process and all working fine. But when I try to redeploy to S3 I get an error about my AWS key being invalid.
C:\Users\gstokes\Documents\Personal\Coding\Serverless\notes-app-frontend\notes-app-client>aws s3 sync build/ s3://gbs-notes-app-client
fatal error: An error occurred (InvalidAccessKeyId) when calling the ListObjects operation: The AWS Access Key Id you provided does not exist in our records.
I have re-run AWS configure just in case those got changed somehow. Still not working.
From @littleredshack on Wed Dec 13 2017 06:53:52 GMT+0000 (UTC)
I just went into IAM and then in the user that I had originally created I chose the option to create a new Access Key. I used that and it is working. No idea why the previous one suddenly stopped.
From @drakeloud on Sat Feb 24 2018 04:30:09 GMT+0000 (UTC)
I’m not sure if anyone else has pointed this out in a different chapter, but I think that you should add the --delete flag when syncing your s3 bucket. So the full command would be this:
This deletes the files that aren’t in your local directory. When you run npm build, it creates unique ids for the static files, so simply syncing s3 gives you the old files, and adds the new ones. E.g. my app is 6MB and it was adding another 6MB every time I deploy.
When I deploy with new update, I got the error message.
F:\GitProject\nodejs\serverless\notes-app-client>aws s3 sync build/ s3://notes-upload-1688 --delete
C:\Program Files\Amazon\AWSCLI\.\dateutil\parser.py:605: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal