Alpha
Environment values scoped to the current workspace. These will be supplied to every Pulumi command.
Optional
programThe inline program PulumiFn to be used for preview/update operations if any. If none is specified, the stack will refer to ProjectSettings for this information.
Optional
Readonly
pulumiThe directory override for CLI metadata if set. This customizes the
location of $PULUMI_HOME
where metadata is stored and plugins are
installed.
Optional
remoteThe image to use for the remote Pulumi operation.
Optional
Readonly
secretsThe secrets provider to use for encryption and decryption of stack secrets. See: https://www.pulumi.com/docs/intro/concepts/secrets/#available-encryption-providers
Readonly
workThe working directory to run Pulumi CLI commands in.
The underlying Pulumi CLI.
The version of the underlying Pulumi CLI/engine.
A string representation of the version, if available. null
otherwise.
Adds environments to the end of a stack's import list. Imported environments are merged in order per the ESC merge rules. The list of environments behaves as if it were the import list in an anonymous environment.
The stack to operate on
Rest
...environments: string[]The names of the environments to add to the stack's configuration
Exports the deployment state of the stack. This can be combined with importStack to edit a stack's state (such as recovery from failed deployments).
The name of the stack.
Returns the config map for the specified stack name, scoped to the
current workspace. LocalWorkspace reads this config from the
matching Pulumi.stack.yaml
file.
The stack to read config from
Returns the value associated with the specified stack name and key,
scoped to the current workspace. LocalWorkspace reads this config
from the matching Pulumi.stack.yaml
file.
The stack to read config from
The key to use for the config lookup
Optional
path: booleanThe key contains a path to a property in a map or list to get
Imports the given deployment state into a pre-existing stack. This can be combined with exportStack to edit a stack's state (such as recovery from failed deployments).
The name of the stack.
The stack state to import.
Install plugin and language dependencies needed for the project.
Optional
opts: InstallOptionsOptions to customize the behavior of install.
Installs a plugin in the workspace, for example to use cloud providers like AWS or GCP.
The name of the plugin.
The version of the plugin e.g. "v1.0.0".
The kind of plugin, defaults to "resource"
Returns a list of all plugins installed in the workspace.
Returns all stacks from the underlying backend based on the provided
options. This queries the underlying backend and may return stacks not
present in the workspace as Pulumi.<stack>.yaml
files.
Optional
opts: ListOptionsOptions to customize the behavior of the list.
A hook executed after every command. Called with the stack name. An
extensibility point to perform workspace cleanup (CLI operations may
create/modify a Pulumi.stack.yaml
) LocalWorkspace does not
utilize this extensibility point.
Returns the settings object for the current project if any
LocalWorkspace reads settings from the Pulumi.yaml
in the workspace. A workspace can contain only a single project at a
time.
Gets and sets the config map used with the last update for the stack
matching the given name. This will overwrite all configuration in the
Pulumi.<stack>.yaml
file in Workspace.WorkDir()
.
The stack to refresh
Removes all values in the provided key list for the specified stack name
Will remove any matching values in the Pulumi.<stack>.yaml
file in
Workspace.WorkDir()
.
The stack to operate on
The list of keys to remove from the underlying config
Optional
path: booleanThe keys contain a path to a property in a map or list to remove
Removes the specified key-value pair on the provided stack name. Will
remove any matching values in the Pulumi.<stack>.yaml
file in
Workspace.WorkDir()
.
The stack to operate on
The config key to remove
Optional
path: booleanThe key contains a path to a property in a map or list to remove
Removes a plugin from the workspace matching the specified name and version.
Optional
name: stringThe optional name of the plugin.
Optional
versionRange: stringAn optional semver range to check when removing plugins matching the given name e.g. "1.0.0", ">1.0.0".
The kind of plugin, defaults to "resource".
Deletes the stack and all associated configuration and history.
The stack to remove
Optional
opts: RemoveOptionsOverwrites the settings object in the current project. There can only be
a single project per workspace. Fails if new project name does not match
old. LocalWorkspace writes this value to a Pulumi.yaml
file in
Workspace.WorkDir()
.
The settings object to save to the Workspace.
Overwrites the settings object for the stack matching the specified stack
name. LocalWorkspace writes this value to a Pulumi.<stack>.yaml
file in Workspace.WorkDir()
The stack to operate on.
The settings object to save.
A hook to provide additional args to every CLI commands before they are
executed. Provided with stack name, this function returns a list of
arguments to append to an invoked command (e.g. ["--config=...", ...]
)
Presently, LocalWorkspace does not utilize this extensibility
point.
Sets all values in the provided config map for the specified stack name.
LocalWorkspace writes the config to the matching
Pulumi.<stack>.yaml
file in Workspace.WorkDir()
.
Sets the specified key-value pair on the provided stack name. LocalWorkspace writes this value to the matching Pulumi.<stack>.yaml
file in Workspace.WorkDir()
.
The stack to operate on
The config key to set
The value to set
Optional
path: booleanThe key contains a path to a property in a map or list to set
Returns a summary of the currently selected stack, if any.
Returns the settings object for the stack matching the specified stack
name if any. LocalWorkspace reads this from a
Pulumi.<stack>.yaml
file in Workspace.WorkDir()
.
The stack to retrieve settings from.
Returns information about the currently authenticated user.
Static
createCreates a workspace using the specified options. Used for maximal control and customization of the underlying environment before any stacks are created or selected.
Options used to configure the Workspace
Static
createCreates or selects an existing Stack with a LocalWorkspace
utilizing the specified inline (in process) Pulumi CLI program. This
program is fully debuggable and runs in process. If no project is
specified, default project settings will be created on behalf of the
user. Similarly, unless a workDir
option is specified, the working
directory will default to a new temporary directory provided by the OS.
A set of arguments to initialize a Stack with a pre-configured Pulumi CLI program that already exists on disk.
Optional
opts: LocalWorkspaceOptionsAdditional customizations to be applied to the Workspace.
Creates or selects an existing Stack with a LocalWorkspace utilizing the specified inline Pulumi CLI program. This
program is fully debuggable and runs in process. If no Project option is
specified, default project settings will be created on behalf of the
user. Similarly, unless a workDir
option is specified, the working
directory will default to a new temporary directory provided by the OS.
A set of arguments to initialize a Stack with and inline PulumiFn
program that runs in process.
Optional
opts: LocalWorkspaceOptionsAdditional customizations to be applied to the Workspace.
Static
createCreates a Stack with a LocalWorkspace utilizing the local
Pulumi CLI program from the specified working directory. This is a way to
create drivers on top of pre-existing Pulumi programs. This workspace
will pick up any available settings files (Pulumi.yaml
,
Pulumi.<stack>.yaml
).
A set of arguments to initialize a stack with a pre-configured Pulumi CLI program that already exists on disk.
Optional
opts: LocalWorkspaceOptionsAdditional customizations to be applied to the Workspace.
Creates a Stack with a LocalWorkspace utilizing the
specified inline (in process) Pulumi program. This program is fully
debuggable and runs in process. If no Project option is specified,
default project settings will be created on behalf of the user.
Similarly, unless a workDir
option is specified, the working directory
will default to a new temporary directory provided by the OS.
A set of arguments to initialize a stack with and an inline PulumiFn program that runs in process.
Optional
opts: LocalWorkspaceOptionsAdditional customizations to be applied to the Workspace.
Static
selectSelects a Stack with a LocalWorkspace utilizing the local
Pulumi CLI program from the specified working directory. This is a way to
create drivers on top of pre-existing Pulumi programs. This Workspace
will pick up any available Settings files (Pulumi.yaml
,
Pulumi.<stack>.yaml
).
A set of arguments to initialize a stack with a pre-configured Pulumi CLI program that already exists on disk.
Optional
opts: LocalWorkspaceOptionsAdditional customizations to be applied to the Workspace.
Selects an existing Stack with a LocalWorkspace utilizing
the specified inline (in process) Pulumi program. This program is fully
debuggable and runs in process. If no Project option is specified,
default project settings will be created on behalf of the user.
Similarly, unless a workDir
option is specified, the working directory
will default to a new temporary directory provided by the OS.
A set of arguments to initialize a Stack with and inline PulumiFn
program that runs in process.
Optional
opts: LocalWorkspaceOptionsAdditional customizations to be applied to the Workspace.
Generated using TypeDoc
LocalWorkspace is a default implementation of the Workspace interface.
A Workspace is the execution context containing a single Pulumi project, a program, and multiple stacks. Workspaces are used to manage the execution environment, providing various utilities such as plugin installation, environment configuration (
$PULUMI_HOME
), and creation, deletion, and listing of Stacks.LocalWorkspace relies on
Pulumi.yaml
andPulumi.<stack>.yaml
as the intermediate format for Project and Stack settings. Modifying the workspace's ProjectSettings will alter the workspace'sPulumi.yaml
file, and setting config on a Stack will modify the relevantPulumi.<stack>.yaml
file. This is identical to the behavior of Pulumi CLI driven workspaces.