Warning: Argument is deprecated; use domain attribute instead

while creating elastic ip with terraform an error may come. suppose you have the below terraform snippet of code and you run terraform apply.

# elastic ip
resource "aws_eip" "main" {
vpc = true
}

…. and the error that will come is shown below

│ Warning: Argument is deprecated

│ with aws_eip.main,
│ on main.tf line 65, in resource "aws_eip" "main":
│ 65: vpc = true

│ use domain attribute instead

│ (and one more similar warning elsewhere)

To get rid of the error change the terraform script to as shown below

# elastic ip
resource "aws_eip" "main" {
domain = "vpc"
}

--

--