How do I find the resource ID for a vlan I created...
# general
f
How do I find the resource ID for a vlan I created via terraform?
l
For importing? The description of import IDs are at the bottom of the Pulumi doc page.
The page for that specific resource type.
f
Ok, I'll take a look there
Oh do I have to import it via the CLI before I can use it in pulumi?
l
No. The CLI import is handy, but you can do it via the
import
opt, directly in your code. If you do that, you have to remember to remove the
import
opt after the import is complete.
f
Ok well for testing I tried it via the CLI, but neither 1000 (the vlan ID) nor
vlan0
worked to identify it
and I don't know of any other way to identify it
l
Just above "Package Details", it says the VLAN UUID. https://www.pulumi.com/registry/packages/equinix-metal/api-docs/vlan/#import
f
Ok... i don't see how I'm supposed to find a UUID
but I'll take a look, maybe their cli tool can give it up
can I have pulumi list all things it can "see" via the commandline?
l
I've never used Equinix, sorry. Their console would probably be required? Maybe hovering over the link to it?
f
like list all vlans
l
No, Pulumi cannot see things in the provider that aren't already in state.
f
I already considered hovering over it, but there isn't any actual link except to delete it, but maybe inspect element will reveal some secrets?
If not I can contact my tech support contact there
l
That might be best.
f
Managed to find it in the network logs in browser devtools, under a query to the packet.net api with virtual-networks, it's the first ID field, in case anyone else (or I) need to find that again
🎉 1
r
In general, when I've had tricky resources like this, I just look in the terraform statefile, find the resource in question, and use the ID there as the import ID in Pulumi. For any provider that is non-native to Pulumi, the IDs will be the same between Terraform/Pulumi