https://pulumi.com logo
#python
Title
# python
k

kind-jelly-61624

06/08/2022, 10:49 PM
Is there a way to unwrap and import the Inputs and Properties of a resource from an external schema.json into your own? I’m building a ComponentResource that’s a wrapper over a pulumi-aws resource. I’d like the Component to accept the same inputs, and return the same outputs as the pulumi-aws resource - but I also don’t want to add each input and output to the schema.json manually. Is there a way to import a resource directly into my schema.json?
d

damp-fall-55922

06/08/2022, 10:53 PM
following this as I'm doing a very similar thing
b

billowy-army-68599

06/08/2022, 11:38 PM
@kind-jelly-61624 you can reference the entire object schema like so: https://github.com/pulumi/pulumi-component-provider-py-boilerplate/blob/main/schema.json#L17 That'll also work for an output
💯 1
k

kind-jelly-61624

06/08/2022, 11:43 PM
Thanks! I can get the properties and outputs working by referencing that entire object since i’m returning the entire bucket. But i’m not sure how to configure the inputs since it should accept the same S3 bucket args as the pulumi-aws resource
b

billowy-army-68599

06/08/2022, 11:45 PM
ohhhhh sorry I see now, perhaps try doing the reverse, I've using the
$ref
as an input in the input properties
I've never tried this, so not sure how it works
k

kind-jelly-61624

06/08/2022, 11:46 PM
Copy code
"inputProperties": {
        "parameters": {
          "$ref": "/aws/v4.0.0/schema.json#/resources/aws:s3%2Fbucket:Bucket",
          "description": "parameters to create an s3 bucket"
        }
      },
like that you mean?
so the problem with that is there’s the “parameters” input that encapsulates all the actual s3 inputs, i was hoping to have this exploded somehow - where the sdk can accept the same list of inputs as an external resource
b

billowy-army-68599

06/08/2022, 11:51 PM
that's not possible, but please open an issue - its a good feature request
k

kind-jelly-61624

06/08/2022, 11:52 PM
will do thanks!
2 Views