30 lines
464 B
HCL
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
|
|
}
|