diff --git a/tf/oci_common_private_network/default_route_table.tf b/tf/oci_common_private_network/default_route_table.tf index 4dcef31a..fb35d2fe 100644 --- a/tf/oci_common_private_network/default_route_table.tf +++ b/tf/oci_common_private_network/default_route_table.tf @@ -1,13 +1,19 @@ resource "oci_core_default_route_table" "this" { - manage_default_resource_id = oci_core_vcn.this.default_route_table_id + manage_default_resource_id = local.vcn.default_route_table_id display_name = oci_core_vcn.this.display_name route_rules { - network_entity_id = oci_core_internet_gateway.this.id + network_entity_id = local.igw.id - description = "Default route" + description = "Internet v4" destination = "0.0.0.0/0" } + route_rules { + network_entity_id = local.igw.id + + description = "Internet v6" + destination = "::/0" + } } \ No newline at end of file diff --git a/tf/oci_common_private_network/internet_gateway.tf b/tf/oci_common_private_network/internet_gateway.tf new file mode 100644 index 00000000..a7886498 --- /dev/null +++ b/tf/oci_common_private_network/internet_gateway.tf @@ -0,0 +1,13 @@ +resource "oci_core_internet_gateway" "this" { + display_name = "internet" + compartment_id = var.tenancy_ocid + vcn_id = local.vcn.id +} + +locals { + igw = oci_core_internet_gateway.this +} + +output "internet_gateway_id" { + value = local.igw.id +} \ No newline at end of file