ruby/example_code/iam/iam-ruby-example-manage-users.rb
def user_deleted?(iam_client, user_name)
  iam_client.delete_user(user_name: user_name)
  return true
rescue StandardError => e
  puts "Error deleting user: #{e.message}"
  return false
end
# Deletes a user in AWS Identity and Access Management (IAM).
#
# Prerequisites:
# - The user in IAM.
#
# @param iam_client [Aws::IAM::Client] An initialized IAM client.
# @param user_name [String] The name of the user.
# @return [Boolean] true if the user was deleted; otherwise, false.
# @example
#   exit 1 unless user_deleted?(Aws::IAM::Client.new, 'my-user')

Deletes a user in AWS Identity and Access Management (IAM).
Prerequisites:
The user in IAM.
Deletes a user in AWS Identity and Access Management ( IAM ) . Prerequisites : The user in IAM .
def user_deleted?(iam_client, user_name)
  iam_client.delete_user(user_name: user_name)
  return true
rescue StandardError => e
  puts "Error deleting user: #{e.message}"
  return false
end
def user_deleted? ( iam_client , user_name ) iam_client . delete_user ( user_name : user_name ) return true rescue StandardError => e puts "Error deleting user: #{e.message}" return false end
Deletes a user in AWS Identity and Access Management (IAM).
Deletes a user in AWS Identity and Access Management ( IAM ) .
true if the user was deleted; otherwise, false.
true if the user was deleted ; otherwise false .
Boolean
iam_client
An initialized IAM client.
An initialized IAM client .
user_name
The name of the user.
The name of the user .
example
exit 1 unless user_deleted?(Aws::IAM::Client.new, 'my-user')
exit 1 unless user_deleted? ( Aws :: IAM :: Client . new ' my - user ' )