def upload_files()

in source/tools/host_files.py [0:0]


def upload_files(bucket, region, path):
    s3 = boto3.client('s3', region_name=region)
    # /Users/erinhal/workplace/Voicemail/src/AmazonConnectVoicemail/source/.dist
    print("Path for uploading {}".format(path))
    for root, dirs, files in os.walk(path):
        nested_dir = root.replace(path, '')
        if nested_dir:
            nested_dir = nested_dir.replace('/', '', 1) + '/'

        for current_file in files:
            if current_file != ".DS_Store":
                full_path = os.path.join(root, current_file)
                current_file = nested_dir + current_file if nested_dir else current_file
                print("Uploading {} --> {} region: {}".format(current_file, bucket, region))
                s3.upload_file(
                    full_path,
                    bucket,
                    current_file,
                    ExtraArgs={'ACL': 'public-read', 'ContentType': get_content_type_by_name(current_file)}
                )