LocalWorkspace class
Workspace-backed automation entrypoint for Pulumi CLI operations.
Properties
-
environmentVariables
→ Map<
String, String> -
Environment variables merged into every command.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- postCommandCallback → AutomationPostCommandCallback?
-
Optional callback invoked after stack operations.
final
- pulumiBinary → String
-
Pulumi executable path/name.
final
- pulumiHome → String?
-
Optional
$PULUMI_HOMEoverride.final - remote → bool
-
Whether remote mode is enabled for stack operations.
final
-
remoteArgs
→ List<
String> -
Remote operation CLI args.
final
- runInShell → bool
-
Whether commands run in a shell.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secretsProvider → String?
-
Optional stack secrets provider used on stack init.
final
- serializeArgsForOp → AutomationArgsSerializer?
-
Optional callback to append args to stack operations.
final
- skipVersionCheck → bool
-
Whether Pulumi version compatibility checks are disabled.
final
- stderrEncoding → Encoding
-
Encoding for stderr.
final
- stdoutEncoding → Encoding
-
Encoding for stdout.
final
- workDir → String
-
Working directory for this workspace.
final
Methods
-
addEnvironments(
String stackName, Iterable< String> environments, {bool yes = true}) → Future<PulumiCommandResult> -
Adds one or more ESC environments to
stackName. -
createOrSelectStackInWorkspace(
String stackName) → Future< Stack> - Creates the stack when missing, otherwise selects it.
-
createStackInWorkspace(
String stackName) → Future< void> - Creates a stack in this workspace.
-
exportStack(
String stackName, {bool showSecrets = true}) → Future< Map< String, dynamic> > - Exports stack deployment state.
-
getAllConfig(
String stackName) → Future< Map< String, AutomationConfigValue> > -
Reads all config values for
stackName. -
getConfig(
String stackName, String key, {bool path = false}) → Future< AutomationConfigValue> -
Reads a single config value for
stackName. -
getEnvVars(
) → Map< String, String> - Returns workspace-scoped environment variables.
-
getTag(
String stackName, String key) → Future< String> -
Returns a single tag value for
stackName. -
importStack(
String stackName, Map< String, dynamic> state) → Future<void> - Imports deployment state into an existing stack.
-
install(
[AutomationInstallOptions options = const AutomationInstallOptions()]) → Future< void> -
Installs project plugins/dependencies via
pulumi install. -
installPlugin(
String name, String version, {String kind = 'resource'}) → Future< void> - Installs a Pulumi plugin in this workspace.
-
installPluginFromServer(
String name, String version, String server) → Future< void> - Installs a Pulumi resource plugin from a third-party server.
-
listEnvironments(
String stackName) → Future< List< String> > -
Lists ESC environments imported by
stackName. -
listPlugins(
) → Future< List< AutomationPluginInfo> > - Returns plugins installed in this workspace.
-
listStacks(
{bool all = false}) → Future< List< AutomationStackSummary> > -
Returns stack summaries from
pulumi stack ls --json. -
listTags(
String stackName) → Future< Map< String, String> > -
Lists tags for
stackName. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
projectSettings(
) → Future< Map< String, dynamic> > -
Returns project settings read from
Pulumi.{yaml,yml,json}. -
projectSettingsObject(
) → Future< ProjectSettings> - Returns typed project settings.
-
pulumiVersion(
{PulumiVersion minimumVersion = minimumPulumiVersion, bool? skipCheck}) → Future< PulumiVersion?> - Resolves and validates the installed Pulumi CLI version.
-
refreshConfig(
String stackName) → Future< Map< String, AutomationConfigValue> > -
Refreshes config for
stackName, then returns the resulting config map. -
removeAllConfig(
String stackName, Iterable< String> keys, {bool path = false}) → Future<PulumiCommandResult> -
Removes multiple config keys from
stackName. -
removeConfig(
String stackName, String key, {bool path = false}) → Future< PulumiCommandResult> -
Removes one config key from
stackName. -
removeEnvironment(
String stackName, String environment, {bool yes = true}) → Future< PulumiCommandResult> -
Removes one ESC environment from
stackName. -
removePlugin(
{String kind = 'resource', String? name, String? versionRange}) → Future< void> -
Removes plugins matching
kind, optionalname, and optionalversionRange. -
removeStack(
String stackName, {bool yes = true, bool force = false, bool preserveConfig = false}) → Future< void> - Removes an existing stack from this workspace.
-
removeTag(
String stackName, String key) → Future< PulumiCommandResult> -
Removes a tag from
stackName. -
runPostCommandCallback(
String stackName) → Future< void> - Runs post-command callback for stack operations.
-
runPulumiCommand(
List< String> arguments, {bool check = true, String? workingDirectory, Map<String, String> ? extraEnvironment}) → Future<PulumiCommandResult> -
Executes
pulumi <arguments>. -
saveProjectSettings(
Map< String, dynamic> settings) → Future<void> -
Saves project settings into
Pulumi.{yaml,yml,json}. -
saveProjectSettingsObject(
ProjectSettings settings) → Future< void> - Saves typed project settings.
-
saveStackSettings(
String stackName, Map< String, dynamic> settings) → Future<void> -
Saves stack settings to
Pulumi.<stack>.{yaml,yml,json}. -
saveStackSettingsObject(
String stackName, StackSettings settings) → Future< void> - Saves typed stack settings.
-
selectStackInWorkspace(
String stackName) → Future< void> - Selects an existing stack in this workspace.
-
serializeArgsForOperation(
String stackName) → Future< List< String> > - Returns additional args to append to stack operation commands.
-
setAllConfig(
String stackName, Map< String, AutomationConfigValue> config, {bool path = false}) → Future<PulumiCommandResult> -
Sets multiple config values on
stackName. -
setAllConfigJson(
String stackName, String configJson) → Future< PulumiCommandResult> -
Sets all config values on
stackNamefrompulumi config --jsonshape. -
setConfig(
String stackName, String key, String value, {bool path = false, bool secret = false}) → Future< PulumiCommandResult> -
Sets one config key on
stackName. -
setEnvVar(
String key, String value) → void - Sets a single workspace-scoped environment variable.
-
setEnvVars(
Map< String, String> envVars) → void - Replaces all workspace-scoped environment variables.
-
setTag(
String stackName, String key, String value) → Future< PulumiCommandResult> -
Sets a tag on
stackName. -
stack(
) → Future< AutomationStackSummary?> - Returns the currently selected stack summary, if one exists.
-
stackOutputs(
String stackName, {bool showSecrets = false}) → Future< Map< String, dynamic> > -
Returns stack outputs for
stackNamefrom last successful update. -
stackOutputsWithMetadata(
String stackName) → Future< Map< String, AutomationOutputValue> > -
Returns stack outputs with secret metadata for
stackName. -
stackSettings(
String stackName) → Future< Map< String, dynamic> > -
Returns stack settings from
Pulumi.<stack>.{yaml,yml,json}. -
stackSettingsObject(
String stackName) → Future< StackSettings> - Returns typed stack settings.
-
toString(
) → String -
A string representation of this object.
inherited
-
unsetEnvVar(
String key) → void - Removes a workspace-scoped environment variable.
-
whoAmI(
) → Future< Map< String, dynamic> > - Returns information about the currently authenticated user.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
[LocalWorkspaceOptions options = const LocalWorkspaceOptions()]) → Future< LocalWorkspace> -
Creates a workspace from
options. -
createInlineStack(
InlineProgramArgs args, {LocalWorkspaceOptions options = const LocalWorkspaceOptions()}) → Future< Stack> - Creates a new stack for a source-based inline program.
-
createOrSelectInlineStack(
InlineProgramArgs args, {LocalWorkspaceOptions options = const LocalWorkspaceOptions()}) → Future< Stack> - Creates or selects a stack for a source-based inline program.
-
createOrSelectStack(
LocalProgramArgs args, {LocalWorkspaceOptions options = const LocalWorkspaceOptions()}) → Future< Stack> - Creates the stack when missing, otherwise selects the existing stack.
-
createStack(
LocalProgramArgs args, {LocalWorkspaceOptions options = const LocalWorkspaceOptions()}) → Future< Stack> - Creates a new stack for a local Pulumi program.
-
selectInlineStack(
InlineProgramArgs args, {LocalWorkspaceOptions options = const LocalWorkspaceOptions()}) → Future< Stack> - Selects an existing stack for a source-based inline program.
-
selectStack(
LocalProgramArgs args, {LocalWorkspaceOptions options = const LocalWorkspaceOptions()}) → Future< Stack> - Selects an existing stack for a local Pulumi program.