https://pulumi.com logo
Title
b

bumpy-summer-9075

04/07/2021, 5:54 PM
Another question, I don't think I understand outputs properly, neither of these work
const vpcId = terraformState.outputs["vpc_id"];
const infraVPC = await aws.ec2.getVpc({ id: vpcId });
const vpcId = terraformState.outputs["vpc_id"];
const infraVPC = await aws.ec2.getVpc({ id: vpcId.get() });
since
getVpc
doesn't accept Inputs/Ouputs, how can I achieve this?
👍 1
r

red-match-15116

04/07/2021, 6:00 PM
This is the unfortunate consequence of https://github.com/pulumi/pulumi/issues/5758 For your specific question, I think you could use the following:
const vpcId = terraformState.outputs["vpc_id"];
const infraVPC = vpcId.apply(id => aws.ec2.getVpc({ id }));
👍 1
b

bumpy-summer-9075

04/07/2021, 6:03 PM
Yeah that works 🙂 Thanks for the issue link! (apparently a VPC id is not enough to identify a single VPC, however my terraform output was undefined, my bad)
🎉 1