shy-refrigerator-41911
04/29/2025, 10:59 AMcommand.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.
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:
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
source: new pulumi.asset.FileArchive(path.resolve(`${INFRA_DIR}/traefik`)),
throws no errors during preview though, but isn't equivalent.quick-house-41860
04/29/2025, 11:57 AMshy-refrigerator-41911
04/29/2025, 12:00 PM