Pulumi
infrastructure.pulumi
Protects against destructive Pulumi operations like destroy and up with -y (auto-approve)
- 6blocking rules
- 9safe patterns
- 1Critical
- 4High
- 1Medium
[packs]
enabled = ["infrastructure.pulumi"]Evaluated when a command contains pulumi, destroy, state.
Blocking rules
Each rule ID is infrastructure.pulumi:<name>. Use it in allowlists and [policy.rules].
Criticaldestroypulumi destroy removes ALL managed infrastructure. Use 'pulumi preview --diff' first.
Explanation
pulumi destroy removes ALL managed infrastructure: - Every resource in your stack is destroyed - Cloud resources (VMs, databases, networks) deleted - Cannot be undone without backups/recreation - Use --target to destroy specific resources only Preview first: pulumi preview --diff
Highcancelpulumi cancel terminates an in-progress update, which may leave resources in inconsistent state.
Explanation
pulumi cancel stops in-progress operations: - Terminates currently running update/destroy - Resources may be left in inconsistent state - Some resources created, others not - May require manual cleanup Use only when operation is stuck/hung
Highstack-rmpulumi stack rm removes the stack. Use --force only if stack is empty.
Explanation
pulumi stack rm removes the entire stack: - Stack and its state deleted - Does NOT destroy actual infrastructure (unless empty) - --force required if resources still exist - Resources become unmanaged (orphaned) Destroy resources first: pulumi destroy, then rm stack
Highstate-deletepulumi state delete removes resource from state without destroying it.
Explanation
pulumi state delete orphans resources: - Resource removed from Pulumi state - Actual cloud resource still exists - Resource becomes 'unmanaged' (Pulumi ignores it) - May cause drift between state and reality Consider: pulumi refresh to sync state with reality
Highup-yespulumi up -y skips confirmation. Remove -y flag for safety.
Explanation
pulumi up -y skips confirmation: - No opportunity to review changes before applying - Intended for CI/CD, not interactive use - Changes may destroy or recreate resources - Replacements can cause downtime For safety: remove -y and review the preview
Mediumrefresh-yespulumi refresh -y auto-approves state changes. Review changes first.
Explanation
pulumi refresh -y auto-approves state sync: - Syncs Pulumi state with actual cloud resources - May delete resources from state if not found - May update state with drift from cloud Run without -y first to review detected changes
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
pulumi-previewpulumi-stack-lspulumi-stack-selectpulumi-stack-initpulumi-configpulumi-whoamipulumi-versionpulumi-aboutpulumi-logs