Hello! New pulumi user here considering to move ov...
# general
w
Hello! New pulumi user here considering to move over from terraform. I'm trying to set up a very trivial configuration and I'm already stuck. Consider the following tenliner: https://gist.github.com/farcaller/deadd9cb5375549037d1de0f5479a623. I have a list of repositories to manage. Pulumi works perfectly and imports both. Now, if I change the order of items in the
repos
pulumi suggests it needs to re-create both repos because their order changed. Clearly, my repos aren't keyed by index but by their names. In terraform I'd use
for_each
over a set. How do I achieve the same in pulumi?
f
If you don’t change the order, does a
pulumi up
work without asking to replace?
w
ha, that's what I realized just now. it doesn't 🙂
thanks. now I need to decipher what the pending changes are. in tf I only have a single property being the name
aha. it all works as expected. I had to remove the
import:
statements so not to trigger re-import
f
yeah, so i think you’re likely running into https://github.com/pulumi/pulumi/issues/3657
in principle, you should be able to keep the
import
there
but per the issue:
The resources that trigger this are ones that use a different format of identifier for the 
import
 input than they do for the 
id
 property. The vast majority of resources allow passing in the identifier used in the 
id
 property as the input to an 
import
 - but there are a few that do not.
which i think is the case for the resource you’re importing
w
yep. thanks. I can add the
id
next to the import and it becomes a noop, but then I suppose I can't create the resources in the same code block so I'll still have to manage several for the migration
either way, I have a way to proceed. thanks!