Prepare the existing EC2 (source instance)



Confirm the instance is fully configured (packages, files, worker.py, configs).

Verify the file you care about exists (example):


ls /home/ubuntu
cat /home/ubuntu/worker.py | head








Create a custom AMI from the existing EC2



EC2 → Instances → select the configured instance (e.g.,...