From cb1b09aac2c0405a19f3a7b0e6c86b4985e44349 Mon Sep 17 00:00:00 2001 From: Adrian Plummer <50164464+aplummerunsw@users.noreply.github.com> Date: Tue, 1 Dec 2020 19:57:59 +1100 Subject: [PATCH] Use 'fail_json_aws' in the tags_need_modify check In reference to issue #210 ec2_group: error returned does not return AWS insufficient permissions error when adding tags --- plugins/modules/ec2_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/ec2_group.py b/plugins/modules/ec2_group.py index ae3be9311de..b51a91a0c9f 100644 --- a/plugins/modules/ec2_group.py +++ b/plugins/modules/ec2_group.py @@ -899,7 +899,7 @@ def update_tags(client, module, group_id, current_tags, tags, purge_tags): try: client.create_tags(Resources=[group_id], Tags=ansible_dict_to_boto3_tag_list(tags_need_modify)) except (BotoCoreError, ClientError) as e: - module.fail_json(e, msg="Unable to add tags {0}".format(tags_need_modify)) + module.fail_json_aws(e, msg="Unable to add tags {0}".format(tags_need_modify)) return bool(tags_need_modify or tags_to_delete)