https://pulumi.com logo
#general
Title
# general
w

worried-flower-67569

03/06/2020, 10:11 PM
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

faint-table-42725

03/06/2020, 10:22 PM
If you don’t change the order, does a
pulumi up
work without asking to replace?
w

worried-flower-67569

03/06/2020, 10:23 PM
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

faint-table-42725

03/06/2020, 10:26 PM
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

worried-flower-67569

03/06/2020, 10:33 PM
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!