Getting the following error
Error: Error associating EIP: MissingParameter: Either public IP or allocation id must be specified
status code: 400
Here is my configuration file:
provider “aws” {
region = “us-east-1”
access_key = “”
secret_key = “”
}
resource “aws_eip_association” “myeip” {
instance_id = “aws_instance.myweb.id”
}
resource “aws_instance” “myweb” {
ami = “ami-09d069a04349dc3cb”
instance_type = “t2.micro”
security_groups = ["${aws_security_group.mysg.name}"]
}
resource “aws_security_group” “mysg” {
name = “web-server-sg”
ingress {
from_port = 80
to_port = 80
protocol = “tcp”
cidr_blocks = [“0.0.0.0/0”]
}
ingress {
from_port = 443
to_port = 443
protocol = “tcp”
cidr_blocks = [“0.0.0.0/0”]
}
ingress {
from_port = 22
to_port = 22
protocol = “tcp”
cidr_blocks = [“116.75.30.5/32”]
}
ingress {
from_port = 21
to_port = 21
protocol = “tcp”
cidr_blocks = [“116.75.30.5/32”]
}
ingress {
from_port = 25
to_port = 25
protocol = “tcp”
cidr_blocks = [“116.75.30.5/32”]
}
}