oracle-terraform-modules/terraform-oci-vcn

add Local Peering Gateway support

kral2 opened this issue ยท 0 comments

kral2 commented

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

VCN module currently supports creating each available gateways, except for Local Peering Gateways (referred as LPG now on).

The proposition is to give the user an option to create one or many LPG within the same VCN block definition, with the following options:

Adding one or many LPG to a VCN should be kept optional.

These options will enable higher level constructs, like hub-and-spoke network topology. But it is important to keep VCN module agnostic to such specific configuration:

  • based on the arguments passed by the user to the VCN module, the resulting VCN should be able to act either as a HUB or a SPOKE,
  • when composing with many VCN modules, the user should be able to create a complete hub-and-spoke topology.

New or Affected Resource(s)

  • oci_core_vcn will need new Input Variables
  • new resource oci_core_local_peering_gateway, implemented with a for_each logic to handle many of them,
  • possibly new oci_route_table to handle HUB scenario (preferably via a sub-module for route tables)

Potential Terraform Configuration

Below a mock-up of how the user would declare new LPGs

module "vcn" {
  source = "../"

  # general oci parameters
  compartment_id = var.compartment_id
  label_prefix   = var.label_prefix
  tags           = var.tags

  # vcn parameters
  create_drg               = var.create_drg               # boolean: true or false
  internet_gateway_enabled = var.internet_gateway_enabled # boolean: true or false
  lockdown_default_seclist = var.lockdown_default_seclist # boolean: true or false
  nat_gateway_enabled      = var.nat_gateway_enabled      # boolean: true or false
  service_gateway_enabled  = var.service_gateway_enabled  # boolean: true or false
  vcn_cidr                 = var.vcn_cidr                 # VCN CIDR
  vcn_dns_label            = var.vcn_dns_label
  vcn_name                 = var.vcn_name

  # gateways parameters
  drg_display_name = var.drg_display_name

  local_peering_gateways = {
    to_spoke1 = {
      peer_id = <string>
      route_table_id = <string>
    },
    to_spoke2 = {
      peer_id = <string>
      route_table_id = <string>
    },
  }
}

References