Open joeduffy opened 4 years ago
Testing stack transformations took a lot of working out today. I'm probably doing it wrong, but in case I'm not, this might be something that could be added to the docs:
import { runInPulumiStack } from "@pulumi/pulumi/runtime/stack";
runInPulumiStack(() => {
pulumi.runtime.registerStackTransformation(myStackTransformation);
describe('test stuff', function() {
...
});
return new Promise<void>(() => {});
});
Useful internal discussion thread on this: https://pulumi.slack.com/archives/C011EMDQ8JE/p1719862660749509
The documentation on stack transformations is a bit "light." The best we have is this documentation page plus ancillary blog posts. The specifics of how transformations work is very different between languages, however -- particularly in Go and .NET where the weakly typed APIs require that you use reflection -- and the global stack transformation capability is mentioned only in passing.
We should do a better job at explaining this and probably link to language-specific API docs for detailed examples of how to use these in each of the languages.