-
Notifications
You must be signed in to change notification settings - Fork 113
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
spec
is missing in output of CustomResource
#2890
Comments
Thanks @adriangb; yes, while the You could potentially work around this limitation by just using the values you passed as inputs? |
It seems like at runtime the input data is copied. I used a The problem with using the input values directly is that you need to then add |
I’m no typescript expert, but could you make the input generic (requiring the apiVersion and kind keys via an interface or similar) so that the input data is type safe available in the output? |
Glad that workaround worked for you. I did some digging on whether we can make the typing better here, and it seems we're a little hamstrung by the fact that
So you could imagine doing something like:
but that blows up because "A class can only implement an object type or intersection of object types with statically known members." FWIW mapped types syntax is not supported directly on the class either:
(yields lots of syntax errors) So while we could create a function that does ~ the same work as the constructor for Probably the best we could do is a wrapper for the type coercion like this:
(There's still some gotchas to work out when some of the input parameters are already |
Could you put the input into |
What happened?
I'm unable to access the
spec
of a custom resourceExample
Output of
pulumi about
❯ pulumi about
CLI
Version 3.111.0
Go Version go1.22.1
Go Compiler gc
Plugins
NAME VERSION
cloudflare 5.21.0
gcp 7.11.0
google-native 0.32.0
kubernetes 4.8.0
nodejs unknown
random 4.15.1
tls 5.0.1
Host
OS darwin
Version 14.3.1
Arch arm64
Dependencies:
NAME VERSION
@pulumi/cloudflare v5.21.0
@pulumi/kubernetes v4.8.0
@pulumi/tls v5.0.1
prettier 3.2.5
@pulumi/google-native v0.32.0
@pulumi/pulumi 3.107.0
eslint-plugin-simple-import-sort 10.0.0
eslint 8.56.0
typescript 5.3.3
@pulumi/gcp v7.11.0
@typescript-eslint/eslint-plugin 6.21.0
@typescript-eslint/parser 6.21.0
eslint-config-prettier 9.1.0
eslint-config-standard 17.1.0
@pulumi/random v4.15.1
@types/node 20.11.20
Additional context
https://pulumi-community.slack.com/archives/CRFURDVQB/p1710688887460189
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: