pulumi/pulumi · error

an inline resource must be specified if no converter or impo

Error message

an inline resource must be specified if no converter or import file is used, missing id

What it means

The `pulumi import` command, when run without a --converter or --file, requires the resource to be specified inline as positional arguments: <type> <name> <id>. This error is thrown when exactly two arguments were supplied, meaning the resource ID is missing. The command prints help output alongside the error so the user can see the expected usage.

Source

Thrown at pkg/cmd/pulumi/operations/import.go:1031

				f, err := makeImportFileFromResourceList(ctx, resp.Resources)
				if err != nil {
					return err
				}
				importFile = f
			} else {
				msg := "an inline resource must be specified if no converter or import file is used, missing "
				if len(args) == 0 {
					contract.IgnoreError(cmd.Help())
					return errors.New(msg + "type, name, and id")
				}
				if len(args) == 1 {
					contract.IgnoreError(cmd.Help())
					return errors.New(msg + "name and id")
				}
				if len(args) == 2 {
					contract.IgnoreError(cmd.Help())
					return errors.New(msg + "id")
				}
				if len(args) > 3 {
					contract.IgnoreError(cmd.Help())
					return errors.New("only expected at most three arguments")
				}
				f, err := makeImportFile(args[0], args[1], args[2], properties, parentSpec, providerSpec, "")
				if err != nil {
					return err
				}
				importFile = f
			}

			if !generateCode && outputFilePath != "" {
				fmt.Fprintln(cmd.ErrOrStderr(), "Output file will not be used as --generate-code is false.")
			}

			var outputResult bytes.Buffer
			output := io.Writer(&outputResult)

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Add the resource ID as the third positional argument: `pulumi import <type> <name> <id>` (e.g. the AWS bucket name, Azure resource ID, or GCP self-link).
  2. If the resource list is large, use an import definition file instead: `pulumi import --file import.json`.
  3. Run `pulumi import --help` to review the expected argument order: type, name, id.

Example fix

// before
pulumi import aws:s3/bucket:Bucket my-bucket
// after
pulumi import aws:s3/bucket:Bucket my-bucket my-bucket-abc123
Defensive patterns

Strategy: validation

Validate before calling

if [ "$#" -lt 3 ]; then echo "usage: pulumi import <type> <name> <id>"; exit 1; fi
pulumi import "$@"

Try / catch

if ! pulumi import "$type" "$name" "$id" 2>err.log; then grep 'missing id' err.log && echo 'Supply the provider resource ID as the third argument.'; fi

Prevention

When it happens

Trigger: Running `pulumi import <type> <name>` with only two positional arguments and no --file or --converter flag (e.g. `pulumi import aws:s3/bucket:Bucket my-bucket`).

Common situations: Users forget the cloud-provider resource ID (which is often a long opaque identifier like an ARN or a UUID) or confuse the import syntax with `pulumi resource` commands; also common when copy-pasting examples that used --file.

Understand the failure class

Background: "no subcommand specified" and "... is required": CLI errors when a required argument is missing — this error's family across 13 libraries.

Related errors


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