Skip to content

Commit 08a4f77

Browse files
committed
Support for Regional VLANs added to core
1 parent ee5a57a commit 08a4f77

File tree

6 files changed

+20
-13
lines changed

6 files changed

+20
-13
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### Added
44
- Support for Oracle distribution of Hadoop with Big Data service
55
- Support for APM Synthetics service added
6+
- Support for Regional VLANs added to `core`
67

78
## 4.34.0 (July 07, 2021)
89

oci/core_vlan_resource.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@ func CoreVlanResource() *schema.Resource {
2727
Delete: deleteCoreVlan,
2828
Schema: map[string]*schema.Schema{
2929
// Required
30-
"availability_domain": {
31-
Type: schema.TypeString,
32-
Required: true,
33-
ForceNew: true,
34-
DiffSuppressFunc: EqualIgnoreCaseSuppressDiff,
35-
},
3630
"cidr_block": {
3731
Type: schema.TypeString,
3832
Required: true,
@@ -48,6 +42,13 @@ func CoreVlanResource() *schema.Resource {
4842
},
4943

5044
// Optional
45+
"availability_domain": {
46+
Type: schema.TypeString,
47+
Optional: true,
48+
Computed: true,
49+
ForceNew: true,
50+
DiffSuppressFunc: EqualIgnoreCaseSuppressDiff,
51+
},
5152
"defined_tags": {
5253
Type: schema.TypeMap,
5354
Optional: true,

oci/core_vlan_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ var (
4242
}
4343

4444
vlanRepresentation = map[string]interface{}{
45-
"availability_domain": Representation{repType: Required, create: `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}`},
4645
"cidr_block": Representation{repType: Required, create: `10.0.0.0/24`, update: "10.0.0.0/16"},
4746
"compartment_id": Representation{repType: Required, create: `${var.compartment_id}`},
4847
"vcn_id": Representation{repType: Required, create: `${oci_core_vcn.test_vcn.id}`},
48+
"availability_domain": Representation{repType: Optional, create: `${data.oci_identity_availability_domains.test_availability_domains.availability_domains.0.name}`},
4949
"defined_tags": Representation{repType: Optional, create: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "value")}`, update: `${map("${oci_identity_tag_namespace.tag-namespace1.name}.${oci_identity_tag.tag1.name}", "updatedValue")}`},
5050
"display_name": Representation{repType: Optional, create: `displayName`, update: `displayName2`},
5151
"freeform_tags": Representation{repType: Optional, create: map[string]string{"Department": "Finance"}, update: map[string]string{"Department": "Accounting"}},
@@ -101,7 +101,6 @@ func TestCoreVlanResource_basic(t *testing.T) {
101101
Config: config + compartmentIdVariableStr + VlanResourceDependencies +
102102
generateResourceFromRepresentationMap("oci_core_vlan", "test_vlan", Required, Create, vlanRepresentation),
103103
Check: resource.ComposeAggregateTestCheckFunc(
104-
resource.TestCheckResourceAttrSet(resourceName, "availability_domain"),
105104
resource.TestCheckResourceAttr(resourceName, "cidr_block", "10.0.0.0/24"),
106105
resource.TestCheckResourceAttr(resourceName, "compartment_id", compartmentId),
107106
resource.TestCheckResourceAttrSet(resourceName, "vcn_id"),

website/docs/d/core_vlan.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following arguments are supported:
3232

3333
The following attributes are exported:
3434

35-
* `availability_domain` - The availability domain of the VLAN. Example: `Uocm:PHX-AD-1`
35+
* `availability_domain` - The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: `Uocm:PHX-AD-1`
3636
* `cidr_block` - The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: `192.168.1.0/24`
3737
* `compartment_id` - The OCID of the compartment containing the VLAN.
3838
* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`

website/docs/d/core_vlans.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The following attributes are exported:
4747

4848
The following attributes are exported:
4949

50-
* `availability_domain` - The availability domain of the VLAN. Example: `Uocm:PHX-AD-1`
50+
* `availability_domain` - The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: `Uocm:PHX-AD-1`
5151
* `cidr_block` - The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: `192.168.1.0/24`
5252
* `compartment_id` - The OCID of the compartment containing the VLAN.
5353
* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`

website/docs/r/core_vlan.html.markdown

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Creates a VLAN in the specified VCN and the specified compartment.
1818
```hcl
1919
resource "oci_core_vlan" "test_vlan" {
2020
#Required
21-
availability_domain = var.vlan_availability_domain
2221
cidr_block = var.vlan_cidr_block
2322
compartment_id = var.compartment_id
2423
vcn_id = oci_core_vcn.test_vcn.id
2524
2625
#Optional
26+
availability_domain = var.vlan_availability_domain
2727
defined_tags = {"Operations.CostCenter"= "42"}
2828
display_name = var.vlan_display_name
2929
freeform_tags = {"Department"= "Finance"}
@@ -37,7 +37,13 @@ resource "oci_core_vlan" "test_vlan" {
3737

3838
The following arguments are supported:
3939

40-
* `availability_domain` - (Required) The availability domain of the VLAN. Example: `Uocm:PHX-AD-1`
40+
* `availability_domain` - (Optional) Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.
41+
42+
To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.
43+
44+
To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.
45+
46+
Example: `Uocm:PHX-AD-1`
4147
* `cidr_block` - (Required) (Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -
4248

4349
a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.
@@ -61,7 +67,7 @@ Any change to a property that does not support update will force the destruction
6167

6268
The following attributes are exported:
6369

64-
* `availability_domain` - The availability domain of the VLAN. Example: `Uocm:PHX-AD-1`
70+
* `availability_domain` - The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: `Uocm:PHX-AD-1`
6571
* `cidr_block` - The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: `192.168.1.0/24`
6672
* `compartment_id` - The OCID of the compartment containing the VLAN.
6773
* `defined_tags` - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"Operations.CostCenter": "42"}`

0 commit comments

Comments
 (0)