Skip to content

Commit

Permalink
Use 'fail_json_aws' in the tags_need_modify check
Browse files Browse the repository at this point in the history
In reference to issue ansible-collections#210 ec2_group: error returned does not return AWS insufficient permissions error when adding tags
  • Loading branch information
aplummerunsw authored Dec 1, 2020
1 parent 4ba6f2b commit cb1b09a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/modules/ec2_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit cb1b09a

Please sign in to comment.