{"record":{"id":"112ddf128bc5fa3c","repo":"pulumi/pulumi","slug":"version-must-be-provided","errorCode":null,"errorMessage":"version must be provided","messagePattern":"version must be provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resource/deploy/import.go","lineNumber":59,"sourceCode":"type Parameterization struct {\n\t// The base plugin name to use for this parameterization.\n\tPluginName tokens.Package\n\t// The version of the plugin to use for this parameterization.\n\tPluginVersion semver.Version\n\t// The value to use for this parameterization.\n\tValue []byte\n}\n\n// ToProviderParameterization converts a workspace parameterization to a provider parameterization.\nfunc (p *Parameterization) ToProviderParameterization(\n\ttyp tokens.Type, version *semver.Version,\n) (tokens.Package, *semver.Version, *workspace.Parameterization, error) {\n\tif p == nil {\n\t\treturn typ.Package(), version, nil, nil\n\t}\n\n\tif version == nil {\n\t\treturn \"\", nil, nil, errors.New(\"version must be provided\")\n\t}\n\n\treturn p.PluginName, &p.PluginVersion, &workspace.Parameterization{\n\t\tName:    string(typ.Package()),\n\t\tVersion: *version,\n\t\tValue:   p.Value,\n\t}, nil\n}\n\n// An Import specifies a resource to import.\ntype Import struct {\n\tType              tokens.Type       // The type token for the resource. Required.\n\tName              string            // The name of the resource. Required.\n\tID                resource.ID       // The ID of the resource. Required.\n\tParent            resource.URN      // The parent of the resource, if any.\n\tProvider          resource.URN      // The specific provider to use for the resource, if any.\n\tVersion           *semver.Version   // The provider version to use for the resource, if any.\n\tPluginDownloadURL string            // The provider PluginDownloadURL to use for the resource, if any.","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/import.go#L41-L77","documentation":"When converting a pulumi import file's provider parameterization into a provider parameterization, a semantic version is required whenever a parameterized package (p != nil) is being imported. If the version is missing, ToProviderParameterization returns this sentinel error. Parameterized providers cannot be resolved to a plugin without an explicit version.","triggerScenarios":"Running `pulumi import` with an import file specifying a parameterized provider entry but omitting the `version` field while the package requires parameterization.","commonSituations":"Hand-written import files, or generated files for parameterized packages (e.g. bridged multi-version providers) where the version field was dropped.","solutions":["Add the `version` field to the provider entry in the import file","Regenerate the import file with `pulumi import` so the version is captured","Use a non-parameterized package reference if no specific version is needed"],"exampleFix":"// before (import file)\n{\"type\":\"pulumi:providers:aws\",\"name\":\"aws\"}\n// after\n{\"type\":\"pulumi:providers:aws\",\"name\":\"aws\",\"version\":\"6.0.0\"}","handlingStrategy":"validation","validationCode":"if parameterization != nil && version == nil { return errors.New(\"version must be provided in import file for parameterized package\") }","typeGuard":"func hasVersion(imp Import) bool { return imp.Version != nil || imp.Parameterization == nil }","tryCatchPattern":null,"preventionTips":["Always include `version` in import file provider entries","Generate import files with the CLI rather than by hand","Pin provider versions in the program so imports can infer them"],"tags":["go","pulumi-import","provider","version"],"backgroundTag":"missing-required-field","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}