Looking to find out how to install the terraform c...
# getting-started
b
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
@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
Hi @limited-rainbow-51650 running 3.79.0 and the curl command does work.
The URL you provided is where I started ;)
l
@bumpy-apartment-942 let's debug a bit more: what is the output of
pulumi plugin ls
?
b
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
That is not the right kind. Can you run
pulumi plugin rm resource terraform
and then run your
pulumi convert
command again?
b
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
Let's test if we can install the right kind of plugin manually:
pulumi plugin install converter terraform
b
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
What is the output of
pulumi about
?
b
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
Do you have an old token set in the GITHUB_TOKEN env var?
b
I have a GITHUB_TOKEN yes. For other work
e
Try
GITHUB_TOKEN="" pulumi plugin install converter terraform
b
that seems to be working
e
Something off about that token then 😕
b
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
hmm that's https://github.com/pulumi/pulumi-local looks like it never published correctly
b
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
Ah local didn't publish to python because of a name conflict, https://github.com/pulumi/pulumi-local/issues/1 😞
l
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
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
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.