diff --git a/changelogs/fragments/51602-ec2_instance_single_iface_description.yaml b/changelogs/fragments/51602-ec2_instance_single_iface_description.yaml new file mode 100644 index 00000000000..cffa4c6c105 --- /dev/null +++ b/changelogs/fragments/51602-ec2_instance_single_iface_description.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ec2_instance - Correctly adds description when adding a single ENI to the instance diff --git a/lib/ansible/modules/cloud/amazon/ec2_instance.py b/lib/ansible/modules/cloud/amazon/ec2_instance.py index 345b8660cc9..5b5a3f2144b 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_instance.py +++ b/lib/ansible/modules/cloud/amazon/ec2_instance.py @@ -860,6 +860,8 @@ def build_network_spec(params, ec2=None): ec2=ec2 ) spec['Groups'] = [g['GroupId'] for g in groups] + if network.get('description') is not None: + spec['Description'] = network['description'] # TODO more special snowflake network things return [spec]