Create a new SSH tunnel. The tunnel is created but not started. Requires a valid test_token from a successful test-connection call. A target_id links the tunnel to that PostgreSQL target and takes the forwarded endpoint from its connection string, as PATCH does. A target that cannot be linked is rejected before the tunnel is saved. remote_host and remote_port set the forwarded endpoint and win over the endpoint of the linked target.
Requires name, ssh_host, ssh_user, ssh_key_id and test_token. Attach targets via ssh_tunnel_id on the target (or target_id here for PostgreSQL).
Request body application/json · CreateSSHTunnelRequest
SSH tunnel creation request
Token from successful test-connection
Host the tunnel forwards to, as seen from the bastion. Set together with remote_port. A value wins over the endpoint of the linked target.
Port the tunnel forwards to. Set together with remote_host.
Password for sudo operations on remote server
PostgreSQL target to link the tunnel to. The forwarded endpoint is taken from its connection string.
Responses
Created
SSHTunnelResponse · 18 fields
Reason of the last failure of the tunnel in Principal's words. Never a driver or dial error
Reason of the last failed health check, or of the failed reconnects of a tunnel that stopped because nobody used it
Always 0. Principal no longer opens a local port for a tunnel. Kept for wire compatibility.
SSH key the tunnel signs in with. Omitted when the tunnel has no key.
disconnectedconnectingconnectedfailedThe target to link was not found
Mutations of the target to link are paused
Common errors: 400 401 403 413 429 503 504. They mean the same for every operation, see Errors.