Hey is there a way to tell certain libraries (e.g....
# general
t
Hey is there a way to tell certain libraries (e.g. kubernetes) to ALWAYS require I pass it a provider. Often times I will forget one and it'll default to my environment then fail when I get to the CI
l
Not as a built-in feature, but stack and resource transformations have access to the opts parameter, so you could throw an exception from there.
t
Thank you! For others who are curious this seems to work:
Copy code
pulumi.runtime.registerStackTransformation((args) => {
  if (
    args.type.includes("kubernetes") &&
    !args.type.includes("provider") &&
    !args.opts.provider
  ) {
    throw `Please specify provider for ${args.name}`;
  }
  return undefined;
});
👍 1