1
0
Fork 0

iterating over a list

This commit is contained in:
Cedric Girard 2020-05-13 12:16:35 +02:00
parent f3b0d73d14
commit c53be9dae6
Signed by: X-dark
GPG Key ID: E7D0E125DB9519E4
1 changed files with 18 additions and 0 deletions

18
project5/base.tf Normal file
View File

@ -0,0 +1,18 @@
provider "aws" {
region = "eu-west-2"
}
variable "user_list" {
type = list
default = [
"cedric-user1",
"cedric-user2",
"cedric-user3"
]
}
resource "aws_iam_user" "user1" {
name = element(var.user_list,count.index)
count = length(var.user_list)
}