From a54b8378a114bfe0e693b39ea53cd2dc3516d0ca Mon Sep 17 00:00:00 2001 From: Eamon El-Homsi Date: Mon, 28 Oct 2024 12:50:43 +0000 Subject: [PATCH 1/3] * Make OCID property exportable after VMCluster creation. * Update doc to make it clear that hostname_actual is not intended to be used as input. --- internal/services/oracle/cloud_vm_cluster_resource.go | 9 +++++++++ website/docs/r/oracle_cloud_vm_cluster.html.markdown | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/services/oracle/cloud_vm_cluster_resource.go b/internal/services/oracle/cloud_vm_cluster_resource.go index 15404572bf87..d41fae79b4fc 100644 --- a/internal/services/oracle/cloud_vm_cluster_resource.go +++ b/internal/services/oracle/cloud_vm_cluster_resource.go @@ -55,6 +55,7 @@ type CloudVmClusterResourceModel struct { DataStoragePercentage int64 `tfschema:"data_storage_percentage"` IsLocalBackupEnabled bool `tfschema:"local_backup_enabled"` IsSparseDiskgroupEnabled bool `tfschema:"sparse_diskgroup_enabled"` + Ocid string `tfschema:"ocid"` TimeZone string `tfschema:"time_zone"` } @@ -229,6 +230,13 @@ func (CloudVmClusterResource) Arguments() map[string]*pluginsdk.Schema { ForceNew: true, }, + "ocid": { + Type: pluginsdk.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "sparse_diskgroup_enabled": { Type: pluginsdk.TypeBool, Optional: true, @@ -437,6 +445,7 @@ func (CloudVmClusterResource) Read() sdk.ResourceFunc { state.ClusterName = pointer.From(props.ClusterName) state.DataCollectionOptions = FlattenDataCollectionOptions(props.DataCollectionOptions) state.DataStoragePercentage = pointer.From(props.DataStoragePercentage) + state.Ocid = pointer.From(props.Ocid) state.IsLocalBackupEnabled = pointer.From(props.IsLocalBackupEnabled) state.IsSparseDiskgroupEnabled = pointer.From(props.IsSparseDiskgroupEnabled) state.TimeZone = pointer.From(props.TimeZone) diff --git a/website/docs/r/oracle_cloud_vm_cluster.html.markdown b/website/docs/r/oracle_cloud_vm_cluster.html.markdown index 2c98b5c319bd..284cb47539f2 100644 --- a/website/docs/r/oracle_cloud_vm_cluster.html.markdown +++ b/website/docs/r/oracle_cloud_vm_cluster.html.markdown @@ -93,8 +93,6 @@ The following arguments are supported: * `hostname` - (Required) The hostname for the Cloud VM Cluster without suffix. -* `hostname_actual` - The hostname for the Cloud VM Cluster with suffix. - * `license_model` - (Required) The Oracle license model that applies to the Cloud VM Cluster, either `BringYourOwnLicense` or `LicenseIncluded`. * `location` - (Required) The Azure Region where the Cloud VM Cluster should exist. @@ -149,6 +147,8 @@ In addition to the Arguments listed above - the following Attributes are exporte * `id` - The ID of the Cloud VM Cluster. +* `hostname_actual` - The hostname for the Cloud VM Cluster with suffix. + ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: From 9714a76528ec49404200ccd678906051810ba5c2 Mon Sep 17 00:00:00 2001 From: Eamon El-Homsi Date: Tue, 29 Oct 2024 09:30:49 +0000 Subject: [PATCH 2/3] * Add ocid to docs. --- website/docs/r/oracle_cloud_vm_cluster.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/oracle_cloud_vm_cluster.html.markdown b/website/docs/r/oracle_cloud_vm_cluster.html.markdown index 284cb47539f2..0742b6ae912a 100644 --- a/website/docs/r/oracle_cloud_vm_cluster.html.markdown +++ b/website/docs/r/oracle_cloud_vm_cluster.html.markdown @@ -149,6 +149,8 @@ In addition to the Arguments listed above - the following Attributes are exporte * `hostname_actual` - The hostname for the Cloud VM Cluster with suffix. +* `ocid` - The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the Cloud VM Cluster. + ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/language/resources/syntax#operation-timeouts) for certain actions: From dd816bc6d56f393d65dce8ab4404c5f5b854ed24 Mon Sep 17 00:00:00 2001 From: Eamon El-Homsi Date: Tue, 29 Oct 2024 09:44:55 +0000 Subject: [PATCH 3/3] * Move ocid to attributes. --- .../services/oracle/cloud_vm_cluster_resource.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/services/oracle/cloud_vm_cluster_resource.go b/internal/services/oracle/cloud_vm_cluster_resource.go index d41fae79b4fc..526c364c7860 100644 --- a/internal/services/oracle/cloud_vm_cluster_resource.go +++ b/internal/services/oracle/cloud_vm_cluster_resource.go @@ -230,13 +230,6 @@ func (CloudVmClusterResource) Arguments() map[string]*pluginsdk.Schema { ForceNew: true, }, - "ocid": { - Type: pluginsdk.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "sparse_diskgroup_enabled": { Type: pluginsdk.TypeBool, Optional: true, @@ -261,6 +254,11 @@ func (CloudVmClusterResource) Attributes() map[string]*pluginsdk.Schema { Type: pluginsdk.TypeString, Computed: true, }, + + "ocid": { + Type: pluginsdk.TypeString, + Computed: true, + }, } }