> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW CREATE EXTERNAL CONNECTION

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

You can use external connections to specify and interact with resources that are external from CockroachDB. When creating an external connection, you define a name for an external connection while passing the provider URI and query parameters. `SHOW CREATE EXTERNAL CONNECTION` displays the connection name and the creation statements for active external connections.

You can also use the following SQL statements to work with external connections:

* <InternalLink path="create-external-connection">`CREATE EXTERNAL CONNECTION`</InternalLink>
* <InternalLink path="show-external-connection">`SHOW EXTERNAL CONNECTION`</InternalLink>
* <InternalLink path="drop-external-connection">`DROP EXTERNAL CONNECTION`</InternalLink>

## Required privileges

Without the `admin` role, users can only view the external connections that they own. Users own external connections that they have created with `CREATE EXTERNAL CONNECTION`.

Users with the <InternalLink path="security-reference/authorization#admin-role">`admin` role</InternalLink> can view all external connections with `SHOW CREATE EXTERNAL CONNECTION`.

## Synopsis

<img src="https://mintcdn.com/cockroachlabs/gtjMfbHiKZTUwAsm/images/sql-diagrams/v25.2/show_create_external_connections.svg?fit=max&auto=format&n=gtjMfbHiKZTUwAsm&q=85&s=ac6a7cc92bc5a0ed430dbec992ff8238" alt="show_create_external_connections syntax diagram" style={{maxWidth: "100%", overflowX: "auto"}} width="649" height="81" data-path="images/sql-diagrams/v25.2/show_create_external_connections.svg" />

<img src="https://mintcdn.com/cockroachlabs/AuLA5JIPpNnT7nbC/images/generated/docs/v25.2/show-create-external-connection/syntax-diagram-68422502540d.svg?fit=max&auto=format&n=AuLA5JIPpNnT7nbC&q=85&s=071869af575fea6ea1e316913c651938" alt="SQL syntax diagram" width="649" height="81" data-path="images/generated/docs/v25.2/show-create-external-connection/syntax-diagram-68422502540d.svg" />

### Parameters

| Parameter          | Description                                                          |
| ------------------ | -------------------------------------------------------------------- |
| `connection\_name` | The name of the external connection to pass in operation statements. |

## Examples

### Show all external connection create statements

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
SHOW CREATE ALL EXTERNAL CONNECTIONS;
```

This will return a list of of active external connection names along with the `CREATE EXTERNAL CONNECTION` statements that were used to create them, including the **unredacted** URI:

```text theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
  connection_name |                                                                              create_statement
------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
backup_bucket_1   | CREATE EXTERNAL CONNECTION 'backup_bucket' AS 's3://bucket_name?AWS_ACCESS_KEY_ID={access key}&AWS_SECRET_ACCESS_KEY={secret access key}'
backup_bucket_2   | CREATE EXTERNAL CONNECTION 'backup_bucket_2' AS 's3://bucket_name?AWS_ACCESS_KEY_ID={access key}&AWS_SECRET_ACCESS_KEY={secret access key}'
kafka             | CREATE EXTERNAL CONNECTION 'kafka' AS 'kafka://broker.address.com:9092?topic_prefix=bar_&tls_enabled=true&ca_cert={certificate}&sasl_enabled=true&sasl_user={sasl user}&sasl_password={url-encoded password}&sasl_mechanism=SCRAM-SHA-256'
(4 rows)
```

### Show an external connection create statement

To display the `CREATE` statement for a specific external connection, pass the name of the connection similar to the following:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
SHOW CREATE EXTERNAL CONNECTION backup_bucket_1;
```

```text theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
connection_name   |                                                         create_statement
------------------+-------------------------------------------------------------------------------------------------------------------------------------------
backup_bucket_1   | CREATE EXTERNAL CONNECTION 'backup_bucket' AS 's3://bucket_name?AWS_ACCESS_KEY_ID={access key}&AWS_SECRET_ACCESS_KEY={secret access key}'
```

## See also

* <InternalLink path="use-cloud-storage">Use Cloud Storage</InternalLink>
* <InternalLink path="changefeed-sinks">Changefeed Sinks</InternalLink>
