Welcome to the fifth devlog for the Wasm/Rust support for Pulumi! This week, I focused on three key areas: project renaming, implementing support for secrets, and introducing a context parameter as preparation for C FFI integration.
Project Renaming
The project has been renamed from Pulumi WASM to Pulumi Wasm. This change is mostly cosmetic and limited to documentation updates—there were no changes to the actual codebase.
Secrets
Pulumi Wasm now supports secrets! 🎉 This brings new functionality to the project:
- A new
Output
constructor,Output::new_secret
, has been added to handle secrets. - Resources that return secrets (like those in the
random
provider) are now correctly processed. - Mapping and combining functions have also been updated to respect secrets:
- A mapped secret
Output
remains secret. - When combining outputs, if any of the inputs are secret, the resulting output is also marked as secret.
- A mapped secret
Context Parameter
To prepare for future C FFI integration, the implicit global Pulumi value has been removed. Instead, most functions now require a PulumiContext
object. This change affects several core areas of the library, including:
-
Output
constructors - Formatting
- Resource creation
- Function invocation
Additionally, the pulumi_main
macro has been reworked. Previously, it was a procedural macro applied directly to the main
function:
use anyhow::Result;
use pulumi_wasm_rust::pulumi_main;
#[pulumi_main]
fn main() -> Result<()> {
}
Now, it is a declarative macro that expects a pulumi_main(PulumiContext)
function defined at the same level:
use anyhow::Result;
use pulumi_wasm_rust::{pulumi_main, PulumiContext};
pulumi_main!();
fn pulumi_main(context: &PulumiContext) -> Result<()> {
}
That’s all for this week’s updates! As always, feedback is welcome — let me know your thoughts or if you run into any issues on either main repository or example repository
Top comments (0)