Streaming Progress With Pulumi Automation API

When using the pulumi automation API, you lose some of the niceties of the pulumi CLI, like having to set up command line args processing and the output is not as friendly or pretty as before. It also doesn’t stream the output – though this one is easier to fix.

This is lifted straight out of their golang example code, so if you’re working in another language – you should be able to find the relevant code in the same repo

	// wire up our update to stream progress to stdout
	stdoutStreamer := optup.ProgressStreams(os.Stdout)

	// run the update to deploy our fargate web service
	res, err := stack.Up(ctx, stdoutStreamer)
	if err != nil {
		fmt.Printf("Failed to update stack: %v\n\n", err)
	}

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.