pulumi / docs

All things Pulumi docs!
https://pulumi.com
Apache License 2.0
127 stars 222 forks source link

Better document stack transformations #11784

Open joeduffy opened 4 years ago

joeduffy commented 4 years ago

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.

tenwit commented 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>(() => {});
});
cnunciato commented 3 months ago

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