mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31:26 -07:00
ec2_group: description is only required when group state is present (#19791)
* description is only required when group state is present also note that AWS requires a non-empty description when creating a security group * clarify description requirement
This commit is contained in:
parent
e0d38fb137
commit
8e910cce8a
2 changed files with 23 additions and 7 deletions
|
@ -34,8 +34,8 @@ options:
|
|||
required: true
|
||||
description:
|
||||
description:
|
||||
- Description of the security group.
|
||||
required: true
|
||||
- Description of the security group. Required when C(state) is C(present).
|
||||
required: false
|
||||
vpc_id:
|
||||
description:
|
||||
- ID of the VPC to create the group in.
|
||||
|
@ -242,7 +242,7 @@ def main():
|
|||
argument_spec = ec2_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name=dict(type='str', required=True),
|
||||
description=dict(type='str', required=True),
|
||||
description=dict(type='str', required=False),
|
||||
vpc_id=dict(type='str'),
|
||||
rules=dict(type='list'),
|
||||
rules_egress=dict(type='list'),
|
||||
|
@ -269,6 +269,9 @@ def main():
|
|||
purge_rules = module.params['purge_rules']
|
||||
purge_rules_egress = module.params['purge_rules_egress']
|
||||
|
||||
if state == 'present' and not description:
|
||||
module.fail_json(msg='Must provide description when state is present.')
|
||||
|
||||
changed = False
|
||||
|
||||
ec2 = ec2_connect(module)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue