You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the source_details.source_id of the VM is changed, terraform should replace the whole oci_core_instance resource.
Actual Behavior
Instead, it tries to update the oci_core_instance resource and the API fails with this error:
╷
│ Error: 400-InvalidParameter, sourceDetails.kmsKeyId size must be between 1 and 255
│ Suggestion: Please update the parameter(s) in the Terraform config as per error message sourceDetails.kmsKeyId size must be between 1 and 255
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_instance
│ API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/UpdateInstance
│ Request Target: PUT https://iaas.us-phoenix-1.oraclecloud.com/20160918/instances/ocid1.instance.oc1.phx.anyhqljrp4o7ruacplfc63r45qkhzeni4ydkywifmqhn6cdu2d6ubf2lupna
│ Provider version: 5.45.0, released on 2024-06-05.
│ Service: Core Instance
│ Operation Name: UpdateInstance
│ OPC request ID: 38ccc413c5e45f32dfd7d06e71ba1eb6/53508B2F886A98DA289B961D079B4237/538001672CEE97C9422F7567958EC45C
│
│
│ with module.strongdm_gateway_oci_seismic_us_phoenix.oci_core_instance.sdm_gateways[0],
│ on ../../modules/oci-strongdm-gateway/main.tf line 84, in resource "oci_core_instance" "sdm_gateways":
│ 84: resource "oci_core_instance" "sdm_gateways" {
│
╵
Steps to Reproduce
terraform apply
Important Factoids
A workaround is to create a fake resource bound to the source_id image data, and to state it in the lifecycle.replace_triggered_by block of the oci_core_instance resource:
resource"oci_core_instance""sdm_gateways" {
[...]
lifecycle {
replace_triggered_by=[
# This is to avoid this error when TF tries to modify an existing instance: "Error: 400-InvalidParameter, sourceDetails.kmsKeyId size must be between 1 and 255"terraform_data.sdm_gateway_image,
]
}
}
resource"terraform_data""sdm_gateway_image" {
input=data.oci_core_image.this.id
}
References
The text was updated successfully, but these errors were encountered:
lra
changed the title
oci_core_instance should not support source_details update
oci_core_instance should not support source_details updates
Jun 5, 2024
Community Note
Terraform Version and Provider Version
Affected Resource(s)
core_instance
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
When the
source_details.source_id
of the VM is changed, terraform should replace the wholeoci_core_instance
resource.Actual Behavior
Instead, it tries to update the
oci_core_instance
resource and the API fails with this error:Steps to Reproduce
terraform apply
Important Factoids
A workaround is to create a fake resource bound to the
source_id
image data, and to state it in thelifecycle.replace_triggered_by
block of theoci_core_instance
resource:References
The text was updated successfully, but these errors were encountered: