Error Error creating route InvalidParameterValue Route target is not supported This route only supports interface and instance targets

0 votes

Hi Guys,

I am trying to create one route in my routing table to connect with an internet gateway. But it is showing me the below error.

resource "aws_route_table" "table" {
  vpc_id = "${aws_vpc.main.id}"
route {
    cidr_block = "10.0.1.0/0"
    gateway_id = "${aws_internet_gateway.gw.id}"
  }
  tags = {
    Name = "MyRoute"
  }
}
Error: Error creating route: InvalidParameterValue: Route target is not supported. This route only supports interface and instance targets.

How can I solve this error?

Jul 21, 2020 in Terraform by akhtar
• 38,170 points
918 views

1 answer to this question.

0 votes

Hi@akhtar,

In the route you use internet gateway gateway_id = aws_internet_gateway.gw.id, for such route cidr_block must be 0.0.0.0/0 but not aws_subnet.main.cidr_block. So change your cidr_block to 0..0.0.0/0.

answered Jul 21, 2020 by MD
• 95,040 points

Related Questions In Terraform

0 votes
1 answer
+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer