Pulumi "preview failed" in CI
Pulumi ran the program to build a plan and the preview did not complete. Unlike an update, nothing was changed, but a provider check or a program error stopped the plan from being computed.
What this error means
A pulumi preview step ends with "error: preview failed", usually after a resource line shows a validation or provider check error.
pulumi
aws:ec2:Instance web **error:** error: aws:ec2/instance:Instance resource
'web' has a problem: expected instance_type to be a valid type
error: preview failedCommon causes
A provider check rejected a resource input
The provider validated inputs during preview and found an invalid value, so the plan cannot be produced.
The program threw while building the plan
An exception or unset config during resource registration stops the preview before a plan exists.
How to fix it
Fix the reported input or config
- Read the resource line that shows the validation error.
- Correct the invalid argument or supply the missing config.
- Re-run the preview.
Terminal
pulumi config set aws:region us-east-1
pulumi previewRun with more diagnostics
Add --diff and verbose logging to see exactly which resource and field the preview rejected.
Terminal
pulumi preview --diff --logtostderr -v=3How to prevent it
- Validate resource inputs and required config in the program.
- Run preview on pull requests so plan errors surface before merge.
- Keep provider versions current so validation matches the API.
Related guides
Pulumi "update failed" in CIFix Pulumi "error: update failed" in CI - one or more resource operations failed during `pulumi up`. The spec…
Pulumi unexpected replacement (delete-create) in CIFix an unexpected Pulumi replacement in CI - the plan shows a resource being deleted and recreated because a…
Pulumi "Running program ... failed" language runtime error in CIFix Pulumi "error: Running program ... failed with an unhandled exception" in CI - your program threw before…