Question: what would an GCP equivalent example of ...
# general
w
Question: what would an GCP equivalent example of this line found in the schema.json boilerplate: "$ref": "/aws/v3.30.0/schema.json#/resources/aws:lambda%2Ffunction:Function". Is it “$ref”: “/gcp/v6.36.0/schema.json#/resources/gcpcloudfunctionsFunction” ?
s
That looks about right. Are you working on writing your own multi-language component by chance?
w
Thanks! yes, experimenting with the pattern to build a component. The error I get is:
Failed: importing schema: <nil>: #/resources/xyz:module:BucketTest/properties/bucket/$ref: resource type gcp:storage:Bucket not found in package gcp
Using the string:
"$ref": "/gcp/v6.36.0/schema.json#/resources/gcp:storage:Bucket"
have this feeling I have some minor typo in the $ref.
s
Authoring a schema by hand is pretty difficult to do. We have some plans in the works to make this easier in the future.
BTW, difficult but by no means impossible.
w
ah, is there a means to autogen. the schema ? Im working off the python boilerplate.
s
Not at this time.
w
How can I reference the gcp Bucket resource. I have tried to follow the documentation around the $ref, unfort. I get keep running into an error.
I got this to work: "$ref": "/gcp/v6.36.0/schema.json#/resources/gcpstorage/bucketBucket",
s
So I don't know the answer to this one offhand, but I can show you a few known working examples of
$ref:
• Referencing a resource: https://github.com/pulumi/pulumi-awsx/blob/master/awsx/schema.json#L2366 • Referencing a type: https://github.com/pulumi/pulumi-awsx/blob/master/awsx/schema.json#L2355
w
thanks! appears I can now run make generate / build and they are generating code without error.
Now trying to figure out how I import the new component provider.
s
Which language? If TypeScript,
yarn link
to the SDK locally, ensure the binary is in your path, and it should work.
w
got it!! I'm using python. Now have it functioning, thank you for the pointers.