Skip to content

DeleteSshPublicKey

Source: src/AWS/Transfer/DeleteSshPublicKey.ts

Runtime binding for transfer:DeleteSshPublicKey.

Removes an SSH public key from the bound User by SshPublicKeyId (returned by ImportSshPublicKey or listed via DescribeUser) — the revocation half of key rotation. The ServerId and UserName are injected from the binding. Deleting a key that no longer exists fails with the typed ResourceNotFoundException. Provide the implementation with Effect.provide(AWS.Transfer.DeleteSshPublicKeyHttp).

// init — bind the operation to the user
const deleteSshPublicKey = yield* AWS.Transfer.DeleteSshPublicKey(user);
// runtime
yield* deleteSshPublicKey({ SshPublicKeyId: keyId }).pipe(
Effect.catchTag("ResourceNotFoundException", () => Effect.void),
);