pulumi/pulumi · error

getting autonaming config: %w

Error message

getting autonaming config: %w

What it means

`pulumi up` parses the project's autonaming configuration (autonaming patterns/overrides scoped to the stack) into an autonamer before running the deployment. This error wraps a failure of autonaming.ParseAutonamingConfig, meaning the autonaming settings in the project or stack config could not be parsed or decrypted.

Source

Thrown at pkg/cmd/pulumi/operations/up.go:239

		replaceURNs := slice.Prealloc[string](len(replaces) + len(targetReplaces))
		excludeURNs := slice.Prealloc[string](len(excludes))
		targetURNs = append(targetURNs, targets...)
		excludeURNs = append(excludeURNs, excludes...)
		replaceURNs = append(replaceURNs, replaces...)

		for _, tr := range targetReplaces {
			targetURNs = append(targetURNs, tr)
			replaceURNs = append(replaceURNs, tr)
		}

		refreshOption, err := getRefreshOption(proj, refresh)
		if err != nil {
			return err
		}

		autonamer, err := autonaming.ParseAutonamingConfig(autonamingStackContext(proj, s), cfg.Config, decrypter)
		if err != nil {
			return fmt.Errorf("getting autonaming config: %w", err)
		}

		opts.Engine = engine.UpdateOptions{
			ParallelDiff:              env.ParallelDiff.Value(),
			LocalPolicyPacks:          engine.MakeLocalPolicyPacks(policyPackPaths, policyPackConfigPaths),
			Parallel:                  parallel,
			Debug:                     debug,
			Refresh:                   refreshOption,
			RefreshProgram:            runProgram,
			ReplaceTargets:            deploy.NewUrnTargets(replaceURNs),
			UseLegacyDiff:             env.EnableLegacyDiff.Value(),
			UseLegacyRefreshDiff:      env.EnableLegacyRefreshDiff.Value(),
			DisableProviderPreview:    env.DisableProviderPreview.Value(),
			DisableResourceReferences: env.DisableResourceReferences.Value(),
			DisableOutputValues:       env.DisableOutputValues.Value(),
			ShowSecrets:               showSecrets,
			Targets:                   deploy.NewUrnTargets(targetURNs),
			Excludes:                  deploy.NewUrnTargets(excludeURNs),

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Review the `autonaming` section in Pulumi.yaml for syntax errors and fix the pattern
  2. Inspect the wrapped inner error (%w) to identify the bad value or key
  3. If autonaming overrides use secrets, verify PULUMI_CONFIG_PASSPHRASE / secrets provider
  4. Remove or simplify the autonaming config temporarily to isolate the problem

Example fix

// before
# Pulumi.yaml
autonaming:
  pattern: "${name}-{{...invalid...}}"
// after
autonaming:
  pattern: "${config::project}-${name}"
Defensive patterns

Strategy: validation

Validate before calling

// Ensure Pulumi.yaml autonaming block parses as valid YAML before up
import fs from 'fs';
import YAML from 'yaml';
const proj = YAML.parse(fs.readFileSync('Pulumi.yaml', 'utf8'));
if (proj.autonaming && typeof proj.autonaming !== 'object') {
  throw new Error('autonaming section malformed');
}

Type guard

function hasValidAutonaming(proj) {
  return !proj.autonaming ||
    (typeof proj.autonaming === 'object' && typeof proj.autonaming.pattern === 'string');
}

Try / catch

try {
  execSync('pulumi up', { stdio: 'inherit' });
} catch (e) {
  if (String(e.message).includes('getting autonaming config')) {
    console.error('Check the autonaming section of Pulumi.yaml:', e.message);
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `pulumi up` when autonaming config in Pulumi.yaml (or stack config overrides) has an invalid pattern, malformed value, or a secret value that the decrypter cannot decrypt.

Common situations: Miswritten autonaming pattern syntax in Pulumi.yaml, autonaming override keys in stack config that don't parse, or encrypted autonaming values with a wrong passphrase/secret provider.

Related errors


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