Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion connections/aws-iam.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ A region that answers with an error keeps its own line and leaves the others run

## Setting up

In the connection form, set **Authentication** to one of the AWS IAM options. The **Password** field gives way to the AWS fields, and **Username** takes the IAM database user.
On **General**, set **Method** under **Authentication** to one of the AWS IAM options. The **Password** field gives way to the AWS fields, and **Username** takes the IAM database user.

<Frame caption="AWS IAM options in the connection form">
<img className="block dark:hidden" src="/images/aws-iam-authentication-fields.png" alt="Connection form with Authentication set to AWS IAM (Profile)" />
Expand Down
26 changes: 13 additions & 13 deletions connections/cloud-sql-proxy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import HelperPort from "/snippets/helper-port.mdx";

One field carries the whole setup: the instance connection name, `project:region:instance`, which is on the instance's overview page in the Google Cloud console. The proxy itself runs as a child process, started on connect and killed on disconnect.

<Frame caption="Cloud SQL Auth Proxy selected on the Network tab">
<Frame caption="Cloud SQL Auth Proxy selected on the SSH & Proxies pane">
<img className="block dark:hidden" src="/images/cloud-sql-proxy-pane.png" alt="Instance connection name, authentication and local listener fields" />
<img className="hidden dark:block" src="/images/cloud-sql-proxy-pane-dark.png" alt="Instance connection name, authentication and local listener fields" />
</Frame>
Expand All @@ -20,7 +20,7 @@ The transport appears for Cloud SQL instances running MySQL, PostgreSQL, or SQL
gcloud auth application-default login
```

Install the binary, or click **Download cloud-sql-proxy** on the Network tab, which fetches 2.23.0 and checks its SHA-256 against the value pinned for your CPU architecture. A bar shows the download, and **Cancel** stops it. Connecting with no binary installed downloads the same one first, and the connecting card says **Downloading Cloud SQL Auth Proxy** while it does.
Install the binary, or click **Download** beside **Path** on the **SSH & Proxies** pane, which fetches 2.23.0 and checks its SHA-256 against the value pinned for your CPU architecture. A bar reading **Downloading cloud-sql-proxy** shows the download, and **Cancel** stops it. Connecting with no binary installed downloads the same one first, and the connecting card says **Downloading Cloud SQL Auth Proxy** while it does.

```bash
brew install cloud-sql-proxy
Expand All @@ -32,27 +32,27 @@ Auto-detection covers your `PATH`, `/opt/homebrew/bin`, `/usr/local/bin`, and `~

<Steps>
<Step title="Choose the transport">
On the **Network** tab, set **Connect via** to **Cloud SQL Auth Proxy**. A connection uses one transport, so choosing this one switches off whichever was selected before.
On the **SSH & Proxies** pane, set **Connect Via** to **Cloud SQL Auth Proxy**. A connection uses one transport, so choosing this one switches off whichever was selected before.
</Step>
<Step title="Name the instance and pick credentials">
Enter the **Instance connection name**, then choose **Application Default Credentials** or **Service Account Key**.
Enter the **Instance Connection Name**, then set **Method** under **Authentication** to **Application Default Credentials** or **Service Account Key**.
</Step>
<Step title="Leave SSL Mode alone">
The proxy encrypts the leg to Cloud SQL and hands the driver plain loopback, so SSL/TLS stays off.
The proxy encrypts the leg to Cloud SQL and hands the driver plain loopback, so **SSL Mode** on the **SSL/TLS** pane stays off.
</Step>
<Step title="Test it">
On **General**, click **Test Connection**. **Host** and **Port** there are never dialed: the instance connection name decides where the proxy lands. **Username** and **Database** work as usual.
Click **Test Connection**. **Host** and **Port** on General are never dialed: the instance connection name decides where the proxy lands. **Username** and **Database** work as usual.
</Step>
</Steps>

## Options

| Option | What it does | Default |
|--------|--------------|---------|
| **Instance connection name** | `project:region:instance`. Three colon-separated parts, none empty, or the connect is refused outright. | - |
| **Credentials** | **Application Default Credentials**, or a **Service Account Key** pasted as JSON. | Application Default Credentials |
| **Use IAM database authentication** | Signs in as an IAM principal instead. Set **Username** to that principal, a user email or `name@project.iam` for a service account; the password goes unused. | Off |
| **Connect over private IP** | Reaches the instance on its private address instead of its public one. | Off |
| **Instance Connection Name** | `project:region:instance`. Three colon-separated parts, none empty, or the connect is refused outright. | - |
| **Method** | **Application Default Credentials**, or a **Service Account Key** pasted as JSON. | Application Default Credentials |
| **Use IAM Database Authentication** | Signs in as an IAM principal instead. Set **Username** to that principal, a user email or `name@project.iam` for a service account; the password goes unused. | Off |
| **Connect over Private IP** | Reaches the instance on its private address instead of its public one. | Off |
| **Path** | The `cloud-sql-proxy` binary. Blank auto-detects. | Blank |

A pasted key is kept in the macOS Keychain and written to a temporary file readable only by you while the proxy runs, then deleted. It never reaches the command line.
Expand All @@ -67,7 +67,7 @@ A pasted key is kept in the macOS Keychain and written to a temporary file reada

When the instance is already reachable, over its private IP or an authorized network, you can skip the proxy and sign in as an IAM principal directly. This works for MySQL and PostgreSQL.

On the **General** tab, set **Authentication** to one of:
On **General**, set **Method** under **Authentication** to one of:

- **Google Cloud IAM (Application Default)**: the credentials from `gcloud auth application-default login`.
- **Google Cloud IAM (Service Account)**: a **Service Account Key**, as a file path or pasted JSON.
Expand All @@ -91,15 +91,15 @@ gcloud sql users create name@example.com --instance=INSTANCE --type=cloud_iam_us
`GOOGLE_APPLICATION_CREDENTIALS` is read from the app's environment, which never has the variables your shell profile exports. To use a key file, choose **Service Account** and give its path.
</Note>

These options also work with **Connect via > Cloud SQL Auth Proxy**. SSL then stays as set, because the proxy encrypts the connection to the instance.
These options also work with **Connect Via** set to **Cloud SQL Auth Proxy**. SSL then stays as set, because the proxy encrypts the connection to the instance.

A connection synced to an iPhone or iPad keeps its method, and **Application Default** there needs a service account key for that device: see [IAM sign-in](/ios#iam-sign-in).

## Troubleshooting

### cloud-sql-proxy was not found

Install it with `brew install cloud-sql-proxy`, download it from the Network tab, or set **Path**.
Install it with `brew install cloud-sql-proxy`, click **Download** on the **SSH & Proxies** pane, or set **Path**.

### The proxy did not become ready in time

Expand Down
12 changes: 6 additions & 6 deletions connections/cloudflare-tunnel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import HelperPort from "/snippets/helper-port.mdx";

The Access application is yours to create, in the Cloudflare dashboard. The **Cloudflare Tunnel** transport takes the hostname of one that already fronts the database, and runs `cloudflared` against it for the life of the connection.

<Frame caption="Cloudflare Tunnel selected on the Network tab">
<Frame caption="Cloudflare Tunnel selected on the SSH & Proxies pane">
<img className="block dark:hidden" src="/images/cloudflare-tunnel-pane.png" alt="Access hostname, authentication method and local listener fields" />
<img className="hidden dark:block" src="/images/cloudflare-tunnel-pane-dark.png" alt="Access hostname, authentication method and local listener fields" />
</Frame>
Expand All @@ -26,13 +26,13 @@ The form looks on your `PATH` and in `/opt/homebrew/bin` and `/usr/local/bin`, a

<Steps>
<Step title="Choose the transport">
On the **Network** tab, set **Connect via** to **Cloudflare Tunnel**. A connection uses one transport, so choosing this one switches off whichever was selected before.
On the **SSH & Proxies** pane, set **Connect Via** to **Cloudflare Tunnel**. A connection uses one transport, so choosing this one switches off whichever was selected before.
</Step>
<Step title="Enter the hostname and sign in">
**Hostname** is the Access application's public hostname, `db.example.com` in the example. With **Browser Sign-In** chosen, click **Sign In with Browser…** so the first connect does not stop to ask.
**Hostname**, under **Access Application**, is the application's public hostname, `db.example.com` in the example. With **Method** on **Browser Sign-In**, click **Sign In with Browser…** so the first connect does not stop to ask.
</Step>
<Step title="Test it">
On **General**, click **Test Connection**. **Host** and **Port** there are never dialed while the tunnel is on: the Access application decides where it lands.
Click **Test Connection**. **Host** and **Port** on General are never dialed while the tunnel is on: the Access application decides where it lands.
</Step>
</Steps>

Expand All @@ -51,10 +51,10 @@ Disconnecting or quitting stops the process. One orphaned by a crash is reaped a
| Option | What it does | Default |
|--------|--------------|---------|
| **Hostname** | The Access application hostname `cloudflared` connects to. | - |
| **Expose to local network** | Binds `0.0.0.0` rather than `127.0.0.1`. | Off |
| **Expose to Local Network** | Binds `0.0.0.0` rather than `127.0.0.1`. | Off |

<Warning>
With **Expose to local network** on, anything that reaches the port is past Cloudflare Access on your session and faces only the database's own login.
With **Expose to Local Network** on, anything that reaches the port is past Cloudflare Access on your session and faces only the database's own login.
</Warning>

### Authentication
Expand Down
Loading
Loading