Good morning! Is is possible to hook into Pulumi a...
# general
f
Good morning! Is is possible to hook into Pulumi and throw an error when a certain key is not passed to a component? e.g., I’d like to throw an error if a component does not explicitly pass a the
provider
key.
s
You want to make
resourceOptions.provider
required in a ComponentResource?
If so, I would just validate this in the constructor.
f
I want to make it required for all pulumi calls.
Any call to any Pulumi component in my code must pass the resourceOptions.provider.
s
You might be able to do it with a policy pack. You might also be able to make a class that inherits from ComponentResouce that throws an exception if it’s not defined.