Hey all, I'm working with Pulumi for a while now, ...
# getting-started
b
Hey all, I'm working with Pulumi for a while now, but as I'm confronted with user documentation for an AWS setup I created I ran into an acutally pretty basic problem: What is the best way to make my setup available to a user? My first idea was to make the user clone my repo, then he/she could create a project based on my files and run it themself on their account. But there does not seem to be such an "import based on local project files" feature. I saw that
pulumi new
also works with any repo containing a template - that would solve the problem and make it even easier for the user. But I get
error: authentication required
trying to do so. But I can't find any hints how to authenticate using the command. Any suggestions?
w
I’m assuming your repo is a private repo, in which case you are hitting this issue: https://github.com/pulumi/pulumi/issues/5007 That issue includes a work around where you clone the repoand then pulumi new locally.
b
I've tried this approach already but it didn't work. Cloning the repo, going into it and performing
pulumi new .
gives me the error
no template
.
w
So, if I understand correctly you did: •
git clone <https://foo.git>
• cd foo # Assuming that’s the name of folder with the cloned repo •
pulumi new . --force
# I would expect that you would get a different error if you didn’t use --force
If so, are you sure the “foo” directory has a
Pulumi.yaml
file?
b
Not using
--force
gives me an error due to the directory not being empty. Using it there's an error trying to write a new
Pulumi.yaml
(because obviously the file already exists, its the template after all). I also tried using the
--dir
flag to separate template and project and create the project in a new, empty directory (which already seems bodged, as I would essentially just copy everything). But that just gives me
template 'foo' not found
. The
Pulumi.yaml
is definitely in the directory.
w
Weird. So, I did the following and it works: •
git clone xxxxx
# This brings down a project called test-project •
cd test-project
• # This test-project folder looks like this:
Copy code
-rw-r--r--  1 mitch  staff     32 Oct 28 08:41 Pulumi.dev.yaml
-rw-r--r--  1 mitch  staff     91 Oct 28 08:41 Pulumi.yaml
-rw-r--r--  1 mitch  staff     79 Oct 28 08:41 README.md
-rw-r--r--  1 mitch  staff    290 Oct 28 08:41 index.ts
-rw-r--r--  1 mitch  staff  96651 Oct 28 08:41 package-lock.json
-rw-r--r--  1 mitch  staff    227 Oct 28 08:41 package.json
-rw-r--r--  1 mitch  staff    438 Oct 28 08:41 tsconfig.json
• I can then do
pulumi new . --force
and things work as expected.
b
I finally found the problem! The Python cache and the virtual environment where part of the template, but they need to be set up when creating the project and thus gave an error - simple, actually. Thank you very much for your help! 🙂