Skip to content

Commit

Permalink
v2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcGueury committed Mar 16, 2024
1 parent 457a784 commit 6836e9a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions option/terraform/network.j2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -253,18 +253,38 @@ resource "oci_core_route_table" "starter_route_private" {
}

{%- else %}

# NAT Gateway
resource "oci_core_nat_gateway" "starter_nat_gateway" {
compartment_id = local.lz_network_cmp_ocid
vcn_id = oci_core_vcn.starter_vcn.id
display_name = "${var.prefix}-nat-gateway"
freeform_tags = local.freeform_tags
}

# Service Gateway
resource "oci_core_service_gateway" "starter_service_gateway" {
compartment_id = local.lz_network_cmp_ocid
services {
service_id = data.oci_core_services.all_services.services[0]["id"]
}
vcn_id = oci_core_vcn.starter_vcn.id

display_name = "${var.prefix}-service-gateway"
freeform_tags = local.freeform_tags
}

# Route Private Subnet
resource "oci_core_route_table" "starter_route_private" {
compartment_id = local.lz_network_cmp_ocid
vcn_id = oci_core_vcn.starter_vcn.id
display_name = "${var.prefix}-route-private"

route_rules {
destination = data.oci_core_services.all_services.services[0]["cidr_block"]
destination_type = "SERVICE_CIDR_BLOCK"
network_entity_id = oci_core_service_gateway.starter_service_gateway.id
}
route_rules {
destination = "0.0.0.0/0"
destination_type = "CIDR_BLOCK"
Expand Down

0 comments on commit 6836e9a

Please sign in to comment.