Your agent can prepare the connection and required grants. A person with access to the bastion verifies its host identity, and an authorized operator applies the provider permissions.
Connect from the CLI
With the Struct CLI, first read the bastion’s host key fingerprint. Struct reads it without logging in:--trust-host-key, the SSH password in SSH_PASSWORD and the database password in PGPASSWORD (or PLANETSCALE_PASSWORD):Without
--trust-host-key, or if the bastion presents a different key, Struct stops before sending any credential to the bastion, saves nothing, and exits with code 3 (ssh_host_key_needed or ssh_host_key_changed). The message, and the sshHostKeyFingerprint field with --json, give the fingerprint Struct read: check it, then run the command again with it.To move a saved connection to another bastion, use struct connections rotate <id> with the new SSH flags, the passwords again and --trust-host-key. --ssh-via none removes the tunnel.Host key check
Compare the returned fingerprint with the bastion’s own key through a trusted administrative connection:Network and permissions
The bastion must allow TCP forwarding and reach the database. For an EC2 Instance Connect Endpoint, allow SSH from the endpoint security group and keep Preserve Client IP off. Endpoint grants are scoped to the endpoint and port; use provider network policy to restrict which private targets are reachable. Use the connection’s grant instructions for the intended instance and user.Database TLS still uses the database hostname and configured SSL mode through the tunnel. Supply database and SSH secrets through their documented environment variables, never checked-in files or literal command arguments.For EC2 Instance Connect, the AWS role Struct assumes needs ec2-instance-connect:SendSSHPublicKey on the bastion instance, plus ec2-instance-connect:OpenTunnel on the endpoint when it sits behind an EC2 Instance Connect Endpoint.EC2 Instance Connect
Push a one-time SSH key to the bastion and open a tunnel through an EC2 Instance Connect Endpoint, so no SSH key is stored.- Struct shows a policy scoped to your instance, OS user, endpoint and port when you set up the tunnel.
2026-11-04.1. See permission changes.