How to overwrite Existing AWS EC2 AMI with Packer?

USING FORCE_DEREGISTER ADDED IN V1.1.2, IT WAS VERIFIED WHETHER AWS EC2 AMI CAN BE OVERWRITTEN. THE PROCESS IS TO DELETE THE AMI WITH THE SAME NAME AND THEN CREATE A NEW AMI. IN THIS VERIFICATION, BY USING FORCE_DELETE_SNAPSHOT TOGETHER, DO NOT LEAVE GARBAGE OF OLD AMI.

Here is the sample programs for overwrite Existing AWS EC2 AMI with Packer

ec2.json file with (force_deregister,force_delete_snapshot)