Commit Graph

4 Commits

Author SHA1 Message Date
Fraser Waters a66a7f50eb Make GetMapping contextful
Now that we've removed the build link to terraform-bridge we can fix
this TODO. Pass a `context.Context` to `GetMapping` because it's
normally an async method.

This will require a small fix up in terraform-bridge when it updates to
this version of pulumi/pkg.
2023-06-05 21:34:08 +01:00
Fraser Waters 61219fe775 Add debug logs to Mapping calls
Makes it easier to trace conversion mappings via debug logs.
2023-06-05 10:05:16 +01:00
Fraser Waters 8446f2208c Allow mapping requests to install plugins
Enabling fix for https://github.com/pulumi/pulumi-terraform-bridge/issues/1130

This adds two new bits of logic to the plugin mapper.

Firstly when getting a mapping request for a given package X, as well as
searching to see if we have an X plugin already installed to call it's
`GetMapping` method first, we now also try to install X if we don't
already have it. The install failing is not considered an error, we'll
just try the other plugins to see if they map and then possibly return
empty (as before).

Secondly the converter can pass a hint to what the pulumi plugin for the
ecosystem plugin is. If no hint is given we assume the pulumi plugin
name is the same as the ecosystem name. But this can be used for example
in the terraform converter to tell the engine that for example the
terraform provider "azurerm" is called "azure" in pulumi.

The hint is just a hint, if the name doesn't match all the other plugins
will be searched as before.
2023-05-29 14:53:04 +01:00
Fraser Waters 02489dbbb7 Add mapping service to converter 2023-03-24 17:09:17 +00:00