https://pulumi.com logo
#typescript
Title
# typescript
s

salmon-account-74572

06/09/2020, 4:49 PM
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

gentle-diamond-70147

06/09/2020, 4:52 PM
Yes, that's supported. That's a Typescript "thing" not a Pulumi function.
Are you getting an error?
s

salmon-account-74572

06/09/2020, 4:54 PM
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