Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support generic Pulumi resource types in schema #6346

Open
EvanBoyle opened this issue Feb 16, 2021 · 2 comments · May be fixed by #15795
Open

Support generic Pulumi resource types in schema #6346

EvanBoyle opened this issue Feb 16, 2021 · 2 comments · May be fixed by #15795
Labels
area/codegen SDK-gen, program-gen, convert area/component-packages aka multi-language components kind/enhancement Improvements or new features size/S Estimated effort to complete (1-2 days).

Comments

@EvanBoyle
Copy link
Contributor

Our schema (and SDK generators) doesn't currently support specifying property types as generic pulumi resource types (pulumi.Resource, pulumi.CustomResource, etc). The schema only appears to support references to specific resource types defined in schema.

I'm able to work around this by using "pulumi.json#/Any" but it would be nice to generate the correct type in the SDKs.

@EvanBoyle EvanBoyle added area/codegen SDK-gen, program-gen, convert area/component-packages aka multi-language components labels Feb 16, 2021
@justinvp
Copy link
Member

justinvp commented Feb 16, 2021

Does the distinction between pulumi.Resource and pulumi.CustomResource matter? Just wondering if adding a "pulumi.json#/Resource" built-in (that emitted the equivalent of pulumi.Resource in each language) would be sufficient for your use case.

@EvanBoyle
Copy link
Contributor Author

For my specific use case I targeting CustomResource and ComponentResource, but am fine with just using Resource. I think starting with "pulumi.json#/Resource" would be fine, but in principle, we should support similar builtins for providers, custom resources, component resources, etc, no?

@infin8x infin8x added the kind/enhancement Improvements or new features label Jun 7, 2021
@infin8x infin8x added the size/S Estimated effort to complete (1-2 days). label Jul 20, 2021
AaronFriel added a commit that referenced this issue Mar 27, 2024
This commit exists to enable the Java SDK to update and use it, which then
unblocks the next commit passing tests.

Part of #6346
AaronFriel added a commit that referenced this issue Mar 27, 2024
A new built-in type, `pulumi.json#/Resource` is added to the schema to refer to
any resource. This unblocks schematizing resources like
`kubernetes.yaml/v2.ConfigFile`, which ideally would declare an output like so:

```json
            "properties": {
                "resources": {
                    "type": "array",
                    "items": {
                        "$ref": "pulumi.json#/Resource"
                    },
                    "description": "Resources created by the ConfigFile."
                }
            },
```

This is a small ergonomic improvement over `pulumi.json#/Any`, and fixes #6346.
@AaronFriel AaronFriel linked a pull request Mar 27, 2024 that will close this issue
AaronFriel added a commit that referenced this issue Mar 27, 2024
A new built-in type, `pulumi.json#/Resource` is added to the schema to refer to
any resource. This unblocks schematizing resources like
`kubernetes.yaml/v2.ConfigFile`, which ideally would declare an output like so:

```json
            "properties": {
                "resources": {
                    "type": "array",
                    "items": {
                        "$ref": "pulumi.json#/Resource"
                    },
                    "description": "Resources created by the ConfigFile."
                }
            },
```

This is a small ergonomic improvement over `pulumi.json#/Any`, and fixes #6346.
github-merge-queue bot pushed a commit that referenced this issue Apr 9, 2024
This commit exists to enable the Java SDK to update and use it, which
then unblocks the next commit passing tests.

Part of #6346

---------

Co-authored-by: Eron Wright <eron@pulumi.com>
AaronFriel added a commit to pulumi/pulumi-java that referenced this issue Apr 20, 2024
AaronFriel added a commit that referenced this issue Apr 20, 2024
A new built-in type, `pulumi.json#/Resource` is added to the schema to refer to
any resource. This unblocks schematizing resources like
`kubernetes.yaml/v2.ConfigFile`, which ideally would declare an output like so:

```json
            "properties": {
                "resources": {
                    "type": "array",
                    "items": {
                        "$ref": "pulumi.json#/Resource"
                    },
                    "description": "Resources created by the ConfigFile."
                }
            },
```

This is a small ergonomic improvement over `pulumi.json#/Any`, and fixes #6346.
AaronFriel added a commit that referenced this issue Apr 30, 2024
A new built-in type, `pulumi.json#/Resource` is added to the schema to refer to
any resource. This unblocks schematizing resources like
`kubernetes.yaml/v2.ConfigFile`, which ideally would declare an output like so:

```json
            "properties": {
                "resources": {
                    "type": "array",
                    "items": {
                        "$ref": "pulumi.json#/Resource"
                    },
                    "description": "Resources created by the ConfigFile."
                }
            },
```

This is a small ergonomic improvement over `pulumi.json#/Any`, and fixes #6346.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/codegen SDK-gen, program-gen, convert area/component-packages aka multi-language components kind/enhancement Improvements or new features size/S Estimated effort to complete (1-2 days).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants