enough-painter-7423
03/12/2023, 5:54 PMOutput<collection of resources>
cross-stack?
I think some resources can best be created as a group within an .Apply()
action when they depend on a prerequisite resource. Then the return type of the .Apply()
becomes Output<collection of resources>
which I don't know how to disentangle so I can publish their IDs cross-stack. Fwiw I'm using F# where cross-stack publishing is done by returning IDictionary<String, Object>
from the kernel function.
I wish there's a variant of Deployment.run
that takes Output<IDictionary<String, Object>>
... There are Output.Tuple<T1, ... T8>(item1, ... item8)
which can merge `Output`s but the opposite is not possible, if I'm not mistaken? Or am I taking a wrong approach?little-cartoon-10569
03/12/2023, 8:06 PMpolite-umbrella-11196
03/12/2023, 10:56 PMenough-painter-7423
03/14/2023, 2:01 AM.Id
or .Arn
with .Apply(fun o -> o.Id)
and that's fine for individual Output<Subnet>
or Output<BucketV2>
Then my question is, what's the best way to export both `.Id`s of Output<Tuple<Subnet, BucketV2>>
? Wonder if there's any better way than to write repetitive calls of .Apply(fun tuple -> tuple.Item*.Id)
little-cartoon-10569
03/14/2023, 2:13 AMapply()
. Does this not happen here?
export resourceId = resource.id
It just works.enough-painter-7423
03/14/2023, 3:29 AMlittle-cartoon-10569
03/14/2023, 3:58 AMmap[property] = yourOutput.Apply(o -> o.property)
(lots of reflection, no doubt). Assuming that there's an easy way to map Maps to JSON when exporting, that should be okay.