Is there a way to query for existing resources out...
# kubernetes
l
Is there a way to query for existing resources outside of my Pulumi stack/
b
Do you mean look up a VPC that you're not using Pulumi to deploy?
(for example)
l
Yeah
In this case, a Kubernetes resource (a service)
b
I am going to have to look into that as I don't think you can with the Kubernetes provider
l
I guess I could do it directly using the Kubernetes SDK since it’s just TS
b
So no there doesn't seem to be a way that you can do this like other resources
g
Hmm, it seems to be missing from our API docs, but k8s does have
.get
methods for every resource type. Here’s the Service one for example: https://github.com/pulumi/pulumi-kubernetes/blob/62f8055cd47ab5572e278eac70d7484fb802319d/sdk/nodejs/core/v1/service.ts#L45-L47
FYI, the id format for get/import is
[namespace/]name
e.g., for a Service called
foo
in the
bar
namespace, it would be
bar/foo
l
Just seen this, thanks!
Will give it a whirl now
Is there any way to look up a resource without the name? Just out of curiosity