Does anyone know why genesyscloud_ai_language_model fails to reconcile version pinning during GitHub Actions deployment?
- Define resource with
version = "2023-10-01" in HCL.
- Run
terraform plan.
- Output shows no changes despite API returning
2023-11-15.
State file persists old version. Drift detection silent. Using GC CLI v2.1.4. Need force recreation or explicit attribute to lock version.
If I remember correctly…
Does anyone know why genesyscloud_ai_language_model fails to reconcile version pinning during GitHub Actions deployment?
The issue likely stems from how the provider handles immutable resource attributes versus mutable metadata. When you pin a version like "2023-10-01", the API may treat subsequent updates to that same logical model as metadata changes rather than a replacement of the underlying resource ID. Terraform often ignores these if the ID remains stable.
Try adding lifecycle { create_before_destroy = true } to your resource block. This forces the provider to recognize the version change as a distinct resource lifecycle event rather than an in-place update. Alternatively, check if the genesyscloud_ai_language_model resource supports a force_new tag or if you need to explicitly reference the id from a data source to ensure state accuracy.
resource "genesyscloud_ai_language_model" "my_model" {
# ... config ...
lifecycle {
create_before_destroy = true
}
}
This approach mirrors how we handle SIP credential rotations on our BYOC trunks-forcing a clean state transition rather than attempting an atomic update.