This message was deleted.
# general
s
This message was deleted.
g
hm i dont think there’s a problem with this approach. possible issue is that addtOrigins is optional which you cant spread if it’s undefined, you can use a default like `addtOrigins: <type> = []`so its an array even if nothing is passed in
oh jk you have the default there. what’s the TS error you’re getting
s
Type 'Input<Input<DistributionOrigin>[]>' must have a '[Symbol.iterator]()' method that returns an iterator.
g
hmm tricky
try this
Copy code
origins: pulumi
      .output(addtOrigins)
      .apply((addtOrigins) => [...addtOrigins, {...}]),
actually this is the right way: replace the type of
addtOrigins
with the real object type (not wrapped in pulumi.Input):
aws.types.input.cloudfront.DistributionOrigin[];
s
aha! thanks 🙂
i've done that before i just could not quite remember how i had done it 🙂