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,260 points
2,852 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,460 points

Related Questions In Terraform

0 votes
1 answer
+2 votes
1 answer

Error: Error creating route: RouteAlreadyExists: The route identified by 0.0.0.0/0 already exists.

Hi@Lakshminarayanan, First thing I want to suggest you ...READ MORE

answered Aug 10, 2020 in Terraform by MD
• 95,460 points
5,759 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP