pulumi.ComponentResource, a constructor that creates child resources, and public pulumi.Output properties for the values consumers will reference. The call site in .iac is unchanged from tutorial 18 or 19 — the same component block, the same source path pointing at a local directory, the same component.name.output references. Python or TypeScript or Go, the authoring language is never visible to .iac consumers.
What you’ll learn
- How to structure a Python
ComponentResourcefor use with ubx - The idiomatic Python pattern:
ComponentResource+register_outputs() - The identical call site across all authoring languages
Why this matters
Python components run through Pulumi’s standard Python SDK — no ubx-specific runtime, no special packaging. A Python component that works standalone in a Pulumi Python project works identically when consumed via ubx.
The source code
How it works
The Python component follows standard Pulumi patterns
super().__init__("ubx:component:RdsDatabase", name, {}, opts) registers the component in Pulumi’s resource graph. Child resources are created with opts=pulumi.ResourceOptions(parent=self). register_outputs() exposes outputs to callers.Typed args via a dataclass-style args class
Python doesn’t have TypeScript’s interface syntax, so a dedicated
RdsDatabaseArgs class provides typed, documented inputs. Defaults live in __init__, making the interface clear without requiring keyword-only arguments on the constructor.Identical call site across languages
Compare these three component blocks — all three call the same interface with different implementations behindsource:
Common mistakes
Run it
What you learned
A Python component extends
pulumi.ComponentResource with register_outputs() for outputsThe
.iac call site is identical regardless of authoring languageLocal Python component resolution is forward-looking in ubx v1 (tracked as UBX-125)
Next steps
Go component
Author the same component in Go
Local .iac component
The fully-supported local component path today
Full runnable example: github.com/ubiquex/ubx-examples/20-python-component

