Skip to content

Commit 4d8ff34

Browse files
authored
feat: Support disabled DNS resolution with optional dns_label on VCN (#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]>
1 parent 52158fb commit 4d8ff34

File tree

10 files changed

+22
-18
lines changed

10 files changed

+22
-18
lines changed

CHANGELOG.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ Given a version number MAJOR.MINOR.PATCH:
1515
- PATCH version when making backwards compatible bug fixes.
1616
1717
== 4.0.0 (not released)
18+
* Added support for disabled VCN DNS resolution with null vcn_dns_label variable
19+
* Change default vcn_name from vcn-module -> vcn
20+
21+
== 3.5.2 (October 7, 2022)
1822
* Ignored lifecycle changes for defined_tags, freeform_tags
1923

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

docs/quickstart.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ variable "user_id" {
9191

9292
* `compartment_id`
9393
* `label_prefix`
94-
* `vcn_dns_label`
9594
* `vcn_name`
9695

9796
. Optional parameters to override:
@@ -101,6 +100,7 @@ variable "user_id" {
101100
* `create_service_gateway`
102101
* `freeform_tags`
103102
* `attached_drg_id`
103+
* `vcn_dns_label`
104104

105105
. Run Terraform:
106106

@@ -160,7 +160,6 @@ cp terraform.tfvars.example terraform.tfvars
160160

161161
* `compartment_id`
162162
* `label_prefix`
163-
* `vcn_dns_label`
164163
* `vcn_name`
165164

166165
. Optional parameters to override:
@@ -171,6 +170,7 @@ cp terraform.tfvars.example terraform.tfvars
171170
* `create_service_gateway`
172171
* `freeform_tags`
173172
* `defined_tags`
173+
* `vcn_dns_label`
174174

175175
. Run Terraform:
176176
+

docs/terraformoptions.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ e.g.
218218
| `["10.0.0.0/16"]`
219219

220220
|`vcn_dns_label`
221-
|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
221+
|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.
222222
|`string`
223223
|"vcnmodule"
224224

225225
|`vcn_name`
226-
|The name of the VCN that will be appended to the label_prefix. *Required*
226+
|The name of the VCN that will be appended to the label_prefix.
227227
|`string`
228-
|
228+
|"vcn"
229229

230230
|===
231231

examples/custom_route_rules/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ variable "vcn_dns_label" {
110110
variable "vcn_name" {
111111
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
112112
type = string
113-
default = "vcn-module"
113+
default = "vcn"
114114
}
115115

116116
# gateways parameters

examples/hub-spoke/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ variable "vcn_dns_label" {
109109
variable "vcn_name" {
110110
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
111111
type = string
112-
default = "vcn-module"
112+
default = "vcn"
113113
}
114114

115115
# gateways parameters

examples/module_composition/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ variable "vcn_dns_label" {
109109
variable "vcn_name" {
110110
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
111111
type = string
112-
default = "vcn-module"
112+
default = "vcn"
113113
}
114114

115115
# gateways parameters

modules/subnet/subnet.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resource "oci_core_subnet" "vcn_subnet" {
2626
security_list_ids = null
2727

2828
lifecycle {
29-
ignore_changes = [defined_tags, freeform_tags]
29+
ignore_changes = [defined_tags, dns_label, freeform_tags]
3030
}
3131
}
3232

schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ variables:
4646
vcn_dns_label:
4747
title: VCN DNS Label
4848
type: string
49-
required: true
49+
required: false
5050
default: vcn
5151

5252
lockdown_default_seclist:

variables.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019, 2021 Oracle Corporation and/or affiliates. All rights reserved.
1+
# Copyright (c) 2019, 2022 Oracle Corporation and/or affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

44
# provider identity parameters
@@ -83,20 +83,20 @@ variable "vcn_cidrs" {
8383
}
8484

8585
variable "vcn_dns_label" {
86-
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"
86+
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."
8787
type = string
8888
default = "vcnmodule"
8989

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

9696
variable "vcn_name" {
9797
description = "user-friendly name of to use for the vcn to be appended to the label_prefix"
9898
type = string
99-
default = "vcn-module"
99+
default = "vcn"
100100
validation {
101101
condition = length(var.vcn_name) > 0
102102
error_message = "The vcn_name value cannot be an empty string."

vcn.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019, 2021, Oracle Corporation and/or affiliates.
1+
# Copyright (c) 2019, 2022 Oracle Corporation and/or affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
33

44
resource "oci_core_vcn" "vcn" {
@@ -14,7 +14,7 @@ resource "oci_core_vcn" "vcn" {
1414
defined_tags = var.defined_tags
1515

1616
lifecycle {
17-
ignore_changes = [defined_tags, freeform_tags]
17+
ignore_changes = [defined_tags, dns_label, freeform_tags]
1818
}
1919
}
2020

0 commit comments

Comments
 (0)