https://pulumi.com logo
a

alert-restaurant-79151

05/20/2020, 8:19 AM
Hi, I'd like to use this terraform provider[0] with pulumi, how do I go about that? [0] https://github.com/andrewchambers/terraform-provider-nix
f

future-barista-68134

05/20/2020, 12:45 PM
Here’s the repo that documents the current process: https://github.com/pulumi/pulumi-tf-provider-boilerplate/
a

alert-restaurant-79151

05/20/2020, 12:49 PM
I get
scripts/get-py-version.go:7:2: cannot find module providing package <http://github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil|github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil>: working directory is not part of a module
as part of the output when I run it following the instructions.
Copy code
kalium@nix> make prepare NAME=terraform-provider-nix REPOSITORY=<http://github.com/andrewchambers/terraform-provider-nix|github.com/andrewchambers/terraform-provider-nix>
scripts/get-py-version.go:7:2: cannot find module providing package <http://github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil|github.com/pulumi/pulumi/sdk/v2/go/common/util/buildutil>: working directory is not part of a module
mv "provider/cmd/pulumi-tfgen-x""yz" provider/cmd/pulumi-tfgen-terraform-provider-nix
mv "provider/cmd/pulumi-resource-x""yz" provider/cmd/pulumi-resource-terraform-provider-nix
if [[ "Linux" != "Darwin" ]]; then \
	sed -i 's,<http://github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g|github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g>' provider/go.mod; \
	find ./ ! -path './.git/*' -type f -exec sed -i 's/[x]yz/terraform-provider-nix/g' {} \; &> /dev/null; \
fi
# In MacOS the -i parameter needs an empty string to execute in place.
if [[ "Linux" == "Darwin" ]]; then \
	sed -i '' 's,<http://github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g|github.com/pulumi/pulumi-xyz,github.com/andrewchambers/terraform-provider-nix,g>' provider/go.mod; \
	find ./ ! -path './.git/*' -type f -exec sed -i '' 's/[x]yz/terraform-provider-nix/g' {} \; &> /dev/null; \
fi
full command + output ^
@future-barista-68134
f

future-barista-68134

05/20/2020, 1:00 PM
I’m not very familiar with how this is supposed to work 🙂 @broad-dog-22463 might be able to help here.
b

broad-dog-22463

05/20/2020, 1:02 PM
Hi @alert-restaurant-79151 can you tell me if that command has changed to set the new name? (i.e. has the sed command completed at all)
a

alert-restaurant-79151

05/20/2020, 1:05 PM
Think so, the sed command was printed though.
running it with the code commented out does not seem to make any difference in the resulting file tree. it seems to just do checks and not effect anything if they pass.
Want me to open an issue on this on GH?
As I cannot fix this, I've opened an issue: https://github.com/pulumi/pulumi-tf-provider-boilerplate/issues/31
b

broad-dog-22463

05/20/2020, 1:57 PM
thanks
we can investigate
b

billowy-army-68599

05/20/2020, 3:18 PM
@alert-restaurant-79151 i replied to that issue, are you using
go 1.14
?
a

alert-restaurant-79151

05/20/2020, 3:39 PM
@billowy-army-68599 go1.14.1
b

billowy-army-68599

05/20/2020, 3:46 PM
our
get-py-version
script requires
go1.13.x
at the moment, you can patch the Makefile by changing the
PYPI_VERSION
like so
Copy code
PYPI_VERSION    := $(shell (cd scripts && ./get-py-version))
a

alert-restaurant-79151

05/20/2020, 3:49 PM
Okay sure.
That fixed it, thanks.