Blueprints

Errors and rollbacks

How Blueprints catches mistakes early and what happens when a deploy fails.

Most errors happen before deploy

Validation runs at more than one point, so problems surface as early as possible:

  • As you write. The definers check their input when you call them, so a missing required field or a malformed value is flagged in your editor and at build time.
  • Before applying. When you run plan or deploy, the whole file is validated (structurally and per resource) before any change is made.

Because plan is read-only, running it is the safe way to surface most errors without touching anything.

Kinds of failure

FailureWhat it means
Validation errorA resource is missing a required field, has an invalid value, or the file is structurally wrong. Caught before deploy.
Unresolved reference or cycleA $.resources.<name> points at something that doesn't exist, or two resources depend on each other. See The resource graph.
Scope mismatchAn organization-scoped resource type on a project-scoped stack, or a project-scoped resource with no resolvable project. See Stacks and scope.
Deletion-policy violationA change would remove a resource whose deletion policy forbids it (for example a retain or protect resource).
Execution failureA change passed validation but failed while being applied; for instance, an underlying service rejected it.

Errors come back with a clear name, a human-readable message, and the path to the resource involved, so you can map the failure straight to a line in your file.

What rollback does

If a deploy fails after some changes have already been applied, Blueprints attempts to undo the completed changes in reverse order and marks the operation as failed. The goal is to leave the stack consistent rather than half-applied.

Rollback is best-effort

Reading what happened

A deploy streams its progress until the operation finishes. To review a past deploy after it has stopped tailing, including the messages from a failure, use the logs:

Recovering

  • Read the error message and the resource path it points to.
  • Fix the blueprint file (or the underlying resource, if something external changed).
  • Run blueprints plan to confirm the diff is now what you expect.
  • Run blueprints deploy again.

Was this page helpful?