pulumi/pulumi · error

at least one of --source or --dest must be provided

Error message

at least one of --source or --dest must be provided

What it means

Validation error from `pulumi state move` (pkg/cmd/pulumi/state/state_move.go): the command needs at least one of the --source or --dest stack flags to know what move operation to perform; invoking it with neither is rejected up front before any stack is loaded.

Source

Thrown at pkg/cmd/pulumi/state/state_move.go:84

	stateMove := &stateMoveCmd{
		Colorizer: cmdutil.GetGlobalColorization(),
	}
	cmd := &cobra.Command{
		Use:     "move",
		Aliases: []string{"mv"},
		Short:   "Move resources from one stack to another",
		Long: `Move resources from one stack to another

This command can be used to move resources from one stack to another. This can be useful when
splitting a stack into multiple stacks or when merging multiple stacks into one.
`,
		RunE: func(cmd *cobra.Command, args []string) error {
			ctx := cmd.Context()
			sink := cmdutil.Diag()
			ws := pkgWorkspace.Instance

			if sourceStackName == "" && destStackName == "" {
				return errors.New("at least one of --source or --dest must be provided")
			}
			sourceStack, err := cmdStack.RequireStack(
				ctx,
				sink,
				ws,
				cmdBackend.DefaultLoginManager,
				sourceStackName,
				cmdStack.LoadOnly,
				display.Options{
					Color:         cmdutil.GetGlobalColorization(),
					IsInteractive: true,
				},
				"",
			)
			if err != nil {
				return err
			}
			destStack, err := cmdStack.RequireStack(

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Pass --dest <stack> to move resources into another stack
  2. Pass --source <stack> to move resources out of a specific stack
  3. Pass both flags to move between two explicitly named stacks
  4. Check `pulumi state move --help` for the expected flag syntax

Example fix

// before
$ pulumi state move urn:pulumi:prod::web::aws:s3/bucket:Bucket
error: at least one of --source or --dest must be provided

// after
$ pulumi state move urn:pulumi:prod::web::aws:s3/bucket:Bucket --dest org/proj/archive
Defensive patterns

Strategy: validation

Validate before calling

$ pulumi state move "$urn" --source "${SOURCE:-}" --dest "${DEST:-}"; [ -n "$SOURCE" ] || [ -n "$DEST" ] || { echo 'set --source and/or --dest'; exit 1; }

Prevention

When it happens

Trigger: Running `pulumi state move <urn...>` (or with no args) without passing --source and/or --dest, e.g., `pulumi state move urn:pulumi:...` alone.

Common situations: Forgetting the flags on first use of the command; assuming the current stack is implicitly the source; copy-pasting an example that omitted the flags.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/b011f05c008d9d80. Report an issue: GitHub.