Skip to content
This repository was archived by the owner on Jul 11, 2023. It is now read-only.

Commit 159e6f5

Browse files
qrilkaketzacoatl
authored andcommitted
Fix iam-users output.
When a user gets deleted from user list Terraform will fail creating a plan complaining that number of keys doesn't match number of values. Th solution is taken from https://github.com/terraform-google-modules/terraform-google-cloud-storage/pull/23/files
1 parent 1d4949b commit 159e6f5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
### Modules
77

8+
* `iam-users`: fixed error from zipmap in outputs when a user gets deleted
9+
from user list
810

911
### Examples
1012

modules/iam-users/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ resource "aws_iam_user" "u" {
1616

1717
output "users" {
1818
description = "The list of IAM user objects that exist"
19-
value = zipmap(var.user_list, aws_iam_user.u.*)
19+
value = zipmap(var.user_list, slice(aws_iam_user.u.*, 0, length(var.user_list)))
2020
}

0 commit comments

Comments
 (0)