Quick question about handling state drift for WebRTC softphone configurations when deploying via Terraform in a CI/CD pipeline.
We are using genesyscloud_softphone_config to manage the default softphone settings across multiple environments (dev, staging, prod). The setup involves a standard IaC pipeline using Terraform 1.8.3 and Genesys Cloud Provider 1.12.0.
The issue arises when we attempt to update the webrtc_enabled flag or modify the audio_codecs list. During terraform plan, the provider detects a drift that was not introduced by our code. Specifically, the state file shows the audio_codecs as ['OPUS', 'G722'], but the actual resource in Genesys Cloud returns ['OPUS', 'G722', 'PCMU'].
This extra PCMU codec appears to be added automatically by the platform when WebRTC is enabled on a BYOC edge deployment, likely due to legacy fallback requirements. However, Terraform tries to remove it on every apply, causing a continuous cycle of drift detection.
Error snippet from terraform plan:
We have tried using lifecycle { ignore_changes = [audio_codecs] }, but this prevents us from updating the codec list intentionally when needed. We need a way to reconcile the state without ignoring changes entirely.
Is there a known workaround for this specific drift behavior with WebRTC softphone configs? Or is this a limitation of the provider’s handling of BYOC edge defaults? Any advice on stabilizing the state would be appreciated.
# genesyscloud_softphone_config.default will be updated in-place
~ resource "genesyscloud_softphone_config" "default" {
~ audio_codecs = [
'OPUS',
'G722',
- 'PCMU',
]
}