This message was deleted.
s
This message was deleted.
s
Yes.
w
This is a very specific ask but do we have an example of importing GitHub resources? Not sure what an example command would be.
s
one way to do it is through the CLI: https://www.pulumi.com/registry/packages/github/api-docs/repository/ if the repos are very similar to each other, you can import one using the CLI (it generates the code for you too) and then write a bit more code to import all the other repos through Pulumi Opts in a `Array.map/for-loop`: https://www.pulumi.com/docs/intro/concepts/resources/options/import/#import Though with the Opts you can only import if the code you write matches the state in the cloud
w
Ah I just saw the docs:
Copy code
pulumi import github:index/repository:Repository terraform terraform
My bad! What does index and terraform terraform refer to?
s
oof that example is not great haha. index should just stay index. the first
terraform
in that example is the name of the repo and the second
terraform
is the name of the Pulumi Resource you want to import it as. In general these are probably fine to be the same, but sometimes you might want them to not match
w
Ah gotcha, yeah the repo name to import and the last argument would be same in my case.
I could do a script to iterate github repos and then run the import command for each. Powershell or C#. Nice and easy.
s
yeah that's an option too!
w
ok gotcha. Another question, not related. I have some stacks made like dev, tst, prd, for some projects, and others are under my org, so gurdips1/dev, gurdips1/tst, etc. Can I move stacks to the org model?
s
I am unfortunately not familiar with the cloud features, so you'll have to post that as a question separate from this thread so someone else can answer!
w
np!