code: def _upload_file_aws_cli(local_fname, bucket, keyname, config=None, mditems=None):
      
      s3_fname = "s3://%s/%s" % (bucket, keyname)
      args = ["--sse", "--expected-size", str(os.path.getsize(local_fname))]
      if config:
          if config.get("region"):
              args += ["--region", config.get("region")]
          if config.get("reduced_redundancy"):
              args += ["--storage-class", "REDUCED_REDUNDANCY"]
      cmd = [os.path.join(os.path.dirname(sys.executable), "aws"), "s3", "cp"] + args + \
            [local_fname, s3_fname]
      do.run(cmd, "Upload to s3: %s %s" % (bucket, keyname))
docs: Streaming upload via the standard AWS command line interface.