def do_terminateInstance(self,args):
parser = CommandArgumentParser("<STR_LIT>")<EOL>parser.add_argument(dest='<STR_LIT>',help='<STR_LIT>');<EOL>args = vars(parser.parse_args(args))<EOL>instanceId = args['<STR_LIT>']<EOL>try:<EOL><INDENT>index = int(instanceId)<EOL>instances = self.scalingGroupDescription['<STR_LIT>'][<NUM_LIT:0>]['<STR_LIT>']<EOL>instanceId = instances[index]<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>client = AwsConnectionFactory.getEc2Client()<EOL>client.terminate_instances(InstanceIds=[instanceId['<STR_LIT>']])<EOL>self.do_printInstances("<STR_LIT>")<EOL>
Terminate an EC2 instance