If you only want to change the security group's rules you don't need to delete and recreate it, that can be changed on the fly with ansible, just change the rules configuration. As far as I know you would only need to destroy and recreate it to change the description.
As for Brian's suggestion, you can only reassign security groups on instances inside a VPC (the provided sample seems to be for EC2 Classic). If you really need to recreate a security group in EC2 Classic, then new instances will need to be created as well. -- Ivan Sichmann Freitas -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAG2tFJwf77p4GEUSGUO1Bo%3D1pA1pwqPHZU4UOxAhNnfgTRSUYQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
