Skip to content

Commit

Permalink
feat: Support disabled DNS resolution with optional dns_label on VCN (#…
Browse files Browse the repository at this point in the history
…101)

* Support disabled DNS resolution with optional dns_label on VCN

Signed-off-by: Devon Crouse <[email protected]>

* Change vcn_name default from "vcn-module" to "vcn"

Signed-off-by: Devon Crouse <[email protected]>

Signed-off-by: Devon Crouse <[email protected]>
  • Loading branch information
devoncrouse authored Nov 10, 2022
1 parent 52158fb commit 4d8ff34
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ Given a version number MAJOR.MINOR.PATCH:
- PATCH version when making backwards compatible bug fixes.
== 4.0.0 (not released)
* Added support for disabled VCN DNS resolution with null vcn_dns_label variable
* Change default vcn_name from vcn-module -> vcn

== 3.5.2 (October 7, 2022)
* Ignored lifecycle changes for defined_tags, freeform_tags

== 3.5.1 (September 5, 2022))
== 3.5.1 (September 5, 2022)
* removed DRG submodule, now promoted to terraform-oci-drg module (feat: )
* updated examples to use GitHub repo as source ()

Expand Down
4 changes: 2 additions & 2 deletions docs/quickstart.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ variable "user_id" {

* `compartment_id`
* `label_prefix`
* `vcn_dns_label`
* `vcn_name`

. Optional parameters to override:
Expand All @@ -101,6 +100,7 @@ variable "user_id" {
* `create_service_gateway`
* `freeform_tags`
* `attached_drg_id`
* `vcn_dns_label`

. Run Terraform:

Expand Down Expand Up @@ -160,7 +160,6 @@ cp terraform.tfvars.example terraform.tfvars

* `compartment_id`
* `label_prefix`
* `vcn_dns_label`
* `vcn_name`

. Optional parameters to override:
Expand All @@ -171,6 +170,7 @@ cp terraform.tfvars.example terraform.tfvars
* `create_service_gateway`
* `freeform_tags`
* `defined_tags`
* `vcn_dns_label`

. Run Terraform:
+
Expand Down
6 changes: 3 additions & 3 deletions docs/terraformoptions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ e.g.
| `["10.0.0.0/16"]`

|`vcn_dns_label`
|A DNS label for the VCN, used in conjunction with the VNIC's hostname and subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet
|A DNS label for the VCN, used in conjunction with the VNIC's hostname and subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet. DNS resolution for hostnames in the VCN is disabled if null.
|`string`
|"vcnmodule"

|`vcn_name`
|The name of the VCN that will be appended to the label_prefix. *Required*
|The name of the VCN that will be appended to the label_prefix.
|`string`
|
|"vcn"

|===

Expand Down
2 changes: 1 addition & 1 deletion examples/custom_route_rules/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ variable "vcn_dns_label" {
variable "vcn_name" {
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
type = string
default = "vcn-module"
default = "vcn"
}

# gateways parameters
Expand Down
2 changes: 1 addition & 1 deletion examples/hub-spoke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "vcn_dns_label" {
variable "vcn_name" {
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
type = string
default = "vcn-module"
default = "vcn"
}

# gateways parameters
Expand Down
2 changes: 1 addition & 1 deletion examples/module_composition/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ variable "vcn_dns_label" {
variable "vcn_name" {
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
type = string
default = "vcn-module"
default = "vcn"
}

# gateways parameters
Expand Down
2 changes: 1 addition & 1 deletion modules/subnet/subnet.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resource "oci_core_subnet" "vcn_subnet" {
security_list_ids = null

lifecycle {
ignore_changes = [defined_tags, freeform_tags]
ignore_changes = [defined_tags, dns_label, freeform_tags]
}
}

Expand Down
2 changes: 1 addition & 1 deletion schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ variables:
vcn_dns_label:
title: VCN DNS Label
type: string
required: true
required: false
default: vcn

lockdown_default_seclist:
Expand Down
10 changes: 5 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019, 2021 Oracle Corporation and/or affiliates. All rights reserved.
# Copyright (c) 2019, 2022 Oracle Corporation and/or affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

# provider identity parameters
Expand Down Expand Up @@ -83,20 +83,20 @@ variable "vcn_cidrs" {
}

variable "vcn_dns_label" {
description = "A DNS label for the VCN, used in conjunction with the VNIC's hostname and subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet"
description = "A DNS label for the VCN, used in conjunction with the VNIC's hostname and subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet. DNS resolution of hostnames in the VCN is disabled when null."
type = string
default = "vcnmodule"

validation {
condition = length(regexall("^[^0-9][a-zA-Z0-9_]+$", var.vcn_dns_label)) > 0
error_message = "DNS label must be an alphanumeric string that begins with a letter."
condition = var.vcn_dns_label == null ? true : length(regexall("^[^0-9][a-zA-Z0-9_]{1,14}$", var.vcn_dns_label)) > 0
error_message = "DNS label must be unset to disable, or an alphanumeric string with length of 1 through 15 that begins with a letter."
}
}

variable "vcn_name" {
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
type = string
default = "vcn-module"
default = "vcn"
validation {
condition = length(var.vcn_name) > 0
error_message = "The vcn_name value cannot be an empty string."
Expand Down
4 changes: 2 additions & 2 deletions vcn.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019, 2021, Oracle Corporation and/or affiliates.
# Copyright (c) 2019, 2022 Oracle Corporation and/or affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/

resource "oci_core_vcn" "vcn" {
Expand All @@ -14,7 +14,7 @@ resource "oci_core_vcn" "vcn" {
defined_tags = var.defined_tags
lifecycle {
ignore_changes = [defined_tags, freeform_tags]
ignore_changes = [defined_tags, dns_label, freeform_tags]
}
}
Expand Down

0 comments on commit 4d8ff34

Please sign in to comment.