Hey guys. Could someone please explain the differe...
# getting-started
h
Hey guys. Could someone please explain the difference between gcp.container.Cluster.get and gcp.container.getCluster? Couldn't find anything on the web. Thank you
m
getCluster
is a lookup by name and location that gives you a
GetClusterResult
, which is essentially a metadata object (either directly or as a Pulumi output). It allows you to get information about an existing GKE cluster.
Cluster.get
requires you to know the provider ID and returns a
Cluster
resource that you can use in your program just like a new cluster you created, without making the cluster part of your stack like an import of the resource would. If you want to create a resource that requires a
Cluster
as an input and not just its name, you'd use
Cluster.get
but if you're just interested in learning certain properties,
getCluster
is probably the way to go.
l
Alternatively:
getCluster
is a wrapper around the GCP SDK call.
Cluster.get
is part of the Pulumi SDK.
h
thanks guys