import_key_pair
async
¶
import_key_pair(
key_pair_name: ResourceName,
public_key_base64: Base64,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = None,
) -> ImportKeyPairResult
Imports a public SSH key from a specific key pair.
Parameters:
-
key_pair_name(ResourceName) –The name of the key pair for which you want to import the public key.
-
public_key_base64(Base64) –A base64-encoded public key of the
ssh-rsatype.
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
AccountSetupInProgressException–Lightsail throws this exception when an account is still in the setup in progress state.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.