Managing Workspaces
A Powerpipe workspace is a "profile" that allows you to define a unified environment that the Powerpipe client can interact with.
Powerpipe workspaces allow you to define multiple named configurations:
and easily switch between them using the --workspace argument
or POWERPIPE_WORKSPACE environment variable:
Turbot Pipes workspaces are automatically supported:
Defining Workspaces
Workspace configurations can be defined in any .ppc file in the configuration file search path but by convention, they are defined in a file named workspaces.ppc. This file may contain multiple workspace definitions that can then be referenced by name.
Any unset arguments will assume the default values - you don't need to set them all:
You can use base= to inherit settings from another profile:
The snapshot_location can be a Turbot Pipes workspace, in the form of {identity_handle}/{workspace_handle}:
If it doesn't match the {identity_handle}/{workspace_handle} pattern it will be interpreted to be a path to a directory in the local filesystem where snapshots should be written to:
Using Workspaces
The workspace named default is special; if a workspace named default exists, --workspace is not specified in the command, and POWERPIPE_WORKSPACE is not set, then Powerpipe uses the default workspace:
It is common to create the default workspace in ~/.powerpipe/config/workspaces.ppc. You can also create a "directory local" default for a specific directory. Because the default configuration file search path includes the current directory / mod location at a higher precedence than ~/.powerpipe/config, your "directory local" default will take precedence when you run Powerpipe from that directory.
You can pass any workspace to --workspace to use its values:
Or do the same with the POWERPIPE_WORKSPACE environment variable:
If you specify the --workspace argument and the POWERPIPE_WORKSPACE environment variable, the --workspace argument wins:
If you specify the --workspace argument and more specific arguments, any more specific arguments will override the workspace values:
Environment variable values override default workspace settings when the default workspace is implicitly used:
If the default workspace is explicitly passed to the --workspace argument, its values will override any individual environment variables:
The same is true of any named workspace:
Implicit Workspaces
Named workspaces follow normal standards for HCL identifiers, thus they cannot contain the slash (/) character. If you pass a value to --workspace or POWERPIPE_WORKSPACE in the form of {identity_handle}/{workspace_handle}, it will be interpreted as an implicit workspace. Implicit workspaces, as the name suggests, do not need to be specified in the workspaces.ppc file. Instead, they will be assumed to refer to a Powerpipe Cloud workspace, which will be used as both the database and snapshot location (snapshot_location).