Hey everyone, we are currently migrating our infra...
# automation-api
e
Hey everyone, we are currently migrating our infrastructure stacks from CDKTF to pulumi and also make heavy use of the automation api (with typescript). One thing that we noticed during our migration is that pulumi seems to be sending all output from processed spawned via "command.local.Command" to the automation sdks
onError
handler. For example, this command:
Copy code
new command.local.Command('sync-project-files', {
  create: pulumi.interpolate`aws s3 sync /tmp/build s3://${s3bucket.id}/${this.releaseVersion} --delete`,
  triggers: [this.releaseVersion],
}, {dependsOn: [s3bucket]});
would send all the logs of the
aws
command to the
onError
handler. We usually use this for `onError`:
Copy code
const onError = (error: string) => {
  console.error('Error:', error);
};
which results in logs being:
Copy code
Error: Completed 63.9 KiB/733.4 KiB (56.4 KiB/s) with 8 file(s) remaining
Completed 64.0 KiB/733.4 KiB (53.1 KiB/s) with 8 file(s) remaining
upload: <redacted>

Error: Completed 64.0 KiB/733.4 KiB (53.1 KiB/s) with 7 file(s) remaining
Completed 64.2 KiB/733.4 KiB (51.1 KiB/s) with 7 file(s) remaining
upload: <redacted>
We would've expected that messages from stdout are handled via
onOutput
but it seems like everything is just routed to
onError
. I found this issue on GH: github.com/pulumi/pulumi/issues/23968 but for some reason i can't access the slack post linked in the issue. Would be great to hear if this is by design or not. Created this issue: github.com/pulumi/pulumi/issues/24186 for it