full-artist-27215
04/28/2022, 5:55 PMStackReference
outputs. I've got one project that sets up all our Github repositories, and another project that sets up our CI/CD pipelines for those repositories. Based on whether the repository in question is public or private, I will tweak how the pipelines are set up. I think "no problem, that's what StackReferences
are for!" So I'm exporting the visibility of each of my repositories as an output from my Github project for consumption by my CI/CD project.
However, anything I get from a StackReference
is an Output
, which is fine if I only needed to pass that output directly to a new Resource
as an input. Unfortunately, I need to perform some extra-Resource
logic based on the value of this Output
("do I pass this pipeline definition to the Resource, or that pipeline definition?"). Output.apply
doesn't do the trick because this is happening in the initial "compilation"/pre-processing stage of the Pulumi run, rather than the "execution"/actual-creation-of-Resources stage.
Is there some trick I'm missing in this situation? Alternatively, is there some other way of structuring things that would make this more straightforward? (I'm using the Python SDK, FWIW.) Thanks in advance.billowy-army-68599
04/28/2022, 6:03 PMfull-artist-27215
04/28/2022, 6:06 PMthing.apply(lambda x: x)
) and then doing a comparison based on the result, which wasn't working. If I pull that comparison into the apply (thing.apply(lambda x: x == "blah")
), it workspulumi.log
(I just get something like <pulumi.output.Output object at 0x78b40441e0b8>
, and it doesn't look like it's actually behaving as a boolean in my code.