Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added S3 static site support for Amazon CloudFront invalidation on sync.

  • Loading branch information...
commit 6eacb08150fc1dd57f792af72d664f7ce34df320 1 parent 1bc3cd0
@aral authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 S3/
10 S3/
@@ -555,8 +555,16 @@ def get_dist_name_for_bucket(self, uri):
for d in response['dist_list'].dist_summs:
CloudFront.dist_list[getBucketFromHostname(['S3Origin']['DNSName'])[0]] = d.uri()
+ elif"CustomOrigin"):
+ # Aral: This used to skip over distributions with CustomOrigin, however, we mustn't
+ # do this since S3 buckets that are set up as websites use custom origins.
+ # Thankfully, the custom origin URLs they use start with the URL of the
+ # S3 bucket. Here, we make use this naming convention to support this use case.
+ distListIndex = getBucketFromHostname(['CustomOrigin']['DNSName'])[0];
+ distListIndex = distListIndex[:len(uri.bucket())]
+ CloudFront.dist_list[distListIndex] = d.uri()
- # Skip over distributions with CustomOrigin
+ # Aral: I'm not sure when this condition will be reached, but keeping it in there.
debug("dist_list: %s" % CloudFront.dist_list)
Please sign in to comment.
Something went wrong with that request. Please try again.