Skip to content

Commit 17cade2

Browse files
committed
Expose privateIp and faultDomain for OKE cluster node
1 parent af0d10b commit 17cade2

6 files changed

+25
-0
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 updating `shape` attribute in `oci_database_db_system` resource
55
- Support for CPE builder on IPSec console
6+
- Support for exposing `private_ip` and `fault_domain` for OKE cluster node
67

78
## 3.64.0 (February 26, 2020)
89

oci/containerengine_node_pool_resource.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,10 @@ func ContainerengineNodePoolResource() *schema.Resource {
268268
},
269269
},
270270
},
271+
"fault_domain": {
272+
Type: schema.TypeString,
273+
Computed: true,
274+
},
271275
"id": {
272276
Type: schema.TypeString,
273277
Computed: true,
@@ -284,6 +288,10 @@ func ContainerengineNodePoolResource() *schema.Resource {
284288
Type: schema.TypeString,
285289
Computed: true,
286290
},
291+
"private_ip": {
292+
Type: schema.TypeString,
293+
Computed: true,
294+
},
287295
"public_ip": {
288296
Type: schema.TypeString,
289297
Computed: true,
@@ -834,6 +842,10 @@ func NodeToMap(obj oci_containerengine.Node) map[string]interface{} {
834842
result["error"] = []interface{}{NodeErrorToMap(obj.NodeError)}
835843
}
836844

845+
if obj.FaultDomain != nil {
846+
result["fault_domain"] = string(*obj.FaultDomain)
847+
}
848+
837849
if obj.Id != nil {
838850
result["id"] = string(*obj.Id)
839851
}
@@ -850,6 +862,10 @@ func NodeToMap(obj oci_containerengine.Node) map[string]interface{} {
850862
result["node_pool_id"] = string(*obj.NodePoolId)
851863
}
852864

865+
if obj.PrivateIp != nil {
866+
result["private_ip"] = string(*obj.PrivateIp)
867+
}
868+
853869
if obj.PublicIp != nil {
854870
result["public_ip"] = string(*obj.PublicIp)
855871
}

oci/containerengine_node_pool_resource_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ func TestResourceContainerengineNodePool_regionalsubnet(t *testing.T) {
246246
resource.TestCheckResourceAttr(singularDatasourceName, "node_shape", "VM.Standard2.1"),
247247
resource.TestCheckResourceAttr(singularDatasourceName, "ssh_public_key", "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOuBJgh6lTmQvQJ4BA3RCJdSmxRtmiXAQEEIP68/G4gF3XuZdKEYTFeputacmRq9yO5ZnNXgO9akdUgePpf8+CfFtveQxmN5xo3HVCDKxu/70lbMgeu7+wJzrMOlzj+a4zNq2j0Ww2VWMsisJ6eV3bJTnO/9VLGCOC8M9noaOlcKcLgIYy4aDM724MxFX2lgn7o6rVADHRxkvLEXPVqYT4syvYw+8OVSnNgE4MJLxaw8/2K0qp19YlQyiriIXfQpci3ThxwLjymYRPj+kjU1xIxv6qbFQzHR7ds0pSWp1U06cIoKPfCazU9hGWW8yIe/vzfTbWrt2DK6pLwBn/G0x3 sample"),
248248
resource.TestCheckResourceAttr(singularDatasourceName, "subnet_ids.#", "1"),
249+
// "nodes" is not set until the instances in the node_pool are "Available" so we can't assert the nodes property
250+
//resource.TestCheckResourceAttrSet(singularDatasourceName, "nodes"),
249251
),
250252
},
251253
},

website/docs/d/containerengine_node_pool.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ The following attributes are exported:
6161
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
6262
* `message` - A human-readable error string of the upstream error.
6363
* `status` - The status of the HTTP response encountered in the upstream error.
64+
* `fault_domain` - The fault domain of this node.
6465
* `id` - The OCID of the compute instance backing this node.
6566
* `lifecycle_details` - Details about the state of the node.
6667
* `name` - The name of the node.
6768
* `node_pool_id` - The OCID of the node pool to which this node belongs.
69+
* `private_ip` - The private IP address of this node.
6870
* `public_ip` - The public IP address of this node.
6971
* `state` - The state of the node.
7072
* `subnet_id` - The OCID of the subnet in which this node is placed.

website/docs/d/containerengine_node_pools.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ The following attributes are exported:
7373
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
7474
* `message` - A human-readable error string of the upstream error.
7575
* `status` - The status of the HTTP response encountered in the upstream error.
76+
* `fault_domain` - The fault domain of this node.
7677
* `id` - The OCID of the compute instance backing this node.
7778
* `lifecycle_details` - Details about the state of the node.
7879
* `name` - The name of the node.
7980
* `node_pool_id` - The OCID of the node pool to which this node belongs.
81+
* `private_ip` - The private IP address of this node.
8082
* `public_ip` - The public IP address of this node.
8183
* `state` - The state of the node.
8284
* `subnet_id` - The OCID of the subnet in which this node is placed.

website/docs/r/containerengine_node_pool.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,12 @@ The following attributes are exported:
109109
* `code` - A short error code that defines the upstream error, meant for programmatic parsing. See [API Errors](https://docs.cloud.oracle.com/iaas/Content/API/References/apierrors.htm).
110110
* `message` - A human-readable error string of the upstream error.
111111
* `status` - The status of the HTTP response encountered in the upstream error.
112+
* `fault_domain` - The fault domain of this node.
112113
* `id` - The OCID of the compute instance backing this node.
113114
* `lifecycle_details` - Details about the state of the node.
114115
* `name` - The name of the node.
115116
* `node_pool_id` - The OCID of the node pool to which this node belongs.
117+
* `private_ip` - The private IP address of this node.
116118
* `public_ip` - The public IP address of this node.
117119
* `state` - The state of the node.
118120
* `subnet_id` - The OCID of the subnet in which this node is placed.

0 commit comments

Comments
 (0)