diff --git a/changelogs/fragments/697-iam_role-replace-UpdateRoleDescription-with-UpdateRole.yml b/changelogs/fragments/697-iam_role-replace-UpdateRoleDescription-with-UpdateRole.yml new file mode 100644 index 00000000000..a31b43451d9 --- /dev/null +++ b/changelogs/fragments/697-iam_role-replace-UpdateRoleDescription-with-UpdateRole.yml @@ -0,0 +1,2 @@ +bugfixes: +- iam_role - Modified iam_role internal code to replace update_role_description with update_role (https://github.com/ansible-collections/community.aws/pull/697). diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index e95ed0afddf..f5699edf8b5 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -327,7 +327,7 @@ def update_role_description(connection, module, params, role): return True try: - connection.update_role_description(RoleName=params['RoleName'], Description=params['Description'], aws_retry=True) + connection.update_role(RoleName=params['RoleName'], Description=params['Description'], aws_retry=True) except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e: module.fail_json_aws(e, msg="Unable to update description for role {0}".format(params['RoleName'])) return True