Is there a way to clone an ec2 from inside the ec2 terminal?
Yes, it can be done.

You can either create an IAM instance role which allows the instance to use ec2 actions such as "create-image" or you can create an IAM user and create for this user access and secret keys and a policy which allows this user to create images in ec2 and then configure the access and secret keys locally on the server using the "aws configure" command.

Whatever method you choose from the above options, the next step would be from within the instance itself and assuming you have aws-cli installed in the instance, first run:

ec2-metadata -i to get the instance id.

and then run:

aws ec2 create-image --instance-id INSTANCEID --name NameOfImage --no-reboot --region REGION


And it will create an image of this instance in the region you provided without rebooting the instance.

The create-image command will create an image of the instance, also called AMI which then you can use to create new instances from.