Вот код всё банал'но и просто должно быть
provider "aws" {
region = "eu-west-1"
}
resource "aws_instance" "куку" {
ami = "ami-0b83c732bd2bf405f"
instance_type = "t2.small"
subnet_id = "subnet-088d08df01b9ac3e2"
security_groups = ["***********"]
iam_instance_profile = "${aws_iam_instance_profile.ec2_access_profile.name}"
key_name = "************"
count = 4
tags = {
Name = "ку"
Environment = "prod"
}
}
resource "aws_eip" "ку" {
instance = "${
aws_instance.куку.id "
vpc = true
}