Blessed Uyo
Blessed Uyo

Reputation: 1

How can I fix the error with my terraform code?

on main.tf line 30, in resource "aws_route_table" "you-route":
route = [
{
cidr_block                         = ["0.0.0.0/0"]
gateway_id                        = aws_internet_gateway.you-gw.id
route                              = null
carrier_gateway_id                 = ""
destination_prefix_list_id         = ""
egress_only_gateway_id             = ""
instance_id                        = aws_instance.you-instance.id
ipv6_cidr_block                    = ""
local_gateway_id                   = ""
nat_gateway_id                     = ""
network_interface_id               = ""
transit_gateway_id                 = ""
vpc_endpoint_id                    = ""
vpc_peering_connection_id          = ""
},

{
ipv6_cidr_block                    = ["::/0"]
gateway_id                         = aws_internet_gateway.you-gw.id
route                              = null
carrier_gateway_id                 = ""
destination_prefix_list_id         = ""
egress_only_gateway_id             = ""
instance_id                        = aws_instance.you-instance.id
ipv6_cidr_block                    = ""
local_gateway_id                   = ""
nat_gateway_id                     = ""
network_interface_id               = ""
transit_gateway_id                 = ""
vpc_endpoint_id                    = ""
vpc_peering_connection_id          = ""
     }
]

aws_instance.you-instance.id will be known only after apply aws_internet_gateway.you-gw.id will be known only after apply

Inappropriate value for attribute "route": element 0: attribute "cidr_block": string required.

Upvotes: 0

Views: 302

Answers (1)

Tony Yip
Tony Yip

Reputation: 750

The cidr_block should be like this

cidr_block = "0.0.0.0/0"

Upvotes: 1

Related Questions