docs icon indicating copy to clipboard operation
docs copied to clipboard

Better document stack transformations

Open joeduffy opened this issue 4 years ago • 2 comments

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.

joeduffy avatar May 05 '20 15:05 joeduffy

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>(() => {});
});

tenwit avatar May 15 '20 04:05 tenwit

Useful internal discussion thread on this: https://pulumi.slack.com/archives/C011EMDQ8JE/p1719862660749509

cnunciato avatar Jul 02 '24 00:07 cnunciato