pulumi/pulumi · error

project names are limited to 100 characters

Error message

project names are limited to 100 characters

What it means

Project names are capped at 100 characters by ValidateProjectName. Longer strings are rejected to keep URNs, resource names, and backend identifiers within safe limits.

Source

Thrown at sdk/go/common/tokens/project.go:33

package tokens

import "errors"

// ValidateProjectName validates that the given string is a valid project name.
// The string must meet the following criteria:
//
//   - must be non-empty
//   - must be at most 100 characters
//   - must contain only alphanumeric characters,
//     hyphens, underscores, and periods (see [IsName])
//
// Returns a descriptive error if the string is not a valid project name.
func ValidateProjectName(s string) error {
	switch {
	case s == "":
		return errors.New("project names may not be empty")
	case len(s) > 100:
		return errors.New("project names are limited to 100 characters")
	case !IsName(s):
		return errors.New("project names may only contain alphanumerics, hyphens, underscores, and periods")
	}
	return nil
}

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Shorten the project name to <=100 characters
  2. Stop concatenating long prefixes into the project name
  3. Derive the name from a stable short identifier (repo slug) instead of the full path

Example fix

// before
name := "acme-corp-platform-" + strings.ReplaceAll(fullDirPath, "/", "-")
// after
name := "acme-" + filepath.Base(fullDirPath)
Defensive patterns

Strategy: validation

Validate before calling

if len(projectName) > 100 {
    return fmt.Errorf("project name %q is %d chars; max is 100", projectName, len(projectName))
}
return tokens.ValidateProjectName(projectName)

Type guard

func projectNameFits(s string) bool { return len(s) <= 100 }

Try / catch

if err := tokens.ValidateProjectName(long); err != nil {
    if strings.Contains(err.Error(), "100 characters") {
        long = long[:100]
        err = tokens.ValidateProjectName(long)
    }
    if err != nil { return err }
}

Prevention

When it happens

Trigger: Calling tokens.ValidateProjectName with a string longer than 100 bytes — typically derived by prefixing directories, org names, or CI-generated names.

Common situations: Deeply nested monorepo directories auto-derived as project names; org-name + repo-name concatenation in CI pipelines; programmatic project creation joining multiple identifiers.

Related errors


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