Not sure if this is the right place to address thi...
# docs
s
Not sure if this is the right place to address this. The example here for Typescript does not work since we migrated to V2 (are docs still pending v2 Updates for examples?) https://www.pulumi.com/docs/reference/pkg/aws/ec2/getroutetables/ Getting this error on the for loop for the rts.apply
Copy code
Operator '<' cannot be applied to types 'number' and 'OutputInstance<number>'
f
Thanks for pointing this out! The examples are code-generated, so that’s a bug and I’ve filed an issue for it.
Let me know if you need help getting a working example or if you’ve figured it out
s
If you can provide a functional example that would be super helpful! This particular thing has me stalled in setting up several peer connections and adding them to routes tables in our VPC. I have been trying to use the route ids from the crosswalk VPCX module or using the get function, both require using .apply to get the ids which makes iterating in any form very difficult. (especially for a typescript/node/js amateur.)
f
The easiest is probably just treat it as the Promise that it is:
Copy code
const rts = aws.ec2.getRouteTables({
    filters: [{
        name: "tag:<http://kubernetes.io/kops/role|kubernetes.io/kops/role>",
        values: ["private*"],
    }],
    vpcId: var_vpc_id,
}));

rts.then(r => {
    const route: aws.ec2.Route[] = [];
    for (let i = 0; i < r.ids.length); i++) {
    route.push(new aws.ec2.Route(`r-${i}`, {
        destinationCidrBlock: "10.0.1.0/22",
        routeTableId: r.ids[i],
        vpcPeeringConnectionId: "pcx-0e9a7a9ecd137dc54",
    }));
});
s
I think that got me through my blockage, but I had to make some changes (syntax issues). Once I get it to apply cleanly I'll post the changes I made to make it work if you want.
f
Awesome — glad to hear! No need to post back w/ your changes