saving to local fs or aws depending on conf var