How to avoid terraform previous ec2 to be destroy while creating new one using script.For example i created one instance by using count=1 if I put count=2 it will only one instance can you please help me with this.I need to created number of count resources without destroy or depend on previous instance
provider “aws”{
profile = “default”
region = var.region
}
resource “aws_instance” “hello” {
count=2
ami = var.ami
instance_type = “t2.micro”
tags={
Name = “hello ${count.index}”
}
}