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
- 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).
- If the resource list is large, use an import definition file instead: `pulumi import --file import.json`.
- 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
- Always pass the cloud resource ID as the third positional argument when not using --file.
- Use --file for anything beyond a single simple resource.
- Check `pulumi import --help` for the expected argument order before scripting.
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
- schedule ID cannot be empty
- expected a path and a value
- expected a path
- no organization available; pass --org or set a default with
- a prompt argument is required in non-interactive mode
AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31).
Data as JSON: /api/errors/307e88600f9ccdcf.
Report an issue: GitHub.