-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement: count to for_each #1309
improvement: count to for_each #1309
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a great first step to getting #858 integrated.
The one thing I'll comment on is: as the for_each
key is not customizable, we still have the issues with re-ordering as worker groups are added/removed, which will require another state migration to fix.
Look like this needs rebasing now |
@barryib Would you like to add your review? |
Ive played with the idea of adding a dedicated identifier that would be used as an index for maps, but the name is still used in So at this point I don't see an advantage to adding an additional parameter. This set of changes can be merged as is and clients will have to replace their ASG by changing their names if they want to profit from the order preservation feature offered by for_each. Tell me what you think :) |
👋 were are we at regarding this feature? Its required to enable us to have unique keys on autoscaling groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; would love to see this merged now.
Only comment I'll add is that the commits are a bit of a mess; I'm not sure if this repository does squash merging or what the story is.
… and merged default values
1bafbdb
to
77d9c69
Compare
Hello @sbeginCoveo Thank you for your work. We do plan to move from count to for_each. But to that, we planned to move code into sub-module and for_each. I can't merge this because it doesn't go into that direction. I'll keep this PR open for now, your work idea of merging locals is great and will contact you soon to add this in a |
What do you mean by that?
Isn't this already an improvement? could the move to a submodule happen as a second step? @sbeginCoveo seems the PR needs rebasing after another recent merge |
I mean that we will move code into submodules and use for_each to loop over them. Please see See also #1132 (comment) |
I'm glad we finally decide on an outcome. While I really like the direction you are suggesting with the submodules splits, it most probably won't make it soon in a release, and many of us are waiting on for_each to move some ASGs around. |
well, I probably won't be maintaining this branch since we don't intend to merge it. Thank you @james-callahan for your continued assistance |
@barryib When is this going to happen? What's the workaround - I currently have a huge mess when I need to remove and asg from the list. I thought about decoupling this into a module like you said, but if you have any updates or pointers please let me know |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
PR o'clock
Description
Closes #1105
Partially addresses #635
There are two themes to this PR.
count
tofor_each
, so that we can use relevant key names for identificationState migration process
There are no breaking changes in the interface (variables, outputs), But we have a tfstate migration required to move to the for_each index pattern.
The four main resources to migrate are:
aws_autoscaling_group.workers
aws_iam_instance_profile.workers
aws_launch_configuration.workers
random_pet.workers
Example migration
Checklist