Hi all :wave: , when using a Component from a random package, it's not always obvious what the defau...
j
Hi all 👋 , when using a Component from a random package, it's not always obvious what the default value is for the Inputs. For example, if I do:
Copy code
import pulumi_eks as eks
eks.Cluster( ... )
..but don't specify an authentication_mode, how do I work out what it will use? (that's just an example.. I'm interested in how to discover this in general, not this one case).
âž• 1
e
I think this is a case of just having to hope for good documentation, and/or reading the source code. Components can do arbitrarily complex logic to decided default values, so I don't think there's any general answer for this.
j
Understood, thanks for your reply. It would have been nice to see defaults on the simple args at least, particularly since the docs are not very complete.
âž• 1
s
I agree with Pete here. Providers secretly setting a default value has bitten me a countless number of times. A related issue is that, at the type-system level, parameters are almost always marked as optional, even if they're not and Azure will complain if you don't set them. Once again, I have to run
pulumi up
to find out which parameters I have to set and which I don't.
e
at the type-system level, parameters are almost always marked as optional
That's often because they're optional based on if other parameters are set or not. There's no good way of expressing in the typesystems that like "field X is required, but only if field Y is set"
s
That's often because they're optional based on if other parameters are set or not.
Yes, sometimes they are but in 99% of the cases (in my experience) that's not the case. For instance, it seems all resource parameters in pulumi-azure & pulumi-azure-native are declared as optional, even if I always have to specify them.
e
That should be raised as issues on the provider repo. If they are always required they should be typed as required.
s
Ok, I will do that then, thanks so much!