Simple CLI boto3 wrapper to terminate your EC2 instances by name tag.
The boto3 library is required to run the script.
This script takes one positional argument as the instance name and prompts for a terminate confirmation.
You can make it executable:
chmod -x terminate-instance.py
./terminate_instance.py my-instance-name-tagOr call it directly:
python3 terminate-instance.py my-instance-name-tagThe help argument also contains the basic usage instructions:
python3 terminate-instance.py --help