Using the vsis3 prefix with gdal2tiles command can upload files to s3 bucket successfully. However, gdal attempts to write files with backslashes "{x}{y}{z}.png", although in s3, normal slash should be used instead "/{x}/{y}/{z}.png". Any ideas how gdal2tiles output could be send to s3?
from osgeo_utils import gdal2tiles
file = "test.tif"
s3_bucket_name = "test-bucket"
folder_name = "test_folder"
path = "/vsis3/" + s3_bucket_name + "/" + folder_name
zoom = "16-21"
options = ["--xyz", "--zoom", zoom, file, path]
gdal2tiles.main(options)