1
0
Fork 0
terraform-training/project5/base.tf
2020-05-13 12:35:51 +02:00

30 lines
464 B
HCL

provider "aws" {
region = "eu-west-2"
}
variable "user_list" {
type = list
default = [
"cedric-user1",
"cedric-user2",
"cedric-user3"
]
}
variable "user_list2" {
type = list
default = [
"cedric-user4",
"cedric-user5"
]
}
resource "aws_iam_user" "user1" {
name = element(var.user_list,count.index)
count = length(var.user_list)
}
resource "aws_iam_user" "user2" {
for_each = toset(var.user_list2)
name = each.value
}