Skip to content

Commit

Permalink
formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsmyth committed May 16, 2023
1 parent cadae28 commit fe786c4
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 84 deletions.
3 changes: 2 additions & 1 deletion docs/mods/mod-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cd my-mod
steampipe mod install github.com/turbot/steampipe-mod-aws-compliance
```

This will install the mod into the `.steampipe` sub-directory, and will add the dependency to your `mod.sp` file:
This will install the mod into the `.steampipe` sub-directory, and will add the dependency to the [require block](/docs/reference/mod-resources/mod#require) of your `mod.sp` file:
```hcl
mod "local" {
title = "my-mod"
Expand All @@ -26,6 +26,7 @@ mod "local" {
}
```


You can then create new `.sp` files in your mod that reference the resources in the dependency mods. You can create your own controls that use `query` resources from the dependency mod:

```hcl
Expand Down
3 changes: 0 additions & 3 deletions docs/reference/cli/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,3 @@ sidebar_label: Steampipe CLI
| **253** | `ExitCodeFileSystemAccessFailure` | File system access failed
| **254** | `ExitCodeInsufficientOrWrongInputs` | Runtime error - insufficient or incorrect input
| **255** | `ExitCodeUnknownErrorPanic` | Runtime error - an unknown panic occurred

---

11 changes: 5 additions & 6 deletions docs/reference/config-files/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Deprecated...
| [terminal](#terminal-options) | Terminal options, which generally map to .meta-commands
| [connection](#connection-options) | Options that apply to connections.
-->
---


---
Expand Down Expand Up @@ -124,9 +123,9 @@ options "general" {

## Connection Options

***The `options "connection"` block has been deprecated in steampipe 0.20.***
- You can set server query cache options in the [database options. ](#database-options)
- You can set client query cache options for each [workspaces. ](/docs/reference/config-files/workspace)
***The `options "connection"` block was deprecated in Steampipe v0.20.0.***
- Set server query cache options in the [database options →](#database-options)
- Set client query cache options for each [workspaces →](/docs/reference/config-files/workspace)


<!--
Expand Down Expand Up @@ -168,8 +167,8 @@ connection "aws_account1" {
-->

## Terminal Options
***The `options "terminal"` block has been deprecated in steampipe 0.20.***
- you can set these options for each [workspace. ](/docs/reference/config-files/workspace)
***The `options "terminal"` block was deprecated in Steampipe v0.20.0.***
- Set these options for each [workspace →](/docs/reference/config-files/workspace)


<!--
Expand Down
109 changes: 43 additions & 66 deletions docs/reference/config-files/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ that the Steampipe client can interact with. Each workspace is composed of:
- a single mod directory (which may also contain [dependency mods](/docs/mods/mod-dependencies#mod-dependencies))
- context-specific settings and options (snapshot location, query timeout, etc)

Workspace configurations can be defined in any `.spc` file in the `~/.steampipe/config` directory,
but by convention they are defined in `~/.steampipe/config/workspaces.spc` file. This file may contain
multiple workspace definitions that can then be referenced by name.

Steampipe workspaces allow you to define multiple named configurations and easily switch between them using the `--workspace` argument or `STEAMPIPE_WORKSPACE`
environment variable.

Expand All @@ -36,59 +40,44 @@ To learn more, see **[Managing Workspaces →](/docs/managing/workspaces)**

## Workspace Arguments



Many of the workspace arguments correspond to CLI flags and/or environment variables.
Any unset arguments will assume the default values.


| Argument | Default | Description
|---------------------|-----------------------------------------------|-----------------------------------------
| `base` | | A reference to a named workspace resource that this workspace should source its definition from. Any argument can be overridden after sourcing via base.
| `cache` | `true` | Enable/disable caching. Note that is a **client** setting - if the database (`options "database"`) has the cache disabled, then the cache is disabled regardless of the workspace setting
| `cache_ttl` | `300` | Set the client query cache expiration (TTL) in seconds. Note that is a **client** setting - if the database (`options "database"`) `cache_max_ttl` is lower than the cache_ttl in the workspace, then the effective ttl for this workspace is the cache_max_ttl
| `cloud_host` | `cloud.steampipe.io` | Set the Steampipe Cloud host for connecting to Steampipe Cloud workspace.
| `cloud_token` | The token obtained by `steampipe login` | Set the Steampipe Cloud authentication token for connecting to a Steampipe Cloud workspace. This may be a token obtained by `steampipe login` or a user-generated [token](/docs/cloud/profile#tokens).
| `input` | `true` | Enable/Disable interactive prompts for missing variables. To disable prompts and fail on missing variables, set to `false`. This is useful when running from scripts.
| `install_dir` | `~/.steampipe` | The directory in which the Steampipe database, plugins, and supporting files can be found.
| `introspection` | `none` | Enable introspection tables that allow you to query the mod resources in the workspace. Supported values are `none` and `info`.
| `max_parallel` | `5` | Set the maximum number of parallel executions. When running steampipe check, Steampipe will attempt to run up to this many controls in parallel.
| `mod_location` | The current working directory | Set the workspace working directory.
| `cache` | `true` | Enable/disable caching. Note that is a **client** setting - if the database (`options "database"`) has the cache disabled, then the cache is disabled regardless of the workspace setting. <br /> <br /> Env: [STEAMPIPE_CACHE](/docs/reference/env-vars/steampipe_cache)
| `cache_ttl` | `300` | Set the client query cache expiration (TTL) in seconds. Note that is a **client** setting - if the database (`options "database"`) `cache_max_ttl` is lower than the cache_ttl in the workspace, then the effective ttl for this workspace is the cache_max_ttl. <br /> <br /> Env: [STEAMPIPE_CACHE_TTL](/docs/reference/env-vars/steampipe_cache_ttl)
| `cloud_host` | `cloud.steampipe.io` | Set the Steampipe Cloud host for connecting to Steampipe Cloud workspace. <br /> <br /> Env: [STEAMPIPE_CLOUD_HOST](/docs/reference/env-vars/steampipe_cloud_host) <br /> CLI: `--cloud-host`
| `cloud_token` | The token obtained by `steampipe login` | Set the Steampipe Cloud authentication token for connecting to a Steampipe Cloud workspace. This may be a token obtained by `steampipe login` or a user-generated [token](/docs/cloud/profile#tokens). <br /> <br /> Env: [STEAMPIPE_CLOUD_TOKEN](/docs/reference/env-vars/steampipe_cloud_token) <br /> CLI: `--cloud-token`
| `input` | `true` | Enable/Disable interactive prompts for missing variables. To disable prompts and fail on missing variables, set to `false`. This is useful when running from scripts. <br /> <br /> CLI: `--input`
| `install_dir` | `~/.steampipe` | The directory in which the Steampipe database, plugins, and supporting files can be found. <br /> <br /> Env: [STEAMPIPE_INSTALL_DIR](/docs/reference/env-vars/steampipe_install_dir) <br /> CLI: `--install-dir`
| `introspection` | `none` | Enable introspection tables that allow you to query the mod resources in the workspace. Supported values are `none` and `info`. <br /> <br /> Env: [STEAMPIPE_INTROSPECTION](/docs/reference/env-vars/steampipe_introspection)
| `max_parallel` | `5` | Set the maximum number of parallel executions. When running steampipe check, Steampipe will attempt to run up to this many controls in parallel. <br /> <br /> Env: [STEAMPIPE_MAX_PARALLEL](/docs/reference/env-vars/steampipe_max_parallel) <br /> CLI: `--max-parallel`
| `mod_location` | The current working directory | Set the workspace working directory. <br /> <br /> Env: [STEAMPIPE_MOD_LOCATION](/docs/reference/env-vars/steampipe_mod_location) <br /> CLI: `--mod-location`
| `options` | | An options block to set command-specific options for this workspace. [Query](#steampipe-query-options), [check](#steampipe-check-options), and [dashboard](#steampipe-dashboard-options) options are supported.
| `progress` | `true` | Enable or disable progress information.
| `query_timeout` | `240` for controls, unlimited otherwise | 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. See also: [Using search_path to target connections and aggregators](https://steampipe.io/docs/guides/search-path).
| `search_path_prefix`| | A comma-separated list of connections to use as a prefix to the current search path for the control run.
| `snapshot_location` | The Steampipe Cloud user's personal workspace | Set the Steampipe Cloud workspace or filesystem path for writing snapshots.
| `theme` | `dark` | Select output theme (color scheme, etc) when running `steampipe check`. Possible values are `light`,`dark`, and `plain`
| `watch` | `true` | Watch .sql and .sp files in the current workspace (works only in interactive mode).
| `workspace_database`| `local` | Workspace database. This can be local or a remote Steampipe Cloud database.



<br />

Many of the workspace arguments correspond to CLI flags and/or environment variables:

| Workspace Argument | Environment Variable | Flag
|-------------------------------|--------------------------------|----------------------|
| `cloud_host` | [STEAMPIPE_CLOUD_HOST](/docs/reference/env-vars/steampipe_cloud_host) | `--cloud-host` |
| `cloud_token` | [STEAMPIPE_CLOUD_TOKEN](/docs/reference/env-vars/steampipe_cloud_token) | `--cloud-token` |
| `install_dir` | [STEAMPIPE_INSTALL_DIR](/docs/reference/env-vars/steampipe_install_dir) | `--install-dir` |
| `mod_location` | [STEAMPIPE_MOD_LOCATION](/docs/reference/env-vars/steampipe_mod_location) | `--mod-location` |
| `query_timeout` | [STEAMPIPE_QUERY_TIMEOUT](/docs/reference/env-vars/steampipe_query_timeout) | `--query_timeout` |
| `snapshot_location` | [STEAMPIPE_SNAPSHOT_LOCATION](/docs/reference/env-vars/steampipe_snapshot_location) | `--snapshot-location`|
| `workspace_database` | [STEAMPIPE_WORKSPACE_DATABASE](/docs/reference/env-vars/steampipe_workspace_database) | `--workspace-database`|
| `search_path` | | `--search-path` |
| `search_path_prefix` | | `--search-path-prefix`|
| `watch` | | `--watch` |
| `max_parallel` | [STEAMPIPE_MAX_PARALLEL](/docs/reference/env-vars/steampipe_max_parallel) | `--max-parallel` |
| `introspection` | [STEAMPIPE_INTROSPECTION](/docs/reference/env-vars/steampipe_introspection) | |
| `input` | | `--input` |
| `progress` | | `--progress` |
| `theme` | | `--theme` |
| `cache` | [STEAMPIPE_CACHE](/docs/reference/env-vars/steampipe_cache) | |
| `cache_ttl` | [STEAMPIPE_CACHE_TTL](/docs/reference/env-vars/steampipe_cache_ttl) | |
| `progress` | `true` | Enable or disable progress information. <br /> <br />CLI: `--progress`
| `query_timeout` | `240` for controls, unlimited otherwise | The maximum time (in seconds) a query is allowed to run before it times out. <br /> <br /> Env: [STEAMPIPE_QUERY_TIMEOUT](/docs/reference/env-vars/steampipe_query_timeout) <br /> CLI: `--query_timeout`
| `search_path` | `public`, then alphabetical | A comma-separated list of connections to use as a custom search path for the control run. See also: [Using search_path to target connections and aggregators](https://steampipe.io/docs/guides/search-path). <br /> <br />CLI: `--search-path`
| `search_path_prefix`| | A comma-separated list of connections to use as a prefix to the current search path for the control run. See also: [Using search_path to target connections and aggregators](https://steampipe.io/docs/guides/search-path). <br /> <br />CLI: `--search-path-prefix`
| `snapshot_location` | The Steampipe Cloud user's personal workspace | Set the Steampipe Cloud workspace or filesystem path for writing snapshots. <br /> <br /> Env: [STEAMPIPE_SNAPSHOT_LOCATION](/docs/reference/env-vars/steampipe_snapshot_location) <br /> CLI: `--snapshot-location`
| `theme` | `dark` | Select output theme (color scheme, etc) when running `steampipe check`. Possible values are `light`,`dark`, and `plain` <br /> <br />CLI: `--theme`
| `watch` | `true` | Watch .sql and .sp files in the current workspace (works only in interactive mode). <br /> <br />CLI: `--watch`
| `workspace_database`| `local` | Workspace database. This can be local or a remote Steampipe Cloud database. <br /> <br /> Env: [STEAMPIPE_WORKSPACE_DATABASE](/docs/reference/env-vars/steampipe_workspace_database) <br /> CLI: `--workspace-database`







### Steampipe Query Options

A `workspace` may include a `options "query"` block to specify values specific to the `steampipe query` command.

These option often correspond to CLI flags.

<table>
Expand All @@ -97,52 +86,46 @@ These option often correspond to CLI flags.
<th>Argument</th>
<th>Default</th>
<th>Description</th>
<th>Flag</th>
</tr>
</thead>
<tbody>
<tr>
<td><inlineCode>autocomplete</inlineCode></td>
<td><inlineCode>true</inlineCode></td>
<td>Enable or disable autocomplete in the interactive query shell.</td>
<td></td>
</tr>
<tr>
<td><inlineCode>header</inlineCode></td>
<td><inlineCode>true</inlineCode></td>
<td>Enable or disable column headers.</td>
<td nowrap="true"><inlineCode>--header</inlineCode></td>
<td>Enable or disable column headers. <br /> <br /> CLI: <inlineCode>--header</inlineCode></td>
</tr>
<tr>
<td><inlineCode>multi</inlineCode></td>
<td><inlineCode>false</inlineCode></td>
<td>Enable or disable multiline mode.</td>
<td></td>
</tr>
<tr>
<td><inlineCode>output</inlineCode></td>
<td><inlineCode>table</inlineCode></td>
<td>Set output format (<inlineCode>json</inlineCode>, <inlineCode>csv</inlineCode>, <inlineCode>table</inlineCode>, or <inlineCode>line</inlineCode>).</td>
<td nowrap="true"><inlineCode>--output</inlineCode></td>
<td>Set output format (<inlineCode>json</inlineCode>, <inlineCode>csv</inlineCode>, <inlineCode>table</inlineCode>, or <inlineCode>line</inlineCode>). <br /> <br /> CLI: <inlineCode>--output</inlineCode></td>
</tr>
<tr>
<td><inlineCode>separator</inlineCode></td>
<td><inlineCode>,</inlineCode></td>
<td>Set csv output separator.</td>
<td nowrap="true"><inlineCode>--separator</inlineCode></td>
<td>Set csv output separator. <br /> <br /> CLI: <inlineCode>--separator</inlineCode></td>
</tr>
<tr>
<td><inlineCode>timing</inlineCode></td>
<td><inlineCode>false</inlineCode></td>
<td>Enable or disable query execution timing.</td>
<td nowrap="true"><inlineCode>--timing</inlineCode></td>
<td>Enable or disable query execution timing. <br /> <br /> CLI: <inlineCode>--timing</inlineCode></td>
</tr>
</tbody>
</table>


### Steampipe Check Options
A `workspace` may include a `options "check"` block to specify values specific to the `steampipe check` command.

These option often correspond to CLI flags.

<table>
Expand All @@ -151,33 +134,28 @@ These option often correspond to CLI flags.
<th>Argument</th>
<th>Default</th>
<th>Description</th>
<th>Flag</th>
</tr>
</thead>
<tbody>
<tr>
<td><inlineCode>header</inlineCode></td>
<td><inlineCode>true</inlineCode></td>
<td>Enable or disable column headers.</td>
<td nowrap="true"><inlineCode>--header</inlineCode></td>
<td>Enable or disable column headers. <br /> <br /> CLI: <inlineCode>--header</inlineCode></td>
</tr>
<tr>
<td><inlineCode>output</inlineCode></td>
<td><inlineCode>text</inlineCode></td>
<td>Set output format (<inlineCode>brief</inlineCode>, <inlineCode>csv</inlineCode>, <inlineCode>html</inlineCode>, <inlineCode>json</inlineCode>, <inlineCode>md</inlineCode>, <inlineCode>sps</inlineCode> (<i>snapshot</i>), <inlineCode>text</inlineCode>, <inlineCode>none</inlineCode>).</td>
<td nowrap="true"><inlineCode>--output</inlineCode></td>
<td>Set output format (<inlineCode>brief</inlineCode>, <inlineCode>csv</inlineCode>, <inlineCode>html</inlineCode>, <inlineCode>json</inlineCode>, <inlineCode>md</inlineCode>, <inlineCode>sps</inlineCode> (<i>snapshot</i>), <inlineCode>text</inlineCode>, <inlineCode>none</inlineCode>). <br /> <br /> CLI: <inlineCode>--output</inlineCode></td>
</tr>
<tr>
<td><inlineCode>separator</inlineCode></td>
<td><inlineCode>,</inlineCode></td>
<td>Set csv output separator.</td>
<td nowrap="true"><inlineCode>--separator</inlineCode></td>
<td>Set csv output separator. <br /> <br /> CLI: <inlineCode>--separator</inlineCode></td>
</tr>
<tr>
<td><inlineCode>timing</inlineCode></td>
<td><inlineCode>false</inlineCode></td>
<td>Enable or disable query execution timing.</td>
<td nowrap="true"><inlineCode>--timing</inlineCode></td>
<td>Enable or disable query execution timing. <br /> <br /> CLI: <inlineCode>--timing</inlineCode></td>
</tr>
</tbody>
</table>
Expand All @@ -186,6 +164,7 @@ These option often correspond to CLI flags.

### Steampipe Dashboard Options
A `workspace` may include a `options "dashboard"` block to specify values specific to the `steampipe dashboard` command.

These option often correspond to CLI flags.

<table>
Expand All @@ -194,15 +173,13 @@ These option often correspond to CLI flags.
<th>Argument</th>
<th>Default</th>
<th>Description</th>
<th>Flag</th>
</tr>
</thead>
<tbody>
<tr>
<td><inlineCode>browser</inlineCode></td>
<td><inlineCode>true</inlineCode></td>
<td>Specify whether to launch the browser after starting the dashboard server.</td>
<td nowrap="true"><inlineCode>--browser</inlineCode></td>
<td>Specify whether to launch the browser after starting the dashboard server. <br /> <br /> CLI: <inlineCode>--browser</inlineCode></td>
</tr>
</tbody>
</table>
Expand Down
Loading

0 comments on commit fe786c4

Please sign in to comment.