{
  "slug": "pulumi-provider-resources-support-envvarmappings-383f3cf6cb45",
  "title": "Pulumi provider resources support EnvVarMappings",
  "tools": [
    "pulumi"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-02-10T17:11:21.000Z",
  "announced_at": "2026-02-10T17:11:21.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When two instances of the same provider need different values for the same environment variable, define a distinct source variable for each instance and map it to the name the provider expects.",
    "examples": [
      "providerOne, err := foo.NewProvider(ctx, \"foo-provider-one\", &foo.ProviderArgs{}, pulumi.EnvVarMappings(map[string]string{\"PASSWORD_ONE\": \"PASSWORD\"}))\nif err != nil { return err }\nproviderTwo, err := foo.NewProvider(ctx, \"foo-provider-two\", &foo.ProviderArgs{}, pulumi.EnvVarMappings(map[string]string{\"PASSWORD_TWO\": \"PASSWORD\"}))\nif err != nil { return err }"
    ],
    "gotchas": [
      "Version: v3.220.0",
      "pulumi.EnvVarMappings(map[string]string{...}): Resource option for remapping environment variables on provider resources.",
      "map key (source environment variable) (required): Name of the custom environment variable defined in the environment; its value is used for the mapping.",
      "map value (target environment variable) (required): Name of the environment variable the provider expects; the provider sees the source variable's value under this name.",
      "Prerequisite: Use Pulumi v3.220.0 or later for this resource option.",
      "Prerequisite: Define the custom environment variables in the environment where Pulumi runs.",
      "Prerequisite: Set the option on explicitly configured provider resources; it does not apply to ordinary resources or components.",
      "The option applies to provider resources and remaps environment variable names passed to provider processes.",
      "Mappings are stored in `__internal` state; values are not stored anywhere."
    ]
  },
  "why_it_matters": "Configure two instances of the same provider with different environment variable values in one environment.",
  "before": "The release note says users previously had to put the differing values in provider configuration; this option lets them use separate environment variables instead.",
  "sources": [
    "https://github.com/pulumi/pulumi/releases/tag/v3.220.0",
    "https://github.com/pulumi/pulumi/pull/21572",
    "https://www.pulumi.com/docs/iac/concepts/resources/options/envvarmappings/"
  ],
  "rank": 0.95031,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-20261016",
    "verdict_id": "wave1b-20261016:wave1b-20261016-6ee551c307ee758d-3:gate",
    "evidence_hash": "cafc2aea80ddc85c0a892e5ca96605130289e34f5e8676a7bf753bbee693c657"
  },
  "review": {
    "draft_hash": "7132b0847693d0d71abeb6be4e9b4683ceed6be8d527131b585f76dbc11a948f",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-20261016:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.69 (>= 0.6 needed)."
  }
}
