workspace
A Powerpipe workspace
is a "profile" that allows you to define options for running Powerpipe.
workspace "default" { update_check = true log_level = "info" memory_max_mb = "2048" listen = "local"
}
workspace "my_server" { listen = "network" port = 9033 update_check = false memory_max_mb = 2048}
Powerpipe workspaces allow you to define multiple named configurations and easily switch between them using the --workspace
argument or POWERPIPE_WORKSPACE
environment variable.
powerpipe server --workspace my_server
To learn more, see Managing Workspaces →
Arguments
Argument | Default | Description |
---|---|---|
base | none | A reference to a named workspace resource that this workspace should source its definition from. Any argument can be overridden after sourcing via base. |
benchmark_timeout | 0 (no timeout) | Set the benchmark execution timeout, in seconds. |
dashboard_timeout | 0 (no timeout) | Set the dashboard execution timeout, in seconds. |
database | postgres://steampipe@ 127.0.0.1:9193/steampipe | DEPRECATED - See Setting the Database for the new syntax. A database connection string or Turbot Pipes workspace to use as the default database. The default is a local Steampipe instance. |
header | true | Enable or disable column headers. |
input | true | Enable/Disable interactive prompts for missing variables. To disable prompts and fail on missing variables, set it to false . This is useful when running from scripts. |
listen | network | Specifies the IP addresses on which powerpipe server will listen for connections from clients. Currently supported values are local (localhost only) or network (all IP addresses). |
log_level | off | Set the logging output level |
max_parallel | 10 | Set the maximum number of parallel executions. This is essentially a connection pool size; Powerpipe will attempt to run up to this many queries in parallel. |
memory_max_mb | 1024 | Set a memory soft limit for the powerpipe process. Set to 0 to disable the memory limit. |
output | pretty | Set the console output format: pretty , plain , yaml or json . |
pipes_host | pipes.turbot.com | Set the Turbot Pipes host for connecting to Turbot Pipes workspace. |
pipes_token | Token frompowerpipe login | Set the Turbot Pipes authentication token for connecting to a Turbot Pipes workspace. This may be a token obtained by powerpipe login or a user-generated token. |
port | 9033 | Specifies the TCP port on which powerpipe server will listen for connections from clients. |
progress | true | Enable or disable progress information. |
query_timeout | 300 | The maximum time (in seconds) a query is allowed to run before it times out. |
search_path | public , then alphabetical | A comma-separated list of connections to use as a custom search path for the control run. This setting only applies to Postgres databases (including Steampipe). |
search_path_prefix | none | A comma-separated list of connections to use as a prefix to the current search path for the control run. This setting only applies to Postgres databases (including Steampipe). |
separator | , | Set csv output separator. |
snapshot_location | Pipes user's workspace | Set the Turbot Pipes workspace or filesystem path for writing snapshots. |
telemetry | info | Set the telemetry level in Powerpipe: info or none |
timing | false | Enable or disable query execution timing. |
update_check | true | Enable or disable automatic update checking. |
watch | true | Watch .mod files for changes when running powerpipe server . |
Workspaces are defined using the workspace
block in one or more Powerpipe config files. Powerpipe will load ALL configuration files (*.ppc
) from every directory in the configuration search path, with decreasing precedence. The set of workspaces is the union of all workspaces defined in these directories.
The workspace named default
is special; If a workspace named default
exists, it will be used whenever the --workspace
argument is not passed to Powerpipe. Creating a default
workspace in ~/.powerpipe/config/workspaces.ppc
provides a way to set all defaults.
Note that the HCL argument names are the same as the equivalent CLI argument names, except using an underscore in place of a dash:
Workspace Argument | Environment Variable | Argument |
---|---|---|
benchmark_timeout | POWERPIPE_BENCHMARK_TIMEOUT | --benchmark-timeout |
dashboard_timeout | POWERPIPE_DASHBOARD_TIMEOUT | --dashboard-timeout |
database [DEPRECATED] | POWERPIPE_DATABASE | --database |
header | none | --header |
input | none | --input |
listen | POWERPIPE_LISTEN | --listen |
log_level | POWERPIPE_LOG_LEVEL | |
max_parallel | POWERPIPE_MAX_PARALLEL | --max-parallel |
memory_max_mb | POWERPIPE_MEMORY_MAX_MB | |
output | none | --output |
pipes_host | PIPES_HOST | --pipes-host |
pipes_token | PIPES_TOKEN | --pipes-token |
port | POWERPIPE_PORT | --port |
progress | none | --progress |
query_timeout | POWERPIPE_QUERY_TIMEOUT | --query_timeout |
search_path | none | --search-path |
search_path_prefix | none | --search-path-prefix |
separator | none | --separator |
snapshot_location | POWERPIPE_SNAPSHOT_LOCATION | --snapshot-location |
telemetry | POWERPIPE_TELEMETRY | |
timing | none | --timing |
update_check | POWERPIPE_UPDATE_CHECK | |
watch | none | --watch |
Examples
workspace "server" { listen = "network" port = 9033 update_check = false memory_max_mb = 2048 log_level = "info"}
workspace "default" { output = "pretty" update_check = true telemetry = "info" memory_max_mb = 1024}
workspace "dev_server" { base = workspace.server log_level = "debug" port = 9195}
workspace "pipes" { pipes_host = "vandelay.pipes.turbot.com" snapshot_location = "vandelay/latex"}
workspace "all_options" {
# Dashboard / API Server Options listen = "network" port = 9033 watch = true
# General Options telemetry = "info" update_check = true log_level = "info" memory_max_mb = "1024" input = true
# Pipes Integration Options pipes_host = "pipes.turbot.com" pipes_token = "tpt_999faketoken99999999_111faketoken1111111111111" snapshot_location = "acme/dev"
# DB Settings query_timeout = 300 max_parallel = 5
# Execution timeouts dashboard_timeout = 300 benchmark_timeout = 1800
# Search Path Settings (Postgres-specific) search_path = "aws,aws_1,aws_2,gcp,gcp_1,gcp_2,slack,github" search_path_prefix = "aws_all"
# Output Options output = "csv" progress = true header = true separator = "," timing = true}