Closed kral2 closed 6 years ago
You need to specify a destination_type in your route_rules to use the service gateway
destination_type defaults to CIDR_BLOCK which is incorrect for service gateway route rules
you want the SERVICE_CIDR_BLOCK destination_type
https://www.terraform.io/docs/providers/oci/r/core_route_table.html#destination_type
{
// Default route to NATGW
destination = "${var.network_cidr["default-route"]}"
network_entity_id = "${oci_core_nat_gateway.ngw_R1VCN1.id}"
},
{
// Default route to SGW <---- this is the added section for Service Gateway usage
destination = "${lookup(data.oci_core_services.R1OCI_services.services[0],"cidr_block")}"
destination_type = "SERVICE_CIDR_BLOCK"
network_entity_id = "${oci_core_service_gateway.sgw_R1VCN1.id}"
},
Terraform and OCI Provider Version
Description
Hi,
I am trying to deploy a Service Gateway and then update a route table accordingly to use it, but get an "invalid CIDR" return (http status code: 400).
The "special" oci-/region/-objectstorage CIDR used for Service Gateway when targeting object storage seems to be wrongly evaluated by the terraform provider.
Terraform file and plan/apply outputs
Here is my example code :
This part is working as intended : service gateway is created targeting the right service. Now I try to update a route table to actually use the Service Gateway for object storage traffic :
variable evaluation seems OK as shown by the
terraform plan
output :But
terraform apply
command fail complaining about the CIDR beeing invalid (unable to parse).