Skip to content

changed the absolute count number "4" to the length of env_name variable #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v012
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "aws_instance" "babak" {
ami = var.ami_id
instance_type = var.instance_type
key_name = var.key_name
count = 4
count = length(var.env_name)
tags = {
Name = "babak-${var.env_name[count.index]}"
Created_By = local.created_by
Expand Down Expand Up @@ -49,4 +49,4 @@ resource "aws_instance" "babak" {
# Name = "babak2"
# }

# }
# }