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.
Лучшие практики написания надежных программ Pulumi. Охватывает обработку вывода, зависимости ресурсов, структуру компонентов, управление секретами, безопасный рефакторинг с использованием псевдонимов и рабочие процессы развертывания. Источник: pulumi/agent-skills.