{"id":4633,"date":"2025-09-20T10:40:23","date_gmt":"2025-09-20T10:40:23","guid":{"rendered":"https:\/\/geekmungus.co.uk\/?p=4633"},"modified":"2025-09-20T10:40:23","modified_gmt":"2025-09-20T10:40:23","slug":"removing-aws-route-table-routes","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=4633","title":{"rendered":"Removing AWS Route Table Routes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Here&#8217;s a little oddity with AWS Route Tables within Terraform, if you want to remove all of the routes in a route table, you can&#8217;t just delete or comment them out, otherwise it treats them as if nothing has changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See the below example, you comment\/remove the routes, then in its place add a blank set.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>resource \"aws_route_table\" \"inside2_rt\" {\n  provider = aws.hub\n  vpc_id   = aws_vpc.security_vpc.id\n\n  # route {\n  #   cidr_block = \"10.0.0.0\/8\"\n  #   gateway_id = aws_ec2_transit_gateway.TGW.id\n  # }\n\n  # route {\n  #   cidr_block = \"172.16.0.0\/12\"\n  #   gateway_id = aws_ec2_transit_gateway.TGW.id\n  # }\n\n  # route {\n  #   cidr_block = \"192.168.0.0\/16\"\n  #   gateway_id = aws_ec2_transit_gateway.TGW.id\n  # }\n\n  # To Remove the routes, uncomment this; and comment out the routes!\n  # route = &#91;]\n\n  tags = {\n    Name = \"inside2_rt\"\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a little oddity with AWS Route Tables within Terraform, if you want to remove all of the routes in a route table, you can&#8217;t just delete or comment them out, otherwise it treats them as if nothing has changed. See the below example, you comment\/remove the routes, then in its place add a blank &#8230; <a title=\"Removing AWS Route Table Routes\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=4633\" aria-label=\"Read more about Removing AWS Route Table Routes\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":4373,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,45],"tags":[],"class_list":["post-4633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aws","category-terraform"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4633"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4633\/revisions"}],"predecessor-version":[{"id":4634,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/4633\/revisions\/4634"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/media\/4373"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}