Skip to content

Commit

Permalink
feat: add ipv6 support for VCN (#65)
Browse files Browse the repository at this point in the history
fix #62
  • Loading branch information
kral2 authored Sep 8, 2021
1 parent 6eab09c commit dabecf2
Show file tree
Hide file tree
Showing 15 changed files with 86 additions and 40 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Given a version number MAJOR.MINOR.PATCH:
- MINOR version when adding functionality in a backwards compatible manner,
- PATCH version when making backwards compatible bug fixes.
== v3.1.0 (Unreleased)

=== New features
* Added add IPv6 support for VCN (fixes #62)

== v3.0.0 (September 03, 2021)

=== Breaking changes
Expand Down
5 changes: 5 additions & 0 deletions docs/terraformoptions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
|`string`
|"drg"

|`enable_ipv6`
|(Updatable) Whether IPv6 is enabled for the VCN. If enabled, Oracle will assign the VCN a IPv6 /56 CIDR block.
|`boolean`
|false

|`freeform_tags`
|simple key-value pairs to tag the resources created specified in the form of a map
|`map(any)`
Expand Down
5 changes: 3 additions & 2 deletions examples/custom_route_rules/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {

module "vcn" {
source = "oracle-terraform-modules/vcn/oci"
version = "3.0.0"
version = "3.1.0"

# general oci parameters
compartment_id = var.compartment_id
Expand All @@ -30,7 +30,8 @@ module "vcn" {
lockdown_default_seclist = var.lockdown_default_seclist # boolean: true or false
create_nat_gateway = var.create_nat_gateway # boolean: true or false
create_service_gateway = var.create_service_gateway # boolean: true or false
vcn_cidrs = var.vcn_cidrs # List of IPv4 CIDRs
enable_ipv6 = var.enable_ipv6
vcn_cidrs = var.vcn_cidrs # List of IPv4 CIDRs
vcn_dns_label = var.vcn_dns_label
vcn_name = var.vcn_name

Expand Down
2 changes: 2 additions & 0 deletions examples/custom_route_rules/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ create_nat_gateway = false

create_service_gateway = false

enable_ipv6 = false

vcn_cidrs = ["10.0.0.0/16"]

vcn_dns_label = "vcn"
Expand Down
18 changes: 12 additions & 6 deletions examples/custom_route_rules/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ variable "create_internet_gateway" {
default = true
}

variable "lockdown_default_seclist" {
description = "whether to remove all default security rules from the VCN Default Security List"
type = bool
default = true
}

variable "create_nat_gateway" {
description = "whether to create a nat gateway in the vcn"
type = bool
Expand All @@ -79,6 +73,12 @@ variable "create_service_gateway" {
default = true
}

variable "enable_ipv6" {
description = "Whether IPv6 is enabled for the VCN. If enabled, Oracle will assign the VCN a IPv6 /56 CIDR block."
type = bool
default = false
}

variable "freeform_tags" {
description = "simple key-value pairs to tag the resources created"
type = map(any)
Expand All @@ -88,6 +88,12 @@ variable "freeform_tags" {
}
}

variable "lockdown_default_seclist" {
description = "whether to remove all default security rules from the VCN Default Security List"
type = bool
default = true
}

variable "vcn_cidrs" {
description = "The list of IPv4 CIDR blocks the VCN will use."
type = list(string)
Expand Down
2 changes: 1 addition & 1 deletion examples/hub-spoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Three VCN will be created:

This diagram illustrates what will be created by this example.

![diagram](https://github.com/oracle-terraform-modules/terraform-oci-vcn/blob/main/docs/images/hub-spoke-lpg.PNG?raw=true&sanitize=true)
![diagram](https://github.com/oracle-terraform-modules/terraform-oci-vcn/blob/main/docs/images/hub-spoke-lpg.png?raw=true&sanitize=true)

## How to declare one or many LPG on the vcn module

Expand Down
11 changes: 6 additions & 5 deletions examples/hub-spoke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ terraform {
module "vcn_hub" {
# this module use the generic vcn module and configure it to act as a hub in a hub-and-spoke topology
source = "oracle-terraform-modules/vcn/oci"
version = "3.0.0"
version = "3.1.0"

# general oci parameters
compartment_id = var.compartment_id
Expand All @@ -31,7 +31,8 @@ module "vcn_hub" {
lockdown_default_seclist = var.lockdown_default_seclist # boolean: true or false
create_nat_gateway = var.create_nat_gateway # boolean: true or false
create_service_gateway = var.create_service_gateway # boolean: true or false
vcn_cidrs = var.vcn_cidrs # List of IPv4 CIDRs
enable_ipv6 = var.enable_ipv6
vcn_cidrs = var.vcn_cidrs # List of IPv4 CIDRs
vcn_dns_label = var.vcn_dns_label
vcn_name = var.vcn_name

Expand Down Expand Up @@ -67,7 +68,7 @@ resource "oci_core_route_table" "VTR_spokes" {
module "vcn_spoke1" {
# this module use the generic vcn module and configure it to act as a spoke in a hub-and-spoke topology
source = "oracle-terraform-modules/vcn/oci"
version = "3.0.0"
version = "3.1.0"

# general oci parameters
compartment_id = var.compartment_id
Expand Down Expand Up @@ -96,7 +97,7 @@ module "vcn_spoke1" {
module "vcn_spoke2" {
# this module use the generic vcn module and configure it to act as a spoke in a hub-and-spoke topology
source = "oracle-terraform-modules/vcn/oci"
version = "3.0.0"
version = "3.1.0"

# general oci parameters
compartment_id = var.compartment_id
Expand All @@ -123,7 +124,7 @@ module "vcn_spoke2" {
module "vcn_spoke3" {
# this module use the generic vcn module and configure it to act as a spoke in a hub-and-spoke topology
source = "oracle-terraform-modules/vcn/oci"
version = "3.0.0"
version = "3.1.0"

# general oci parameters
compartment_id = var.compartment_id
Expand Down
2 changes: 2 additions & 0 deletions examples/hub-spoke/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ create_nat_gateway = false

create_service_gateway = false

enable_ipv6 = false

vcn_cidrs = ["10.0.0.0/24"]

vcn_dns_label = "vcn"
Expand Down
18 changes: 12 additions & 6 deletions examples/hub-spoke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ variable "create_internet_gateway" {
default = false
}

variable "lockdown_default_seclist" {
description = "whether to remove all default security rules from the VCN Default Security List"
type = bool
default = true
}

variable "create_nat_gateway" {
description = "whether to create a nat gateway in the vcn"
type = bool
Expand All @@ -79,6 +73,18 @@ variable "create_service_gateway" {
default = false
}

variable "lockdown_default_seclist" {
description = "whether to remove all default security rules from the VCN Default Security List"
type = bool
default = true
}

variable "enable_ipv6" {
description = "Whether IPv6 is enabled for the VCN. If enabled, Oracle will assign the VCN a IPv6 /56 CIDR block."
type = bool
default = true
}

variable "freeform_tags" {
description = "simple key-value pairs to tag the resources created"
type = map(any)
Expand Down
5 changes: 3 additions & 2 deletions examples/module_composition/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {

module "vcn" {
source = "oracle-terraform-modules/vcn/oci"
version = "3.0.0"
version = "3.1.0"

# general oci parameters
compartment_id = var.compartment_id
Expand All @@ -30,7 +30,8 @@ module "vcn" {
lockdown_default_seclist = var.lockdown_default_seclist # boolean: true or false
create_nat_gateway = var.create_nat_gateway # boolean: true or false
create_service_gateway = var.create_service_gateway # boolean: true or false
vcn_cidrs = var.vcn_cidrs # List of IPv4 CIDRs
enable_ipv6 = var.enable_ipv6
vcn_cidrs = var.vcn_cidrs # List of IPv4 CIDRs
vcn_dns_label = var.vcn_dns_label
vcn_name = var.vcn_name

Expand Down
2 changes: 2 additions & 0 deletions examples/module_composition/terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ create_nat_gateway = false

create_service_gateway = false

enable_ipv6 = false

vcn_cidrs = ["10.0.0.0/16", "172.16.0.0/16", "192.168.0.0/24"]

vcn_dns_label = "vcn"
Expand Down
18 changes: 12 additions & 6 deletions examples/module_composition/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ variable "create_internet_gateway" {
default = false
}

variable "lockdown_default_seclist" {
description = "whether to remove all default security rules from the VCN Default Security List"
type = bool
default = false
}

variable "create_nat_gateway" {
description = "whether to create a nat gateway in the vcn"
type = bool
Expand All @@ -79,6 +73,12 @@ variable "create_service_gateway" {
default = false
}

variable "enable_ipv6" {
description = "Whether IPv6 is enabled for the VCN. If enabled, Oracle will assign the VCN a IPv6 /56 CIDR block."
type = bool
default = false
}

variable "freeform_tags" {
description = "simple key-value pairs to tag the resources created"
type = map(any)
Expand All @@ -88,6 +88,12 @@ variable "freeform_tags" {
}
}

variable "lockdown_default_seclist" {
description = "whether to remove all default security rules from the VCN Default Security List"
type = bool
default = false
}

variable "vcn_cidrs" {
description = "The list of IPv4 CIDR blocks the VCN will use."
type = list(string)
Expand Down
2 changes: 2 additions & 0 deletions terraform.tfvars.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ create_internet_gateway = false

create_nat_gateway = false

enable_ipv6 = false

nat_gateway_public_ip_id = "none"

create_service_gateway = false
Expand Down
30 changes: 18 additions & 12 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,24 @@ variable "create_internet_gateway" {
type = bool
}

variable "create_nat_gateway" {
description = "whether to create a nat gateway in the vcn. If set to true, creates a nat gateway."
default = false
type = bool
}

variable "create_service_gateway" {
description = "whether to create a service gateway. If set to true, creates a service gateway."
default = false
type = bool
}

variable "enable_ipv6" {
description = "Whether IPv6 is enabled for the VCN. If enabled, Oracle will assign the VCN a IPv6 /56 CIDR block."
type = bool
default = false
}

variable "local_peering_gateways" {
description = "Map of Local Peering Gateways to attach to the VCN."
type = map(any)
Expand All @@ -59,24 +77,12 @@ variable "lockdown_default_seclist" {
type = bool
}

variable "create_nat_gateway" {
description = "whether to create a nat gateway in the vcn. If set to true, creates a nat gateway."
default = false
type = bool
}

variable "nat_gateway_public_ip_id" {
description = "OCID of reserved IP address for NAT gateway. The reserved public IP address needs to be manually created."
default = "none"
type = string
}

variable "create_service_gateway" {
description = "whether to create a service gateway. If set to true, creates a service gateway."
default = false
type = bool
}

variable "vcn_cidrs" {
description = "The list of IPv4 CIDR blocks the VCN will use."
default = ["10.0.0.0/16"]
Expand Down
1 change: 1 addition & 0 deletions vcn.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ resource "oci_core_vcn" "vcn" {
compartment_id = var.compartment_id
display_name = var.label_prefix == "none" ? var.vcn_name : "${var.label_prefix}-${var.vcn_name}"
dns_label = var.vcn_dns_label
is_ipv6enabled = var.enable_ipv6

freeform_tags = var.freeform_tags
}

0 comments on commit dabecf2

Please sign in to comment.