Since the awsx.ec2.vpc module doesn't expose all o...
# typescript
b
Since the awsx.ec2.vpc module doesn't expose all of the route tables, I'm attempting the following:
const vpc = new awsx.ec2.Vpc('test', {})
const rts = aws.ec2.getRouteTables({
vpcId: vpc.id
});
When I bring up the stack, I'm getting the following error. I can't figure out how to transform pulumi.Output<string> into just a string.
index.ts(9,36): error TS2345: Argument of type '{ vpcId: pulumi.Output<string>; }' is not assignable to parameter of type 'GetRouteTablesArgs'.
w
Since
<http://vpc.id|vpc.id>
is an Output, you need to use apply, and call
getRouteTables
inside that.
Copy code
const rts = vpc.id.apply(id => aws.ec2.getRouteTables({ vpcId: id }));
👍 1
b
Thank you very much!