What specific syntax must be used in order for the Terraform aws_route_table
data source below to successfully return the route table that is NOT designated the main route table in the VPC?
data "aws_route_table" "rt" {
vpc_id = var.vpcId
filter {
name = "association.main"
values = [false]
}
}
There is only one non-main route table in the VPC. Therefore, filtering for main=false
should identify it if the filter syntax is correct.
The error currently produced by the above code is:
Error: Your query returned no results. Please change your search criteria and try again