Skip to content

IAM  >  Operations  >  upload_ssh_public_key

upload_ssh_public_key

Operation

upload_ssh_public_key async

upload_ssh_public_key(input: UploadSSHPublicKeyInput, plugins: list[Plugin] | None = None) -> UploadSSHPublicKeyOutput

Uploads an SSH public key and associates it with the specified IAM user.

The SSH public key uploaded by this operation can be 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:

Name Type Description Default
input UploadSSHPublicKeyInput

An instance of UploadSSHPublicKeyInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
UploadSSHPublicKeyOutput

An instance of UploadSSHPublicKeyOutput.

Input

UploadSSHPublicKeyInput dataclass

Bases: _SerdeShape

Dataclass for UploadSSHPublicKeyInput structure.

Attributes

ssh_public_key_body class-attribute instance-attribute
ssh_public_key_body: str | None = ...
The SSH public key. The public key must be encoded in ssh-rsa format or
PEM format. The minimum bit-length of the public key is 2048 bits. For
example, you can generate a 2048-bit key, and the resulting PEM file is
1679 bytes long.

The [regex pattern](http://wikipedia.org/wiki/regex) used to validate
this parameter is a string of characters consisting of the following:

- Any printable ASCII character ranging from the space character
  (` `) through the end of the ASCII character range

- The printable characters in the Basic Latin and Latin-1 Supplement
  character set (through `ΓΏ`)

- The special characters tab (`     `), line feed (`

), and carriage return ( `)

user_name class-attribute instance-attribute
user_name: str | None = ...

The name of the IAM user to associate the SSH public key with.

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: _+=,.@-

Output

UploadSSHPublicKeyOutput dataclass

Bases: _SerdeShape

Contains the response to a successful UploadSSHPublicKey request.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

ssh_public_key class-attribute instance-attribute
ssh_public_key: SSHPublicKey | None = ...

Contains information about the SSH public key.