https://pulumi.com logo
#getting-started
Title
# getting-started
b

bumpy-apartment-942

08/31/2023, 6:10 PM
Looking to find out how to install the terraform converter plugin. As the query suggests looking to convert terraform code over using pulumi. Always getting this error. Any suggestions on how to install the plugin would be greatly appreciated.
Copy code
$ pulumi convert --from terraform --language python --out pulumi -v=9 2>&1 > out.txt
Converting from terraform...
error: install plugin source "terraform": could not find latest version for provider terraform: 401 HTTP error fetching plugin from <https://api.github.com/repos/pulumi/pulumi-converter-terraform/releases/latest>
l

limited-rainbow-51650

09/01/2023, 6:29 AM
@bumpy-apartment-942 which version of the Pulumi CLI are you running? You need at least v3.71.0.
Can you also check manually if you can reach that network location?
Copy code
curl -o releases.json <https://api.github.com/repos/pulumi/pulumi-converter-terraform/releases/latest>
If a
releases.json
file is correctly written, we can exclude any network hiccups.
b

bumpy-apartment-942

09/01/2023, 12:41 PM
Hi @limited-rainbow-51650 running 3.79.0 and the curl command does work.
The URL you provided is where I started ;)
l

limited-rainbow-51650

09/01/2023, 12:55 PM
@bumpy-apartment-942 let's debug a bit more: what is the output of
pulumi plugin ls
?
b

bumpy-apartment-942

09/01/2023, 12:57 PM
pulumi plugin ls NAME KIND VERSION SIZE INSTALLED LAST USED terraform resource 5.13.4 89 MB 21 hours ago 21 hours ago TOTAL plugin cache size: 89 MB
I can see I have the terraform resource as listed in the KIND field but cannot find the terraform converter or install it
l

limited-rainbow-51650

09/01/2023, 1:00 PM
That is not the right kind. Can you run
pulumi plugin rm resource terraform
and then run your
pulumi convert
command again?
b

bumpy-apartment-942

09/01/2023, 1:07 PM
Removed the plugin and then re-ran the following:
Copy code
pulumi convert --from terraform --language python --out pulumi
Converting from terraform...
error: install plugin source "terraform": could not find latest version for provider terraform: 401 HTTP error fetching plugin from <https://api.github.com/repos/pulumi/pulumi-converter-terraform/releases/latest>
l

limited-rainbow-51650

09/01/2023, 1:09 PM
Let's test if we can install the right kind of plugin manually:
pulumi plugin install converter terraform
b

bumpy-apartment-942

09/01/2023, 1:10 PM
Same error:
Copy code
pulumi plugin install converter terraform
error: 401 HTTP error fetching plugin from <https://api.github.com/repos/pulumi/pulumi-converter-terraform/releases/latest>
l

limited-rainbow-51650

09/01/2023, 1:10 PM
What is the output of
pulumi about
?
b

bumpy-apartment-942

09/01/2023, 1:11 PM
Copy code
$ pulumi about
CLI
Version      3.79.0
Go Version   go1.21.0
Go Compiler  gc

Host
OS       darwin
Version  13.5.1
Arch     x86_64

Backend
Name           <http://pulumi.com|pulumi.com>
URL            <https://app.pulumi.com/thpang>
User           thpang
Organizations  thpang

Pulumi locates its logs in /var/folders/03/t8b5lp5s7b37py0wwtyvckym0000gn/T/ by default
warning: Failed to read project: no Pulumi.yaml project file found (searching upwards from /Users/thpang/work/sandbox/pulumi/viya4-iac-k8s). If you have not created a project yet, use `pulumi new` to do so: no project file found
warning: Failed to get information about the current stack: no Pulumi.yaml project file found (searching upwards from /Users/thpang/work/sandbox/pulumi/viya4-iac-k8s). If you have not created a project yet, use `pulumi new` to do so: no project file found
e

echoing-dinner-19531

09/01/2023, 1:16 PM
Do you have an old token set in the GITHUB_TOKEN env var?
b

bumpy-apartment-942

09/01/2023, 1:17 PM
I have a GITHUB_TOKEN yes. For other work
e

echoing-dinner-19531

09/01/2023, 1:17 PM
Try
GITHUB_TOKEN="" pulumi plugin install converter terraform
b

bumpy-apartment-942

09/01/2023, 1:18 PM
that seems to be working
e

echoing-dinner-19531

09/01/2023, 1:19 PM
Something off about that token then 😕
b

bumpy-apartment-942

09/01/2023, 1:19 PM
Lots of warnings around templatefile and this error:
Copy code
Downloading pulumi-3.80.0-py3-none-any.whl.metadata (11 kB)
ERROR: Could not find a version that satisfies the requirement pulumi-local==0.0.1 (from versions: 0.1, 0.2.0, 0.3, 0.4, 0.5, 0.6, 1.0, 1.1)
ERROR: No matching distribution found for pulumi-local==0.0.1
error: installing dependencies failed; rerun manually to try again, then run `pulumi up` to perform an initial deployment: installing dependencies via '/Users/thpang/work/sandbox/pulumi/viya4-iac-k8s/pulumi/bin/python -m pip install -r requirements.txt': exit status 1
e

echoing-dinner-19531

09/01/2023, 1:21 PM
hmm that's https://github.com/pulumi/pulumi-local looks like it never published correctly
b

bumpy-apartment-942

09/01/2023, 1:22 PM
The repo I am trying to convert is a bit of a hybrid setup with terraform used for infra setup and Ansible used for app installation on the infra. Seems like its getting hung up on the ansible part
e

echoing-dinner-19531

09/01/2023, 1:22 PM
Ah local didn't publish to python because of a name conflict, https://github.com/pulumi/pulumi-local/issues/1 😞
l

limited-rainbow-51650

09/01/2023, 1:23 PM
Thanks @echoing-dinner-19531. Coming back to the
GITHUB_TOKEN
setting:
pulumi
CLI uses that token to make authenticated calls to Github to prevent bumping in API rate limits. Authenticated calls have much higher limits. But your github token needs to be (re)configured to allow access to public repositories.
b

bumpy-apartment-942

09/01/2023, 1:24 PM
Thanks again for the help everyone. I have a few other repos that are all terraform so I’ll try my luck there and let you know.
Switched to go and have other errors on the same repo. Seems pulumi has issues installing items on ones machine:
Copy code
go: viya4-iac-k8s imports
	<http://github.com/pulumi/pulumi-std/sdk/v1/go/std|github.com/pulumi/pulumi-std/sdk/v1/go/std>: module <http://github.com/pulumi/pulumi-std/sdk@latest|github.com/pulumi/pulumi-std/sdk@latest> found (v0.0.0-20230607001730-519a13f355b7), but does not contain package <http://github.com/pulumi/pulumi-std/sdk/v1/go/std|github.com/pulumi/pulumi-std/sdk/v1/go/std>
error: installing dependencies failed; rerun manually to try again, then run `pulumi up` to perform an initial deployment: `go mod tidy` failed to install dependencies: exit status 1
e

echoing-dinner-19531

09/06/2023, 4:36 PM
Copy code
<http://github.com/pulumi/pulumi-std/sdk/v1/go/std|github.com/pulumi/pulumi-std/sdk/v1/go/std>
Ah that looks wrong, I think that's a codegen bug though. It should just be
<http://github.com/pulumi/pulumi-std/sdk/go/std|github.com/pulumi/pulumi-std/sdk/go/std>
I think. I'll see if we can get the Go codegen fixed to account for that.