Hi, my following Go code always exits with status ...
# golang
b
Hi, my following Go code always exits with status 32 without any (pulumi) logs. I am not using
pulumi up
but just
go run
. Is this not supported?
Copy code
<http://logger.Info|logger.Info>("running pulumi")

	pulumi.Run(func(ctx *pulumi.Context) error {
		if err := <http://ctx.Log.Info|ctx.Log.Info>("Pulumi run", nil); err != nil {
			logger.Error(err)
		}

		logger.Debug("initializing gcp")
		infra, err := gcp.New(ctx, conf.GCP)
		if err != nil {
			logger.WithError(err).Fatal("failed to initialize GCP")
		}

		logger.Debug("creating infra")
		if err = infra.Create(ctx); err != nil {
			logger.WithError(err).Fatal("failed to create GCP infra")
		}

		return nil
	})
}
a
To write a Pulumi program that doesn’t use the
pulumi
CLI is possible, but slightly different. You will need to use Pulumi’s Automation API.
b
Thanks!
s
Without using the Automation API, you'll need to use the
pulumi
CLI to perform all operations.
b
I got it working with the
pulumi cli
, but I find it more comfortable with a custom config struct loaded from one single yaml config file so maybe i'll try that. Thanks!