astro env connection create

This command is only available on Astro.

Create an Airflow connection managed through the Astro Environment Manager. You can scope the connection to a Workspace or a Deployment.

Usage

$astro env connection create

Options

OptionDescriptionPossible Values
-k,--keyThe connection key. Required.Any string
-t,--typeThe connection type, for example postgres or http.Any valid Airflow connection type
--hostThe connection host.Any string
-l,--loginThe connection login or username.Any string
-p,--passwordThe connection password. If omitted alongside --type, the CLI reads it from stdin when piped, or prompts for it with the input hidden.Any string
--portThe connection port.Any valid port number
--schemaThe connection schema.Any string
--extraExtra configuration, defined as a stringified JSON object.A stringified JSON object
--auto-linkWorkspace scope only. Automatically link the connection to all Deployments in the Workspace, including future ones.None
--workspace-idSet the Workspace scope. Mutually exclusive with --deployment-id. Defaults to your current Workspace from CLI context.Any valid Workspace ID
--deployment-idSet the Deployment scope. Mutually exclusive with --workspace-id.Any valid Deployment ID

Examples

$# Create a Postgres connection scoped to a Workspace
$astro env connection create --workspace-id <workspace-id> --key db_main --type postgres --host db.example.com --port 5432 --login admin
$
$# Create a Workspace connection auto-linked to every Deployment, reading the password from stdin
$echo "$DB_PASSWORD" | astro env connection create --workspace-id <workspace-id> --key db_main --type postgres --host db.example.com --port 5432 --login admin --schema public --auto-link