diff --git a/lib/ansible/modules/cloud/amazon/rds.py b/lib/ansible/modules/cloud/amazon/rds.py old mode 100644 new mode 100755 index dd2a11e2afc..7e9836a51ef --- a/lib/ansible/modules/cloud/amazon/rds.py +++ b/lib/ansible/modules/cloud/amazon/rds.py @@ -931,11 +931,15 @@ def validate_parameters(required_vars, valid_vars, module): if module.params.get('security_groups'): params[sec_group] = module.params.get('security_groups').split(',') - if module.params.get('vpc_security_groups'): - groups_list = [] - for x in module.params.get('vpc_security_groups'): - groups_list.append(boto.rds.VPCSecurityGroupMembership(vpc_group=x)) - params["vpc_security_groups"] = groups_list + vpc_groups = module.params.get('vpc_security_groups') + if vpc_groups: + if has_rds2: + params['vpc_security_group_ids'] = vpc_groups + else: + groups_list = [] + for x in vpc_groups: + groups_list.append(boto.rds.VPCSecurityGroupMembership(vpc_group=x)) + params['vpc_security_groups'] = groups_list # Convert tags dict to list of tuples that rds2 expects if 'tags' in params: