https://pulumi.com logo
#general
Title
# general
w

worried-helmet-23171

09/10/2022, 11:44 AM
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

stocky-restaurant-98004

09/10/2022, 8:59 PM
That looks about right. Are you working on writing your own multi-language component by chance?
w

worried-helmet-23171

09/10/2022, 9:09 PM
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

stocky-restaurant-98004

09/10/2022, 9:19 PM
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

worried-helmet-23171

09/10/2022, 9:24 PM
ah, is there a means to autogen. the schema ? Im working off the python boilerplate.
s

stocky-restaurant-98004

09/10/2022, 10:54 PM
Not at this time.
w

worried-helmet-23171

09/11/2022, 2:19 AM
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

stocky-restaurant-98004

09/11/2022, 3:27 PM
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

worried-helmet-23171

09/11/2022, 5:51 PM
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

stocky-restaurant-98004

09/12/2022, 1:14 PM
Which language? If TypeScript,
yarn link
to the SDK locally, ensure the binary is in your path, and it should work.
w

worried-helmet-23171

09/12/2022, 2:56 PM
got it!! I'm using python. Now have it functioning, thank you for the pointers.
4 Views