silly-apple-46154
12/18/2023, 10:00 PMasync create({
addtOrigins = []
}: {
addtOrigins?: aws.cloudfront.DistributionArgs['origins'];
}): Promise<aws.cloudfront.Distribution> {
const apiDistribution = new aws.cloudfront.Distribution(
`distribution`,
{
origins: [
{
// removed, but assume one exists here.
},
...addtOrigins
],
there is a lot more to that but essentially i am looking to add anything additional that i passed to this helper function and spread them into some existing default configuration... however, it appears that when i utilize the pulumi aws.cloudfront.DistributionArgs i am dealing with an input which will not allow me to spread this in.gifted-balloon-26385
12/18/2023, 10:07 PMgifted-balloon-26385
12/18/2023, 10:08 PMsilly-apple-46154
12/18/2023, 10:09 PMType 'Input<Input<DistributionOrigin>[]>' must have a '[Symbol.iterator]()' method that returns an iterator.
gifted-balloon-26385
12/18/2023, 10:13 PMgifted-balloon-26385
12/18/2023, 10:14 PMorigins: pulumi
.output(addtOrigins)
.apply((addtOrigins) => [...addtOrigins, {...}]),
gifted-balloon-26385
12/18/2023, 10:17 PMaddtOrigins
with the real object type (not wrapped in pulumi.Input):
aws.types.input.cloudfront.DistributionOrigin[];
silly-apple-46154
12/18/2023, 10:20 PMsilly-apple-46154
12/18/2023, 10:21 PM