Skip to content

ImportSshPublicKey

Source: src/AWS/Transfer/ImportSshPublicKey.ts

Runtime binding for transfer:ImportSshPublicKey.

Registers an additional SSH public key on the bound User — the key-rotation half of a self-service credential portal. The ServerId and UserName are injected from the binding; only the public key body is passed at runtime. Returns the new SshPublicKeyId for later DeleteSshPublicKey. Importing a key that is already registered fails with the typed ResourceExistsException. Provide the implementation with Effect.provide(AWS.Transfer.ImportSshPublicKeyHttp).

// init — bind the operation to the user
const importSshPublicKey = yield* AWS.Transfer.ImportSshPublicKey(user);
// runtime
const { SshPublicKeyId } = yield* importSshPublicKey({
SshPublicKeyBody: "ssh-ed25519 AAAA…",
});