sparse-intern-71089
08/12/2022, 6:56 AMlittle-cartoon-10569
08/14/2022, 8:33 PMvictorious-dusk-75271
08/17/2022, 6:15 AMconst finalSnapshotIdentifier = new random.RandomString("final-snapshot-identifier-random", {
length: 10,
special: false,
}).result
----
{
finalSnapshotIdentifier: config.get<string>('FINAL_SNAPSHOT_IDENTIFIER') || finalSnapshotIdentifier,
}
little-cartoon-10569
08/18/2022, 10:20 PMstring || pulumi.Output<string>
which possibly isn't being resolved as a pulumi.Output<string>
, so you're ending up with the error message (the one that says you cannot use an Output as a string) as the finalSnapshotIdentifier.
To confirm / work around this, you could change the value to this:
{
finalSnapshotIdentifier: pulumi.output(config.get<string>('FINAL_SNAPSHOT_IDENTIFIER') || finalSnapshotIdentifier)
}
This will definitely be detected as a pulumi.Output
, so it should sort itself out. If it doesn't, then the next thing to do is to look at the actual value by logging. Something along the lines of
<http://pulumi.log.info|pulumi.log.info>(`Config value: ${config.get<string>('FINAL_SNAPSHOT_IDENTIFIER')}`);
<http://pulumi.log.info|pulumi.log.info>(("Random string", finalSnapshotIdentifier);
Note that you have to use the two-parameter version of pulumi.log.info() or else put that log statement inside an apply().little-cartoon-10569
08/18/2022, 10:21 PM