ruby/example_code/iam/iam-ruby-example-server-certificates.rb
# Deletes a server certificate in
# AWS Identity and Access Management (IAM).
#
# Prerequisites:
#
# - The server certificate in IAM.
#
# @param iam_client [Aws::IAM::Client] An initialized IAM client.
# @param server_certificate_name [String] The name of the server certificate.
# @return [Boolean] true if the server certificate was deleted;
#   otherwise, false.
# @example
#   exit 1 unless server certificate_deleted?(
#     Aws::IAM::Client.new,
#     'my-server-certificate'
#   )

Deletes a server certificate in
AWS Identity and Access Management (IAM).



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