Visitar URL original
Add an ecosystem to converter mapping requests by i-am-tom · Pull Request #23804 · pulumi/pulumi · GitHub
Skip to content

Add an ecosystem to converter mapping requests - #23804

Merged
i-am-tom merged 3 commits into
masterfrom
tom/mapper-request-ecosystem
Jul 7, 2026
Merged

i-am-tom merged 3 commits into
masterfrom
tom/mapper-request-ecosystem

Conversation

@i-am-tom

@i-am-tom i-am-tom commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

We want import --from hcl to do state import without favouring static bridging. #23803 was the first attempt, but @Frassle suggested this: we allow providers to specify the ecosystem they care about. This means that hcl can say it cares about terraform, rather than us assuming it cares about hcl and finding no matches.

🤖 Generated with Claude Code

i-am-tom and others added 2 commits July 7, 2026 10:22
`import --from <converter>` and the engine's runtime mappers resolve
provider mappings under a conversion key that identifies the ecosystem
whose mappings are wanted. That key was fixed when the mapper was
constructed — `import` used the converter's own name — so a converter
whose name differs from the ecosystem it consumes could not get the
right mappings. The hcl converter executes Terraform programs, so it
needs "terraform" mappings, but was asking under key "hcl" and got none.

This adds an `ecosystem` field to `GetMappingRequest` and to the
`convert.Mapper.GetMapping` interface, so a caller specifies the
ecosystem per request. When set it takes precedence over the mapper's
configured conversion key; when empty the configured key is used, so
existing callers are unaffected. The caching mapper keys entries by
(ecosystem, provider).

Supersedes #23803, which special-cased `hcl` -> `terraform` in the
import command; per review the converter should declare the ecosystem it
consumes rather than core hardcoding a per-converter translation.

Follow-up (separate repos): terraform-bridge's mapper source must pass
`ecosystem: "terraform"` for `import --from hcl` to resolve mappings
end-to-end.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@i-am-tom
i-am-tom marked this pull request as ready for review July 7, 2026 08:39
@i-am-tom
i-am-tom requested a review from a team as a code owner July 7, 2026 08:39
// the caller consumes, which is not necessarily the caller's own name -- the hcl converter, for instance,
// executes Terraform programs and so requests "terraform" mappings. If left empty, the mapper falls back to
// the conversion key it was configured with.
string ecosystem = 4;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth documenting that the default for most instances of the mapper is "terraform". It's only with pulumi convert that it defaults to the converter plugin name. So this new property is really useful for plugin run and providers accessing mappers.

Per review: clarify that most mapper instances default the conversion
key to "terraform" (plugin run, providers, language runtimes), while
`pulumi convert` and `pulumi import` default it to the source
converter's plugin name.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@i-am-tom
i-am-tom enabled auto-merge July 7, 2026 12:56
@i-am-tom
i-am-tom added this pull request to the merge queue Jul 7, 2026
Merged via the queue into master with commit 93ab968 Jul 7, 2026
123 checks passed
@i-am-tom
i-am-tom deleted the tom/mapper-request-ecosystem branch July 7, 2026 14:05
@pulumi-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped in release v3.251.0.

pull Bot pushed a commit to makesoftwaresafe/pulumi that referenced this pull request Jul 8, 2026
## 3.251.0 (2026-07-08)

### Features

- [programgen/pcl] Invoke functions declared with multi-argument inputs
using positional arguments in PCL
[pulumi#23571](pulumi#23571)
- [sdkgen] Generate SDKs and programs for extension-parameterized
packages [pulumi#23579](pulumi#23579)
- [engine] Add `TargetSnippets` to deployment options to target snippets
by UUID.

### Bug Fixes

- [cli/display] Prevent plugin debug logs from appearing as raw JSON in
the CLI's output when logging with `--logtostderr`
[pulumi#23633](pulumi#23633)
- [cli] Show a `retain` marker for retain-on-delete resources in
`--diff` output
- [sdk/nodejs] Don't include the version in module paths when
serializing functions when using pnpm
- [cli] Don't miscopy out archives

### Improvements

- [cli/deployment] `pulumi deployment settings` no longer writes the
local `Pulumi.<stack>.deploy.yaml` file: the experimental `init`,
`pull`, `configure`, and `env` subcommands have been removed, and the
CLI no longer calls the deployment-settings encrypt endpoint.
`get`/`edit`/`destroy` continue to manage settings directly in Pulumi
Cloud [pulumi#23480](pulumi#23480)
- [cli/import] Support importing resources under parameterized providers
from a converter or import file
[pulumi#23763](pulumi#23763)
- [cli/import] Support importing resources under extension-parameterized
providers [pulumi#23779](pulumi#23779)
- [engine] Add OpenTelemetry spans to the StackReference read path so
performance traces can pinpoint slow snapshot fetches, deserialization,
or secret decryption
- [cli/deployment] The deployment settings file
(`Pulumi.<stack>.deploy.yaml`) has been removed entirely. The
experimental `pulumi deployment settings push` (`update`/`up`) command,
the `--config-file` flag, and the SDK helpers that read the file have
been removed. Manage deployment settings directly in Pulumi Cloud with
`pulumi deployment settings get`, `edit`, and `destroy`
[pulumi#23480](pulumi#23480)
- [cli/env] Report the new revision number when an environment
definition is updated (e.g. `pulumi env edit`, `pulumi env provider`,
`pulumi env version rollback`)
[pulumi#23799](pulumi#23799)
- [cli/convert] Add an `ecosystem` field to converter mapping requests
so a converter can request mappings for the ecosystem it consumes rather
than its own name [pulumi#23804](pulumi#23804)

### Miscellaneous

- [cli] Add `pulumi neo --debug-update` and `pulumi neo --debug-preview`
flags to investigate a failed update or preview, suggested in the
failure output [pulumi#23499](pulumi#23499)
- [cli/env] Fold the Pulumi ESC engine and CLI into the pulumi/pulumi
monorepo, removing the sdk↔esc Go module cycle. Internal refactor with
no user-facing behavior change; `pulumi env`/`pulumi esc` are
unaffected. [pulumi#23746](pulumi#23746)
i-am-tom added a commit to pulumi/pulumi-terraform-bridge that referenced this pull request Jul 8, 2026
…meter

pulumi/pulumi#23804 added an `ecosystem` argument to
`convert.Mapper.GetMapping`, identifying the source ecosystem whose
mappings the caller consumes. tf2pulumi converts Terraform programs, so
its provider-info source now requests "terraform" mappings explicitly;
the internal test-file mapper gains (and ignores) the new parameter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
i-am-tom added a commit to pulumi/pulumi-terraform-bridge that referenced this pull request Jul 8, 2026
…meter

pulumi/pulumi#23804 added an `ecosystem` argument to
`convert.Mapper.GetMapping`, identifying the source ecosystem whose
mappings the caller consumes. tf2pulumi converts Terraform programs, so
its provider-info source now requests "terraform" mappings explicitly;
the internal test-file mapper gains (and ignores) the new parameter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
i-am-tom added a commit to pulumi/pulumi-terraform-bridge that referenced this pull request Jul 8, 2026
pulumi/pulumi#23804 (released in v3.251.0) added an `ecosystem` argument
to `convert.Mapper.GetMapping`, identifying the source ecosystem whose
mappings the caller consumes. tf2pulumi converts Terraform programs, so
its provider-info source now requests "terraform" mappings explicitly;
the internal test-file mapper gains (and ignores) the new parameter.

Needed by pulumi/pulumi-hcl#321, which depends on a post-#23804
core and cannot compile `pkg/tf2pulumi/il` (nor anything importing it,
including `pkg/tfgen`) against current main. Verified locally: `go
vet`/`go build` clean across the root module (the only module affected —
no other `convert.Mapper` implementors or callers in the repo), and the
downstream pulumi-hcl test harness compiles against this branch.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants