provider "aws" {
region = "us-east-1"
access_key = "AKQ"
secret_key = "KfdfVkt1aurid"
}
variable "instancetags" {
type = list
default = ["root", "user1", "user2"]
}
variable "instancetype" {
type = list
default = ["t2.nano", "t2.micro", "t2.medium"]
}
resource "aws_instance" "cloud-instan" {
ami = "ami-02e136e904f3da870"
instance_type = var.instancetype[count.index]
count = 3
tags = {
Name = var.instancetags[count.index]
No comments:
Post a Comment