Is the code pattern of using `push` to create new ...
# typescript
s
Is the code pattern of using
push
to create new items in an array deprecated/not supported in Pulumi 2.x? Example:
Copy code
let privRtAssoc = [];
for (let i = 0; i < numberOfAZs; i++) {
    privRtAssoc.push(new aws.ec2.RouteTableAssociation(`${baseName}-priv-rta-${i+1}`, {
        routeTableId: privRt[i].id,
        subnetId: privSubnetIds[i],
    }));
};
I'm asking because I use this pattern a fair amount and need to find a replacement before migrating to Pulumi 2.x (yes, I'm lagging behind).
g
Yes, that's supported. That's a Typescript "thing" not a Pulumi function.
Are you getting an error?
s
No, not getting an error, just had a vague memory of someone mentioning that it was an issue under Pulumi 2.x. I'm probably misremembering. Thanks for the clarification!
👍 1