# Deploy Again

**URL:** <https://discourse.sst.dev/t/deploy-again/138>\
**Category:** Chapter Comments\
**Created:** [May 9, 2018, 8:02pm UTC](https://discourse.sst.dev/t/deploy-again/138 "2018-05-09T20:02:43Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 8:02pm UTC](https://discourse.sst.dev/t/deploy-again/138/21 "2018-05-09T20:02:49Z")

</div>

_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.

```auto
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.

Anyone got any ideas?

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 8:02pm UTC](https://discourse.sst.dev/t/deploy-again/138/22 "2018-05-09T20:02:50Z")

</div>

_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.

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 8:02pm UTC](https://discourse.sst.dev/t/deploy-again/138/23 "2018-05-09T20:02:50Z")

</div>

_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:

aws s3 sync build/ s3://YOUR\_S3\_DEPLOY\_BUCKET\_NAME --delete

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.

---

<div class="post-metadata">

**Author:** ![anomalyinnovations](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/anomalyinnovations/32/10_2.png) [@anomalyinnovations](https://discourse.sst.dev/u/anomalyinnovations)\
**Post date:** [May 9, 2018, 8:02pm UTC](https://discourse.sst.dev/t/deploy-again/138/24 "2018-05-09T20:02:50Z")

</div>

_From @jayair on Sat Feb 24 2018 14:27:58 GMT+0000 (UTC)_  
  
@drakeloud Good point. I’ll add a note.

---

<div class="post-metadata">

**Author:** ![jlou](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jlou](https://discourse.sst.dev/u/jlou)\
**Post date:** [June 4, 2018, 10:40pm UTC](https://discourse.sst.dev/t/deploy-again/138/25 "2018-06-04T22:40:19Z")

</div>

When I deploy with new update, I got the error message.

```auto
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

```

Any idea?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [June 6, 2018, 11:11pm UTC](https://discourse.sst.dev/t/deploy-again/138/26 "2018-06-06T23:11:14Z")

</div>

That’s pretty weird and seems related to the AWS CLI. Does your deploy fail or is this just a warning?

---

<div class="post-metadata">

**Author:** ![jlou](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jlou](https://discourse.sst.dev/u/jlou)\
**Post date:** [June 8, 2018, 1:12am UTC](https://discourse.sst.dev/t/deploy-again/138/27 "2018-06-08T01:12:29Z")

</div>

It is a warning. I can deploy the project.

Thanks,

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [June 8, 2018, 7:58pm UTC](https://discourse.sst.dev/t/deploy-again/138/28 "2018-06-08T19:58:47Z")

</div>

I see. Yeah I’m not sure what is causing it but it’s good that it deployed okay.

---

<div class="post-metadata">

**Author:** ![LiranBri](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/liranbri/32/474_2.png) [@LiranBri](https://discourse.sst.dev/u/LiranBri)\
**Post date:** [May 4, 2019, 7:02am UTC](https://discourse.sst.dev/t/deploy-again/138/29 "2019-05-04T07:02:16Z")

</div>

why do you need to invalidate everything with the wildcar option, and not just index.html & service-worker.js ?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [May 6, 2019, 1:19am UTC](https://discourse.sst.dev/t/deploy-again/138/30 "2019-05-06T01:19:30Z")

</div>

Yeah you could I guess. But if you had other files it would make it harder to invalidate them one by one right?

---

<div class="post-metadata">

**Author:** ![LiranBri](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/liranbri/32/474_2.png) [@LiranBri](https://discourse.sst.dev/u/LiranBri)\
**Post date:** [May 6, 2019, 8:51pm UTC](https://discourse.sst.dev/t/deploy-again/138/31 "2019-05-06T20:51:39Z")

</div>

Other files should be cached busted with hash embedded in the filename

[Previous page](https://discourse.sst.dev/t/deploy-again/138.md?page=1)
