This message was deleted.
# getting-started
s
This message was deleted.
e
You should in general not be creating your own
CustomResource
, they are specific to providers. "gpcmyaccountCluster" tells the engine this is a resource from the "gcp" provider called "myaccount:Cluster". The gcp provider doesn't define that resource so you get an unrecognized resource type error.
h
Well I need a workaround, to call directly
gcloud
. So what is the suggested approach? I'm on a GKE trial period so can't be waiting for Pulumi to maybe or maybe not implement the missing gcloud flag
e
The normal workaround would be to use dynamic providers: https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers/
h
Thanks. Unfortunately it's very hard to develop with Python since breakpoints don't work and the examples go from too simple to too complex Any ideas how to just get the
cluster.name
below without adding GkeClusterArgs and a bunch of unnecessary boilerplate?
Copy code
class GkeClusterProvider(ResourceProvider):
    def create(self, inputs):
        cluster_name = inputs["name"] + "-" + str(uuid.uuid4())[:8]
        return CreateResult(id_=cluster_name, outs={
            "name": cluster_name,
        })

class GkeCluster(Resource):
    name: pulumi.Output[str]
    def __init__(self, name, props=None, opts=None):
        props = props or {}
        super().__init__(GkeClusterProvider(), name, {}, opts)

cluster = GkeCluster("cluster-staging")
pulumi.export("myresource", cluster.name)
e
Add "name"=None to props in the GkeCluster init method, and pass props to the super init