I am now experiencing issues with the `command.rem...
# general
s
I am now experiencing issues with the
command.remote.CopyToRemote
resource. The very same code used to work when used from sst but now that I am migrating to raw Pulumi it doesn't anymore.
Copy code
const copyTraefikConfig = new command.remote.CopyToRemote(
	'CopyTraefikConfig',
	{
		connection: sshConnection,
		source: pulumi.all([tlsCfKey.privateKeyPem, originCert.certificate]).apply(([key, cert]) => {
			const originDir = `${INFRA_DIR}/traefik/dynamic/cf-origin`
			fs.writeFileSync(path.join(originDir, 'privkey.key'), key)
			fs.writeFileSync(path.join(originDir, 'chain.crt'), cert)
			return new pulumi.asset.FileArchive(path.resolve(`${INFRA_DIR}/traefik`))
		}),
		remotePath: `/home/${APP_NAME}/app`,
	},
	{ dependsOn: [waitForReboot, downloadAopCert] },
)
When running
pulumi up
and the preview pops up it errors with this message:
Copy code
error: command:remote:CopyToRemote resource 'CopyTraefikConfig': property asset value {<nil>} has a problem: either asset or archive must be set
Removing the side-effects and declaring
Copy code
source: new pulumi.asset.FileArchive(path.resolve(`${INFRA_DIR}/traefik`)),
throws no errors during preview though, but isn't equivalent.
q
Hey @shy-refrigerator-41911, this sounds like a bug in the provider! Could you please open an issue here and attach your repro as an example. The team will look into it!
s
Surprisingly enough I am using the very same provider in SST code without this bug. Guess they are doing something different when calling into Pulumi. In any case, I opened the issue over here: https://github.com/pulumi/pulumi-command/issues/754