pulumi / pulumi-terraform-provider

Use any Terraform provider with Pulumi
Apache License 2.0
6 stars 0 forks source link

Importing a resource tries to validate the provider against nonexistant upstream repository #43

Open MatteoJoliveau opened 1 day ago

MatteoJoliveau commented 1 day ago

What happened?

I generated a provider for terraform-provider-routeros:

pulumi package add terraform-provider terraform-routeros/routeros

I can successfully use the provider and run pulumi preview --diff. I now want to import existing resources into the state, so I started by running:

pulumi import routeros:index/interfaceVlan:InterfaceVlan <name omitted> <vlan tag omitted>

Pulumi fails while trying to validate the provider against its upstream repository, which of course doesn't exist:

(newline inserted by me for cleaner preview)

 error:
- preview failed
- failed to validate provider config
- could not find latest version for provider routeros
- 404 HTTP error fetching plugin from https://api.github.com/repos/pulumi/pulumi-routeros/releases/latest. If this is a private GitHub repository, try providing a token via the GITHUB_TOKEN environment variable. See: https://github.com/settings/tokens

Example

Output of pulumi about

I'm using the pulumi-bin package from Nix.

CLI          
Version      3.138.0
Go Version   go1.23.2
Go Compiler  gc

Plugins
KIND      NAME                VERSION
language  nodejs              unknown
resource  scaleway            1.20.0
resource  terraform-provider  0.3.1

Host     
OS       ubuntu
Version  22.04
Arch     x86_64

Additional context

No response

Contributing

No response

MatteoJoliveau commented 1 day ago

The generated SDK has some bugs (nothing major, a couple of fields whose name begins with a number that needs to be quoted in TypeScript), I created a reproduction repository that has the necessary fixes applied: https://github.com/MatteoJoliveau/pulumi-repro

The config secret is test

VenelinMartinov commented 14 hours ago

Hey @MatteoJoliveau, thanks for reporting the issue and sorry you've hit this. Unfortunately, importing with dynamically bridged providers doesn't work yet. The team is actively working on it though and we expect to have this working very soon.

You can follow the progress here: https://github.com/pulumi/pulumi/issues/17507 and https://github.com/pulumi/pulumi/issues/17289