Closed eperdeme closed 6 years ago
Yes, unfortunately, it's a limitation in Terraform :(
See https://github.com/hashicorp/terraform/issues/14275 and https://github.com/hashicorp/terraform/issues/17179 for details.
This is a real shame, it literally makes the tool unusable to manage large numbers of items such as subnets or firewall chains.
I guess this is why even the UK Gov terraform code just looks so copy and paste. https://github.com/alphagov/govuk-terraform-provisioning/blob/master/projects/user_management/resources/integration/users.tf
Maybe I'l have to see about some sort of template to generate the TF files, but this means more wrappers :(
Agreed, it's quite a painful limitation. Hopefully, there will be a solution in the next version of Terraform.
You can manage existing users using the import command now:
terraform import aws_iam_user.trinity trinity
Hello,
I was reading the book and doing this example, but if you modify the list in anyway except append it breaks badly and tries to rename existing users. Is there a fix for this?
https://github.com/brikis98/terraform-up-and-running-code/blob/2b64b2e1cd7a3405af97642bcd7a83f4267d881c/code/terraform/05-tips-and-tricks/loops-and-if-statements/live/global/three-iam-users-unique-names/vars.tf#L4