Skip to content
Latchkey

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 failed

Common 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

  1. Read the resource line that shows the validation error.
  2. Correct the invalid argument or supply the missing config.
  3. Re-run the preview.
Terminal
pulumi config set aws:region us-east-1
pulumi preview

Run with more diagnostics

Add --diff and verbose logging to see exactly which resource and field the preview rejected.

Terminal
pulumi preview --diff --logtostderr -v=3

How 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →