Why: Resources created inside apply() don't appear in pulumi preview, making changes unpredictable. Pulumi cannot properly track dependencies, leading to race conditions and deployment failures.
Why: Pulumi builds a directed acyclic graph (DAG) based on input/output relationships. Passing outputs directly ensures correct creation order. Unwrapping values manually breaks the dependency chain, causing resources to deploy in wrong order or reference values that don't exist yet.
Why: ComponentResource classes group related resources into reusable, logical units. Without components, your resource graph is flat, making it hard to understand which resources belong together, reuse patterns across stacks, or reason about your infrastructure at a higher level.
Migliori pratiche per scrivere programmi Pulumi affidabili. Copre la gestione dell'output, le dipendenze delle risorse, la struttura dei componenti, la gestione dei segreti, il refactoring sicuro con alias e i flussi di lavoro di distribuzione. Fonte: pulumi/agent-skills.