Open Faarhad opened 1 year ago
Hi , we can create multiple resources using Meta-arguments . I wrote two of them below
variable "instance_names" { type = map(string) default = { "instance1" = "babak" "instance2" = "babak2" } }
resource "aws_instance" "aws_instances" { for_each = var.instance_names ami = var.ami_id instance_type = var.instance_type key_name = var.key_name
tags = { Name = each.value Created_By = "terraform" } }
Describe and write the question.
How to create multiple resources in scenario described in branch 007 (it was about creating resources using tfvars. I mean more than 1 insurance in tfvars Regards,
The logs if needed
No response