Programs as components #16009
Labels
area/engine
Pulumi engine
area/sdks
Pulumi language SDKs
kind/enhancement
Improvements or new features
Hello!
Issue details
Internal docs: https://docs.google.com/document/d/1282iElLnIBPzu1LmZo2bOm5V2AU4SLgY1INX2fyYxXo/edit
Originally put together as a hackweek project by @danielrbradley, @VenelinMartinov, and @tgummerer: https://github.com/pulumi/pulumi/tree/hackathon_substack
This issue is to track getting in the base work required for this feature. That is being able to run another Pulumi program (of any language) to create a component resource in a parent program.
This requires work in the engine to support this, and some work in the core SDKs (not sdk-gen) to expose this sub-program type. Similar to how StackReferences are just a core type in the SDKs.
In the engine we allow
Construct
calls forpulumi:pulumi:Stack
. This takes a source path and a map of config values as its input properties. The source path to start will be expected to be a local file path containing the other program with its own Pulumi.yaml. The engine will create a new component Stack resource but with a special URN that includes the new stacks name in its type. This is so all the child resource will have unique URNs without needing to edit the program to appendstackName-
to every resource.Once the stack resource is registered the sub-programs project file will be read and a language runtime started up for it, the engine will then make a proxy resource monitor and tell the language runtime to
Run
the program using the given proxy and the config passed in via the stack properties.The resource monitor proxy just forwards requests on to the main resource monitor but fixes up the Parent field to default to the stack resource created. It also blocks the registration the program will try to do of its own Stack resource.
We should be able to test this feature via engine and conformance tests.
Other issues will be raised to extend the capabilities of this feature to include things such as pulling programs from other sources (templates/git repos/etc), and to add static typing and sdk generation to sub-programs.
Affected area/feature
The text was updated successfully, but these errors were encountered: