Deletes the specified SSH public key.
The SSH public key deleted by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see Set up CodeCommit for SSH connections in the CodeCommit User Guide.
Parameters:
-
user_name
(userNameType)
–
The name of the IAM user associated with the SSH public key.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-
-
ssh_public_key_id
(publicKeyIdType)
–
The unique identifier for the SSH public key.
This parameter allows (through its regex pattern) a string of characters that can consist of any upper or lowercased letter or digit.
Raises:
-
NoSuchEntityException
–
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_iam/_services/iam.py
| def delete_ssh_public_key(
self,
user_name: "capo_iam.types.user_name_type.userNameType",
ssh_public_key_id: "capo_iam.types.public_key_id_type.publicKeyIdType",
*,
config_overrides: Optional[IAMClientConfig] = None,
) -> None:
"""<p>Deletes the specified SSH public key.</p> <p>The SSH public key deleted by this operation is used only for authenticating the associated IAM user to an CodeCommit repository. For more information about using SSH keys to authenticate to an CodeCommit repository, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-credentials-ssh.html">Set up CodeCommit for SSH connections</a> in the <i>CodeCommit User Guide</i>.</p>
Args:
user_name: <p>The name of the IAM user associated with the SSH public key.</p> <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
ssh_public_key_id: <p>The unique identifier for the SSH public key.</p> <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters that can consist of any upper or lowercased letter or digit.</p>
Raises:
capo_iam.errors.no_such_entity_exception.NoSuchEntityException: <p>The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.</p>
capo_iam.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_iam.types.delete_ssh_public_key_request.DeleteSSHPublicKeyRequest]",
) -> OperationResponse[None]:
import capo_iam._operations.aws_identity_management_v20100508.delete_ssh_public_key
output, http_response = (
capo_iam._operations.aws_identity_management_v20100508.delete_ssh_public_key.delete_ssh_public_key(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteSSHPublicKey")
)
input_: capo_iam.types.delete_ssh_public_key_request.DeleteSSHPublicKeyRequest = {
"user_name": user_name,
"ssh_public_key_id": ssh_public_key_id,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|