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

# astro env connection update

<Info>
  This command is only available on Astro.
</Info>

Update an existing Airflow connection, identified by its ID or key. Provide only the fields you want to change.

## Usage

```bash wrap theme={null}
astro env connection update <id-or-key>
```

## Options

| Option            | Description                                                                                                                              | Possible Values                   |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| `<id-or-key>`     | The ID or key of the connection to update.                                                                                               | Any valid connection ID or key    |
| `-t`,`--type`     | The connection type, for example `postgres` or `http`.                                                                                   | Any valid Airflow connection type |
| `--host`          | The connection host.                                                                                                                     | Any string                        |
| `-l`,`--login`    | The connection login or username.                                                                                                        | Any string                        |
| `-p`,`--password` | The connection password. If omitted alongside `--type`, the CLI reads it from stdin when piped, or prompts for it with the input hidden. | Any string                        |
| `--port`          | The connection port.                                                                                                                     | Any valid port number             |
| `--schema`        | The connection schema.                                                                                                                   | Any string                        |
| `--extra`         | Extra configuration, defined as a stringified JSON object.                                                                               | A stringified JSON object         |
| `--auto-link`     | Workspace scope only. Automatically link the connection to all Deployments in the Workspace, including future ones.                      | None                              |
| `--workspace-id`  | Set the Workspace scope. Mutually exclusive with `--deployment-id`. Defaults to your current Workspace from CLI context.                 | Any valid Workspace ID            |
| `--deployment-id` | Set the Deployment scope. Mutually exclusive with `--workspace-id`.                                                                      | Any valid Deployment ID           |

## Examples

```bash wrap theme={null}
# Update only the host of a Workspace connection
astro env connection update db_main --workspace-id <workspace-id> --type postgres --host db-new.example.com
```

## Related commands

* [`astro env connection create`](/docs/cli/v1.43/astro-env-connection-create)
* [`astro env connection get`](/docs/cli/v1.43/astro-env-connection-get)
* [`astro env connection list`](/docs/cli/v1.43/astro-env-connection-list)
