sparse-intern-71089
11/09/2021, 7:30 PMlittle-cartoon-10569
11/09/2021, 7:53 PMlittle-cartoon-10569
11/09/2021, 7:53 PMlittle-cartoon-10569
11/09/2021, 7:54 PMlimited-rainbow-51650
11/09/2021, 8:05 PMgetComponentConfig()
which in its implementation would e.g. call pulumi.getConfig('my-component-name').require(...)
(or requireObject
)little-cartoon-10569
11/09/2021, 8:09 PMpulumi.getConfig()
at all, because you're not in a Pulumi runtime.little-cartoon-10569
11/09/2021, 8:11 PMlimited-rainbow-51650
11/09/2021, 8:11 PMpulumi.getConfig()
wouldn't be inside my component implementation, this would be in the getComponentConfig
function which is next to my component class.little-cartoon-10569
11/09/2021, 8:11 PMgetComponentConfig()
to inject values?limited-rainbow-51650
11/09/2021, 8:14 PMconfig = {
key: value
}
component = new package.ComponentResource('name', config)
What I am hinting at is this:
config = package.getComponentConfig() // <- only this reads from stack config with a separate key
component = new package.ComponentResource('name', config)
So you see that package
exposes two items: the config helper function and my component resource, which still is decoupled from how config is passed. Actually, it exposes 3 items: I missed the args
interface type, e.g. ComponentArgs
limited-rainbow-51650
11/09/2021, 8:15 PMlimited-rainbow-51650
11/09/2021, 8:16 PMaws
top level keylittle-cartoon-10569
11/09/2021, 8:22 PMlittle-cartoon-10569
11/09/2021, 8:23 PMgetComponentConfig()
, and the program needs the same value for itself (independent of the component), then you really need the same value to be defined twice in your config...limited-rainbow-51650
11/09/2021, 8:26 PMlittle-cartoon-10569
11/09/2021, 8:33 PMworried-city-86458
11/09/2021, 10:44 PM