# updating an AWS security group?

**URL:** <https://forum.ansible.com/t/updating-an-aws-security-group/27692>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 2, 2018, 11:56pm UTC](https://forum.ansible.com/t/updating-an-aws-security-group/27692 "2018-06-02T23:56:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [June 2, 2018, 11:56pm UTC](https://forum.ansible.com/t/updating-an-aws-security-group/27692/1 "2018-06-02T23:56:56Z")

</div>

I have a need to add a rule to a security group. The security group was not created using Ansible.

The rule format returned by ec2\_group\_facts is very different to the rule format used by ec2\_group. This means I cannot do the obvious thing of reading in the current rules, appending my own, and then writing them all back to the original group. At least not without a very complicated rewrite of the data structure coming from ec2\_group\_facts.

Does anyone have better idea (or has anyone already done the conversion)?

Someone called Simon Tyler had the same question only a month or so ago (search for "How to export from _ec2\_group\_facts_ and import into _ec2\_group"_), but I saw no responses.

Regards, K.
