am i thinking about this wrong, but i thought one ...
# general
c
am i thinking about this wrong, but i thought one could do something like
const subnet = aws.ec2.Subnet.get("some_subnet_name")
to look up an existing subnet or vpc, but apparently i need to also provide the resource id?
g
The
<resource>.get()
methods always require an ID. There are lookup functions like
aws.ec2.getSubnet()
that take filter arguments - https://www.pulumi.com/docs/reference/pkg/aws/ec2/getsubnet/#using.
c
so something along the lines of this is in the right direction
Copy code
const vpcName = "dev";
export const vpc = pulumi.output(aws.ec2.getVpc({filters: [{name: "tag:Name", values: [vpcName]}]}));
export const subnets = pulumi.output(aws.ec2.getSubnetIds({tags: {Environment: "dev1"}, vpcId: vpc.apply(x => x.id)}));
g
looks roughly correct, yea
c
does the python api suffer the same promise/output types of complexities?
asking for a friend 😄
g
Same support and functionality there, yes. 😉