After creation of the VM cluster, the updatable properties can be modified. As an example, the display name.
Actual Behavior
Upon making any change and running apply, the following occurs:
Error: 400-InvalidParameter, MaintenanceWindow leadTimeInWeeks : is only supported for Exadata DbSystems.
β Suggestion: Please update the parameter(s) in the Terraform config as per error message MaintenanceWindow leadTimeInWeeks : is only supported for Exadata DbSystems.
β Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/database_cloud_autonomous_vm_cluster
β API Reference: https://docs.oracle.com/iaas/api/#/en/database/20160918/CloudAutonomousVmCluster/UpdateCloudAutonomousVmCluster
β Request Target: PUT https://database.eu-amsterdam-1.oraclecloud.com/snip/cloudAutonomousVmClusters/ocid1.cloudautonomousvmcluster.oc1.eu-amsterdam-1.snipsnip
β Provider version: 4.113.0, released on 2023-03-22.
β Service: Database Cloud Autonomous Vm Cluster
β Operation Name: UpdateCloudAutonomousVmCluster
β OPC request ID: snip
Steps to Reproduce
Create a oci_database_cloud_autonomous_vm_cluster instance on X9M-2. Specify a custom maintenance window.
Change an updatable property related not related to the maintenance window.
The plan should show that property being updated, but no modifications to the maintenance schedule (as expected)
The apply fails with the message above.
Important Factoids
It appears related to how the provider deals with 'lead time in weeks'. Note that in the code we never specify this property and Terraform will create the cluster accordingly. Afterwards, I verified through oci db cloud-autonomous-vm-cluster get --cloud-autonomous-vm-cluster-id that when you request the cluster from the API, the corresponding 'lead time' property is set to null:
With TF_LOG=DEBUG OCI_GO_SDK_DEBUG=v I was able to verify that when Terraform issues the PUT request to update the resource, it has the following in the body of the request:
Community Note
Terraform Version and Provider Version
Affected Resource(s)
oci_database_cloud_autonomous_vm_cluster
Terraform Configuration Files
Expected Behavior
After creation of the VM cluster, the updatable properties can be modified. As an example, the display name.
Actual Behavior
Upon making any change and running
apply
, the following occurs:Steps to Reproduce
oci_database_cloud_autonomous_vm_cluster
instance on X9M-2. Specify a custom maintenance window.plan
should show that property being updated, but no modifications to the maintenance schedule (as expected)apply
fails with the message above.Important Factoids
It appears related to how the provider deals with 'lead time in weeks'. Note that in the code we never specify this property and Terraform will create the cluster accordingly. Afterwards, I verified through
oci db cloud-autonomous-vm-cluster get --cloud-autonomous-vm-cluster-id
that when you request the cluster from the API, the corresponding 'lead time' property is set to null:However, when you issue a
terraform state show
it will show for that same resource the value '0' for the lead time:With
TF_LOG=DEBUG OCI_GO_SDK_DEBUG=v
I was able to verify that when Terraform issues the PUT request to update the resource, it has the following in the body of the request:"maintenanceWindowDetails":{"customActionTimeoutInMins":0,"daysOfWeek":[{"name":"SUNDAY"}],"hoursOfDay":[4],"isCustomActionTimeoutEnabled":false,"isMonthlyPatchingEnabled":false,"leadTimeInWeeks":0,"months":[{"name":"FEBRUARY"},{"name":"MAY"},{"name":"AUGUST"},{"name":"NOVEMBER"}],"preference":"CUSTOM_PREFERENCE","weeksOfMonth":[1]}
It appears that the
null
from the API is imported into the Terraform state as0
which is then propagated in subsequent updates.