Import pulumi.automation and define an inline Pulumi program as a regular Python function that declares resources using the standard Pulumi SDK
Call auto.create_or_select_stack with the inline_program parameter, passing the function and a unique stack name derived from the test run ID
Set stack configuration values using stack.set_config for any environment-specific parameters, and set secrets using set_config with the is_secret flag
Call stack.up() with an OnOutput callback to stream deployment logs, then extract stack outputs using stack.outputs() for use in test assertions
In a teardown fixture, call stack.destroy() followed by stack.workspace.remove_stack() to clean up all resources and remove the stack from the Pulumi state backend
Known gotchas
Inline programs share the process memory with the Automation API caller; uncaught exceptions inside the inline program can crash the outer test process if not handled
The Automation API manages a local workspace directory for state; concurrent test runs using the same stack name will conflict and must use unique names or separate workspace paths
stack.up() is blocking by default; for long-running deployments in CI, ensure the CI job timeout exceeds the expected deployment duration or use the on_output callback to reset watchdog timers
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp