@pulumi/pulumi - v3.253.0
    Preparing search index...

    Class LocalWorkspaceAlpha

    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 and Pulumi.<stack>.yaml as the intermediate format for Project and Stack settings. Modifying the workspace's ProjectSettings will alter the workspace's Pulumi.yaml file, and setting config on a Stack will modify the relevant Pulumi.<stack>.yaml file. This is identical to the behavior of Pulumi CLI driven workspaces.

    Implements

    Index

    Properties

    envVars: { [key: string]: string }

    Environment values scoped to the current workspace. These will be supplied to every Pulumi command.

    program?: PulumiFn

    The 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.

    pulumiHome?: string

    The directory override for CLI metadata if set. This customizes the location of $PULUMI_HOME where metadata is stored and plugins are installed.

    remoteExecutorImage?: ExecutorImage

    The image to use for the remote Pulumi operation.

    secretsProvider?: string

    The secrets provider to use for encryption and decryption of stack secrets. See: https://www.pulumi.com/docs/intro/concepts/secrets/#available-encryption-providers

    workDir: string

    The working directory to run Pulumi CLI commands in.

    Accessors

    Methods

    • Alpha

      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.

      Parameters

      • stackName: string

        The stack to operate on

      • ...environments: string[]

        The names of the environments to add to the stack's configuration

      Returns Promise<void>

    • Alpha

      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.

      Parameters

      • stackName: string

        The stack to read config from

      • key: string

        The key to use for the config lookup

      • Optionalpath: boolean

        The key contains a path to a property in a map or list to get

      Returns Promise<ConfigValue>

    • Alpha

      Returns the value associated with the specified stack name and key, scoped to the LocalWorkspace.

      Parameters

      • stackName: string

        The stack to read tag metadata from.

      • key: string

        The key to use for the tag lookup.

      Returns Promise<string>

    • Alpha

      Installs a plugin in the workspace, for example to use cloud providers like AWS or GCP.

      Parameters

      • name: string

        The name of the plugin.

      • version: string

        The version of the plugin e.g. "v1.0.0".

      • kind: string = "resource"

        The kind of plugin, defaults to "resource"

      Returns Promise<void>

    • Alpha

      Installs a plugin in the workspace from a third party server.

      Parameters

      • name: string

        The name of the plugin.

      • version: string

        The version of the plugin e.g. "v1.0.0".

      • server: string

        The server to install the plugin from

      Returns Promise<void>

    • Alpha

      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().

      Parameters

      • stackName: string

        The stack to operate on

      • keys: string[]

        The list of keys to remove from the underlying config

      • Optionalpath: boolean

        The keys contain a path to a property in a map or list to remove

      Returns Promise<void>

    • Alpha

      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().

      Parameters

      • stackName: string

        The stack to operate on

      • key: string

        The config key to remove

      • Optionalpath: boolean

        The key contains a path to a property in a map or list to remove

      Returns Promise<void>

    • Alpha

      Removes an environment from a stack's import list.

      Parameters

      • stackName: string

        The stack to operate on

      • environment: string

        The name of the environment to remove from the stack's configuration

      Returns Promise<void>

    • Alpha

      Removes a plugin from the workspace matching the specified name and version.

      Parameters

      • Optionalname: string

        The optional name of the plugin.

      • OptionalversionRange: string

        An optional semver range to check when removing plugins matching the given name e.g. "1.0.0", ">1.0.0".

      • kind: string = "resource"

        The kind of plugin, defaults to "resource".

      Returns Promise<void>

    • Alpha

      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.

      Parameters

      • _: string

      Returns Promise<string[]>

    • Alpha

      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().

      Parameters

      • stackName: string

        The stack to operate on

      • config: ConfigMap

        The ConfigMap to upsert against the existing config

      • Optionalpath: boolean

        The keys contain a path to a property in a map or list to set

      Returns Promise<void>

    • Alpha

      Sets all config values from a JSON string for the specified stack name. The JSON string should be in the format produced by "pulumi config --json". Will write the config to the matching Pulumi.<stack>.yaml file in Workspace.workDir.

      Parameters

      • stackName: string

        The stack to operate on

      • configJson: string

        A JSON string containing the configuration values to set

      Returns Promise<void>

    • Alpha

      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().

      Parameters

      • stackName: string

        The stack to operate on

      • key: string

        The config key to set

      • value: ConfigValue

        The value to set

      • Optionalpath: boolean

        The key contains a path to a property in a map or list to set

      Returns Promise<void>

    • Alpha

      Sets the specified key-value pair on the stack with the given name.

      Parameters

      • stackName: string

        The stack to operate on.

      • key: string

        The tag key to set.

      • value: string

        The tag value to set.

      Returns Promise<void>