Skip to content

Commit

Permalink
Make OCID property exportable after Oracle VMCluster creation (#27785)
Browse files Browse the repository at this point in the history
* * Make OCID property exportable after VMCluster creation.
* Update doc to make it clear that hostname_actual is not intended to be used as input.

* * Add ocid to docs.

* * Move ocid to attributes.
  • Loading branch information
eelhomsi authored Oct 29, 2024
1 parent a04a353 commit 64edafe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions internal/services/oracle/cloud_vm_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down Expand Up @@ -253,6 +254,11 @@ func (CloudVmClusterResource) Attributes() map[string]*pluginsdk.Schema {
Type: pluginsdk.TypeString,
Computed: true,
},

"ocid": {
Type: pluginsdk.TypeString,
Computed: true,
},
}
}

Expand Down Expand Up @@ -437,6 +443,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)
Expand Down
6 changes: 4 additions & 2 deletions website/docs/r/oracle_cloud_vm_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -149,6 +147,10 @@ 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.

* `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:
Expand Down

0 comments on commit 64edafe

Please sign in to comment.