code: def invalidate(self, files_to_be_invalidated):
          
          if not isinstance(files_to_be_invalidated, Iterable):
              files_to_be_invalidated = (files_to_be_invalidated,)
  
          # Your CDN is called distribution on Amazaon. And you can have more than one distro
          all_distros = self.conn_cloudfront.get_all_distributions()
  
          for distro in all_distros:
              invalidation_request = self.conn_cloudfront.create_invalidation_request(distro.id, files_to_be_invalidated)
  
          return (distro.id, invalidation_request.id)
docs: Invalidate the CDN (distribution) cache for a certain file of files. This might take up to 15 minutes to be effective.
  
          You can check for the invalidation status using check_invalidation_request.
  
          Examples
          --------
  
              >>> from s3utils import S3utils
              >>> s3utils = S3utils(
              ... AWS_ACCESS_KEY_ID = 'your access key',
              ... AWS_SECRET_ACCESS_KEY = 'your secret key',
              ... AWS_STORAGE_BUCKET_NAME = 'your bucket name',
              ... S3UTILS_DEBUG_LEVEL = 1,  #change it to 0 for less verbose
              ... )
              >>> aa = s3utils.invalidate("test/myfolder/hoho/photo.JPG")
              >>> print(aa)
              ('your distro id', u'your request id')
              >>> invalidation_request_id = aa[1]
              >>> bb = s3utils.check_invalidation_request(*aa)
              >>> for inval in bb:
              ...     print('Object: %s, ID: %s, Status: %s' % (inval, inval.id, inval.status))