Skip to main content

Pulumi Package

Strongly typed Pulumi infrastructure commands.

Installation​

dotnet add package ModularPipelines.Pulumi

Required command-line tool: pulumi. It must be installed and available on PATH when the pipeline runs.

Context entry points​

Use the discoverable context.Tools surface from a module:

  • context.Tools.Pulumi

Module example​


public class UsePulumiModule : SyncModule<None>
{
protected override None Execute(
IModuleContext context,
CancellationToken cancellationToken)
{
var pulumi = context.Tools.Pulumi;

// Call the integration's strongly typed operations here.
context.Logger.LogInformation("Pulumi integration is ready");
return None.Value;
}
}

The package exposes generated options records for its supported CLI commands.

Inherited settings and V4 migration​

PulumiOptions now declares the thirteen public persistent settings from Pulumi 3.267.0: Color, Cwd, DisableIntegrityChecking, Emoji, FullyQualifyStackNames, Logflow, Logtostderr, Memprofilerate, NonInteractive, OtelTraces, Profiling, Tracing, and Verbose. Generated command records inherit these properties, which render before the subcommand path. Initializers for inherited settings retain their property names and types; reflection over command records must include inherited properties.

using ModularPipelines.Pulumi.Options;

var options = new PulumiStackListOptions
{
Cwd = "infra",
Emoji = false,
NonInteractive = true,
Verbose = 0,
Output = "json",
};

This renders pulumi --cwd=infra --emoji=false --non-interactive --verbose=0 stack list --output=json. Emoji = false now emits an explicit value, allowing callers to disable Pulumi's macOS default. Emoji = null leaves the tool default unchanged. Other boolean globals keep their presence-flag behavior: true emits the flag; false/null omit it. Zero integer values remain explicit, and each scalar string keeps its token boundary.

Stack/project selectors and update arguments remain command-local. Env belongs only to the environment command group and renders after that command path. Commands that declare their own root-named switches retain separate local properties: PulumiWhoamiOptions.CliVerbose and PulumiApiOptions.CliVerbose are boolean --verbose flags, while PulumiNeoOptions.CliCwd and PulumiNeoResumeOptions.NeoCwd select the local tool directory without the root -C alias. Migrate these commands' former Verbose/Cwd initializers to the local property when that command-specific behavior is intended. PulumiEnvRunOptions keeps its command and arguments after --, so forwarded arguments cannot become Pulumi global settings. Help, root version controls, and hidden flags are not added to the public global surface.

The audit uses version-pinned parser registration and captured help. The generated command reference lists the current package surface.