ec2_group: Request a fresh group object after creation
When a group is created, an egress_rule ALLOW ALL to 0.0.0.0/0 is added automatically but it's not reflected in the object returned by the AWS API call. After creation we re-read the group for getting an updated object.
This commit is contained in:
parent
ad0ca929b5
commit
8bd25ee1a4
1 changed files with 6 additions and 0 deletions
|
@ -248,6 +248,12 @@ def main():
|
|||
'''no match found, create it'''
|
||||
if not module.check_mode:
|
||||
group = ec2.create_security_group(name, description, vpc_id=vpc_id)
|
||||
|
||||
# When a group is created, an egress_rule ALLOW ALL
|
||||
# to 0.0.0.0/0 is added automatically but it's not
|
||||
# reflected in the object returned by the AWS API
|
||||
# call. We re-read the group for getting an updated object
|
||||
group = ec2.get_all_security_groups(group_ids=(group.id,))[0]
|
||||
changed = True
|
||||
else:
|
||||
module.fail_json(msg="Unsupported state requested: %s" % state)
|
||||
|
|
Loading…
Reference in a new issue