ALTER EXTERNAL CONNECTION allows you to change the storage/sink URI that an external connection references.
You can use external connections to specify and interact with resources that are external to CockroachDB. When creating an external connection, you must define a name for the external connection while passing the provider URI and query parameters.
You can use ALTER EXTERNAL CONNECTION to update the connection string for an external connection to use a new authentication token. This allows you to rotate your auth token before the old token expires.
You can also use the following SQL statements to work with external connections:
Required privileges
To update an external connection, a user must have theUPDATE privilege on that connection.
For example:
Synopsis
Parameters
| Parameter | Description |
|---|---|
connection_name | The name of the existing external connection. |
connection_uri | The new storage/sink URI that the external connection will be updated to reference. |
Supported external storage and sinks
| Storage or sink | Operation support |
|---|---|
| Changefeeds | |
| Backups, restores, imports, exports, changefeeds | |
| Encrypted backups | |
| Backups, restores, imports, exports, changefeeds | |
| Changefeeds | |
| Changefeeds | |
| Changefeeds | |
| Backups, restores, imports, exports, changefeeds | |
| Encrypted backups | |
| Changefeeds | |
| Changefeeds | |
| Backups, restores, imports, exports, changefeeds | |
| connections | Physical cluster replication |
| Backups, restores, imports, exports, changefeeds | |
| Changefeeds |
Examples
Update the URI of an external connection
In this example, you update thebackup_bucket external connection to a new Amazon S3 URI to rotate your auth token.

