witty-monitor-18849
11/10/2021, 6:42 PMconst ids: Promise<pulumi.Output<string>[]>
const otherIds: Promise<pulumi.Output<string>[]>
ids.concat(otherIds)
I've tried with then
and also apply
like; pulumi.output(ids).apply()
etc... To no avail. Any help would be greatly appreciated. 🙏little-cartoon-10569
11/10/2021, 8:02 PMconst ids: Promise<pulumi.Output<string>[]>
const outputIds = pulumi.output(ids);
Unfortunately the strong type system means you can't unwrap at declaration time: outputIds
is technically of type pulumi.Output<Promise<pulumi.Output<string>[]>>
. But you can use it as if it was of type pulumi.Output<string>[]
due to the unwrapping.const ids: Promise<pulumi.Output<string>[]>
const otherIds: Promise<pulumi.Output<string>[]>
const concattedIds = pulumi.all([pulumi.output(ids), pulumi.output(otherIds)]);
apply
. If you followed the example in the docs for all()
, you'd have this:
const concattedIds = pulumi.all([pulumi.output(ids), pulumi.output(otherIds)]).apply(([x, y]) => x.concat(y));
But that's pretty much exactly what pulumi.all()
does anyway, so you can skip that bit.witty-monitor-18849
11/11/2021, 8:28 AMpulumi.all
too. Your advice worked a treat 👍 🙏const sourceStage: pulumi.Input<pulumi.Input<inputs.codepipeline.PipelineStage>[]> = [
{
name: 'Source',
actions: [
{
name: 'Source',
category: 'Source',
owner: 'AWS',
provider: 'CodeStarSourceConnection',
outputArtifacts: ['source-output'],
version: '1',
configuration: {
ConnectionArn: 'connection.arn',
FullRepositoryId: 'org/repo',
BranchName: 'main',
OutputArtifactFormat: 'CODEBUILD_CLONE_REF',
},
}
],
}]
const pipelineStagesArg: pulumi.Input<pulumi.Input<inputs.codepipeline.PipelineStage>[]>
const stages = pulumi.all([pipelineStagesArg, sourceStage]).apply(
([args, sourceStage]) => sourceStage.concat(args)
)