You’l want to run the command in an instance that has access to the images. Oh, but if you moved them to S3 yourself by hand, then you might want to do some surgery on the uploads table instead.
I have been working on a howto with instructions for moving from one bucket to another that you might use to solve your problem, though you’ll need to modify those instructions to account for your local-to-bucket rather than bucket-to-bucket changes.
If I were to bill you a flat rate for the job, I’d probably charge 4 hours, though if you were to pay by the hour it might be only one.
Oh! Sorry. I just noticed this. If the EC2 is using the same database, then you might be able to crank it back up (leaving the ECS in place), and run the migrate-to-s3 task there; you’ll need to first put all the S3 stuff in ENV variables as described in Using Object Storage for Uploads (S3 & Clones). This is likely the easiest solution. I’d recommend doing a database-only backup before starting.