mirror of https://github.com/pulumi/pulumi.git
ebf838e02e
Partially addressing #12710 ### Description This PR extends Go SDK-gen, specifically for output-versioned invokes such that they no longer rely on the plain invokes for their function body. We do this by implementing and using a sdk function `InvokePackageRaw` which is similar to `InvokePackage` except that it doesn't fail on secrets and actually returns a boolean indicating whether the invoke response contained any secrets. This way, the generated output-versioned invokes can immediately wrap the response as a secret if necessary and more importantly, not failing immediately if the response contained secrets. The sdk-gen test `output-funcs` actually do a runtime test for the newly generated function body and it passes. ~~However, I don't think it covers the _if secret then wrap as secret_ path~~ but maybe that's acceptable because it's a simple one liner ```go // <invoke function body ommited here> if secret { return pulumi.ToSecret(output).(FuncResultOutput), nil } ``` Follow-up PRs with less priority: - [x] A proper test for invokes with secrets in their response - [ ] A conformance test - [ ] Doing the same for _generic_ output-versioned invokes to let them maintain secretness ### EDIT Updated the test in output-funcs such that it now returns a response for an invoke containing secrets |
||
---|---|---|
.. | ||
cgstrings | ||
convert | ||
docs | ||
dotnet | ||
gen_program_test | ||
go | ||
hcl2 | ||
nodejs | ||
pcl | ||
python | ||
report | ||
schema | ||
testing | ||
README.md | ||
docs.go | ||
docs_test.go | ||
programs.md | ||
sdks.md | ||
utilities.go | ||
utilities_test.go | ||
utilities_types.go |
README.md
(codegen)= (crosscode)=
Code generation
Code generation is essential to Pulumi's ability to support both a variety of programming languages and a variety of cloud providers. This package defines the core components of Pulumi's code generation functionality (known as Pulumi CrossCode). At a high level, code generation is used to manage three categories of output: SDKs, programs, and documentation. At a lower level, these all make use of a number of shared concepts such as schema and Pulumi Configuration Language (PCL).
:::{toctree} :maxdepth: 1 :titlesonly:
/pkg/codegen/sdks.md /pkg/codegen/programs.md /pkg/codegen/docs/README /pkg/codegen/schema/README /pkg/codegen/pcl/README :::