'default', 'region' => 'us-west-2', 'version' => '2010-05-08' ]); try { $result = $client->getSSHPublicKey([ 'Encoding' => 'SSH', // REQUIRED 'SSHPublicKeyId' => 'SSH_PUBLIC_KEY_ID', // REQUIRED 'UserName' => 'IAM_USER_NAME', // REQUIRED ]); var_dump($result); } catch (AwsException $e) { // output error message if fails error_log($e->getMessage()); } // snippet-end:[iam.php.get_ssh_public_key.main] // snippet-end:[iam.php.get_ssh_public_key.complete]