Hi@akhtar,
We can create and modify an EC2 instance using boto3 also provided a method to terminate instances that are no longer required. If the following code sample is saved in a python file ec2.py,
import boto3, sys
ec2 = boto3.resource('ec2')
# iterate through instance IDs and terminate them
for id in sys.argv[1:]:
instance = ec2.Instance(id)
print(instance.terminate())