# Unable to terminate EC2 instance.

**URL:** <https://forum.ansible.com/t/unable-to-terminate-ec2-instance/25934>\
**Category:** Ansible Project\
**Created:** [November 6, 2017, 6:34am UTC](https://forum.ansible.com/t/unable-to-terminate-ec2-instance/25934 "2017-11-06T06:34:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PCHEL](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@PCHEL](https://forum.ansible.com/u/PCHEL)\
**Post date:** [November 6, 2017, 6:34am UTC](https://forum.ansible.com/t/unable-to-terminate-ec2-instance/25934/1 "2017-11-06T06:34:10Z")

</div>

Hi I am new to Ansible. Can anyone please help me with my script.

I get the error when I run the below script. I am able to create the instance however unable to terminate.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: `MissingParameter`The request must contain the parameter InstanceId8e1039f2-b905-4d6b-b727-4395feb9310c  
fatal: [localhost]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible\_7eh91W/ansible\_module\_ec2.py", line 1725, in \n main()\n File "/tmp/ansible\_7eh91W/ansible\_module\_ec2.py", line 1693, in main\n (changed, instance\_dict\_array, new\_instance\_ids) = terminate\_instances(module, ec2, instance\_ids)\n File "/tmp/ansible\_7eh91W/ansible\_module\_ec2.py", line 1354, in terminate\_instances\n for res in ec2.get\_all\_instances(instance\_ids):\n File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 585, in get\_all\_instances\n max\_results=max\_results)\n File "/usr/lib/python2.7/site-packages/boto/ec2/connection.py", line 681, in get\_all\_reservations\n [(‘item’, Reservation)], verb=‘POST’)\n File "/usr/lib/python2.7/site-packages/boto/connection.py", line 1186, in get\_list\n raise self.ResponseError(response.status, response.reason, body)\nboto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request\n\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>\n`MissingParameter`The request must contain the parameter InstanceId8e1039f2-b905-4d6b-b727-4395feb9310c\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 0}
