Docs

amfelt add target

Add a target data platform to the project configuration.

Adds a named target to the project configuration file. The plugin argument specifies the target plugin name (e.g. postgres). Connection details are supplied as flags. Use --force to overwrite an existing target with the same name.

A login given with --user and --password is stored, together with the rest of the connection, in the control-plane vault under <environment>/database/<project id>/<name>, where the project and its environment are the control-plane project this host bound the file to when it pulled it, and amfelt.yaml records only that vault reference. This needs a registered agent that can reach the control plane, a file pulled onto this host, and --host, --database, --user and --password. The port is stored too: --port, or else the plugin’s default port (5432 for postgres), and a plugin with no known default needs --port. When the vault does not take the login, nothing is written. With --force an existing vault secret is overwritten. An agent with no control plane passes --store-login-in-file to keep the login in amfelt.yaml instead; commit refuses to push a file in which a target holds a login.

A login that the project file holds, such as one an agent older than v4.18.2 wrote there, moves to the vault when add-target is run again for that target with --force and its connection, --user and --password included. The file then keeps only the reference.

Usage  

amfelt add-target [name] [plugin] [flags]

Examples  

add-target dwh postgres --path pcf/PCF-postgres.yaml --host localhost --port
5436 --database dwh --user dwh --password dwh --sslmode disable

Flags  

FlagTypeDefaultDescription
--databasestring—name of the database on the target server
--db-pathstring—absolute path to the target database file (for file-based targets like DuckDB)
--forceboolfalseignore warnings and errors
--hoststring—hostname or IP address of the target database server; required with --user and --password unless --store-login-in-file is given
--passwordstring—password for the target database connection; stored with the rest of the connection in the control-plane vault, and amfelt.yaml records only the vault reference (see --store-login-in-file)
--pathstringamfelt.yamlpath of the Amfelt project file
--portstring—port number of the target database server; with --user and --password it is stored in the vault, and when it is omitted the plugin’s default port is stored (5432 for postgres)
--secret-refstring—vault reference path for credentials (e.g. development/database/<project-id>/my-db); skips inline credentials
--sslmodestring—SSL mode for the target database connection (e.g. disable, require)
--store-login-in-fileboolfalsekeep the --user and --password login in amfelt.yaml instead of the vault, for an agent with no control plane; the login is then stored in plain text in that file, and commit refuses to push the file while it holds the login
--userstring—username for the target database connection; stored with the rest of the connection in the control-plane vault, and amfelt.yaml records only the vault reference (see --store-login-in-file)

Global flags  

FlagTypeDefaultDescription
--amfelt-dirstring.amfeltdirectory for workspace files (such as plugins); does not move agent identity (controlled by AMFELT_DIR)
--configstring—directory or filename of the application configuration
-f, --formatstringdefaultlog format to use; either default, pretty, or json
-l, --levelstringinfominimum log level to display; either error, warn, info, or debug
-v, --verboseboolfalsetrigger to use verbose logging

Generated from amfelt v5.6.3.


Last updated on November 1, 2026