Programs#
Programs may be generated from a program written in a supported source language.
This process, often referred to as “programgen”, exists primarily to support the
pulumi convert
command, though it is also used in other places such as language conformance
testing. Programgen begins by using a converter
plugin to convert from a source language into Pulumi Configuration
Language (PCL), before generating a program in the target language from
this PCL definition. The PCL-to-target-language conversion is exposed by a
language host through two endpoints:
📞 GenerateProgram, which typically wraps the
GenerateProgramGo function in the relevantgen_program.goin this package – see e.g. pulumi/pulumi:pkg/codegen/nodejs/gen_program.go for NodeJS or pulumi/pulumi:pkg/codegen/python/gen_program.go for Python.GenerateProgramonly generates source files (e.g..ts,.py) etc.📞 GenerateProject, which again typically wraps the
GenerateProjectGo function (itself typically found alongsideGenerateProgram).GenerateProjectgenerates a complete project directory, including both aPulumi.yamlfile and language-appropriate files such aspackage.json,requirements.txt, etc.