Recently, a modification for CF invalidation was added so it was possible to invalidate files from a custom origin CF distribution that used S3 as custom origin.
Unfortunately, s3cmd wouldn't invalidate the path in CF when the uploaded file in S3 is the default index.
So, I modified it to automatically retrieve the default index name, detect if the invalidation path uses it and modify the query accordingly.
I also added two new flags to modify this behavior:
When using default index, invalidate path
Corrected the new flags for CF index invalidation
Removed debug messages, make sure default index is defined
Fixed exception for root document
+1 I also ran into this when using s3cmd to sync and invalidate a static website via cloudfront/s3
+1 Same issue here. Looks like no movement merging this in. I guess best plan is to build from your fork?
Very cool! Thanks for fixing this.