Completely untested, but it shouldn't be anything particularly complicated if all you want is a full image you can flash back:
dd if=/dev/sda bs=4M | zstd -T0 -9 | openssl enc -aes256 | aws cp - s3://your-bucket/backup-sda.zstd.enc
Using tar is probably a lot more efficient though, at least you only upload what's used not the whole drive.
Or even better, use btrfs/zfs snapshots.