1 cat < variables.tf variable "user_names" { description = "Create IAM users with these names" type = list(string) default = ["gasida", "akbun", "fullmoon"] } EOT 2 count.index cat < iam.tf provider "aws" { region = "ap-northeast-2" } resource "aws_iam_user" "myiam" { count = length(var.user_names) name = var.user_names[count.index] } EOT 3 terraform init 4 terraform plan 5 cat < outputs.tf output "first_arn" { value = aws_iam_user.myiam[0].arn description = "The ARN for the first user" } output "all_arns" { value = aws_iam_user.myiam[*].arn description = "The ARNs for all users" } EOT 5 terraform apply -auto-approve terraform state list terraform output