# why template\_parameters is required to use the cloudformation module?

**URL:** <https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [November 18, 2013, 3:24pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928 "2013-11-18T15:24:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [November 18, 2013, 3:24pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/1 "2013-11-18T15:24:42Z")

</div>

Hi,

I have a clouformation template that is working with no parameters defined , it’s working with no problems with CloufFormation in the AWS console but in order to use it in Ansible it is required to have parameters defined.

If I don’t define any parameters in ansible I get the following error :

“”"

failed: [localhost] =\> {“failed”: true}  
msg: missing required arguments: template\_parameters

FATAL: all hosts have already failed – aborting

“”"

If I set a parameter value in Ansible for the same template I get :

“”"

failed: [localhost] =\> {“failed”: true}  
msg: {“Error”:{“Code”:“ValidationError”,“Message”:“Parameter values specified for a template which does not require them.”,“Type”:“Sender”},“RequestId”:“9b84302e-5064-11e3-bb60-872966d33ed4”}

FATAL: all hosts have already failed – aborting

“”"

Why do we need to set parameters in Ansible if we can use templates with no parameters at all in AWS ? Is there a way to overcome this issue or maybe start considering to remove the template\_parameters as a required argument and make it optional ?

Regards,  
Nicolas.

---

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [November 18, 2013, 4:42pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/2 "2013-11-18T16:42:56Z")

</div>

Nicolas,

This is a very good question. I'm the module's original author. When  
I wrote it, I didn't foresee people using CloudFormation templates  
without parameters. That was short-sighted. Please feel free to  
submit a pull request adding this feature.

Thanks,

James

---

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [November 18, 2013, 4:58pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/3 "2013-11-18T16:58:36Z")

</div>

hi James,

At the moment I don’t have the knowledge and the time for the learning curve to write code and submit a pull request but hopefully I’ll be able to do that in the future as I’m planning to write my own modules at some point.

If anyone else willing to submit a pull request, besides removing the template parameters another good improvement will be to remove them completely when the state=absent as they don’t have any use at all when you delete a stack.

Thanks for this module James, it works really good 😉

---

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [November 19, 2013, 4:24am UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/4 "2013-11-19T04:24:31Z")

</div>

Nicolas,

File a feature request on github, and if/when I have time, I will try  
to make an attempt at it.

Thanks,

James

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [November 19, 2013, 1:26pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/5 "2013-11-19T13:26:33Z")

</div>

Sounds like all is required is to make it required/False and then if set to None, set to {} ?

---

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [November 19, 2013, 3:50pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/6 "2013-11-19T15:50:49Z")

</div>

That should work.

---

<div class="post-metadata">

**Author:** ![James\_Martin2](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@James\_Martin2](https://forum.ansible.com/u/James_Martin2)\
**Post date:** [November 19, 2013, 7:28pm UTC](https://forum.ansible.com/t/why-template-parameters-is-required-to-use-the-cloudformation-module/13928/7 "2013-11-19T19:28:28Z")

</div>

Nicolas,

A time-fairy appeared and granted me a few minutes 🙂

Feel free to try this: [https://github.com/ansible/ansible/pull/4968](https://github.com/ansible/ansible/pull/4968).  
Please comment on that pull request if it works for you.

Thanks

James
