Is there a way to get an `Output<string>` to...
# typescript
w
Is there a way to get an
Output<string>
to work as an argument to a function like [getsubnetids](https://www.pulumi.com/registry/packages/aws/api-docs/ec2/getsubnetids/) where arguments are of type
string
and not
Input<string>
? Such as:
Copy code
const publicSubnets = ec2.getSubnetIds({
	  vpcId: vpc.id, // Correctly results in "Type Output<string> is not assignable to type 'string'
      tags: {
        type: "public",
      },
    })
g
You need to call
apply
and get the promise inside the callback. This wil wrap the promise in an output and resolve it withing Pulumi resource graph
Copy code
const publicSubnets = vpc.id.apply(vpcId => ec2.getSubnetIds({
	  vpcId: vpcId,
      tags: {
        type: "public",
      },
    }))
w
Many thanks @green-school-95910, that has worked for me 🙏