Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Terraform modifies Queue on every run

    Posted 07-08-2025 15:40

    Hi everyone,

    I'm using Terraform to manage a Genesys Cloud Queue with auto answer enabled for every Messaging Channel. However, I've noticed that every time I run terraform apply, it detects and tries to modify the Queue-even when there haven't been any changes to the configuration.

    Has anyone encountered this behavior before? Is there a known workaround or a way to prevent Terraform from showing the Queue as needing an update on every run?

    I am using the latest version of the Genesys Cloud Provider. (V 1.66.0)

    Thanks in advance!


    #CXasCode

    ------------------------------
    Aryan Shrestha
    ------------------------------


  • 2.  RE: Terraform modifies Queue on every run

    Posted 07-10-2025 03:59

    I believe this is most likely because these attributes are stored in the state file in a list (ordered) and the response from the API call is unordered therefore a drift is detected. 

    You should be able to get around this by using a dynamic block in the resource. Here is an example:

    variable "media_sub_types" {
      default = {
        facebook = true
        open     = true
        twitter = false
      }
    }
    
    resource "genesyscloud_routing_queue" "test" {
      name                     = "TF Test"
    
      description              = "This is an example description"
      acw_wrapup_prompt        = "MANDATORY_TIMEOUT"
      acw_timeout_ms           = 300000
      skill_evaluation_method  = "BEST"
      auto_answer_only         = true
      enable_transcription     = true
      enable_audio_monitoring  = true
      enable_manual_assignment = true
      calling_party_name       = "Example Inc."
    
      media_settings_call {
        alerting_timeout_sec      = 30
        service_level_percentage  = 0.7
        service_level_duration_ms = 10000
      }
      routing_rules {
        operator     = "MEETS_THRESHOLD"
        threshold    = 9
        wait_seconds = 300
      }
    media_settings_message {
      alerting_timeout_sec =  300
      enable_auto_answer = true
      service_level_duration_ms = 30000
      service_level_percentage = 0.8
    
    
    
    
      dynamic "sub_type_settings" {
      for_each = var.media_sub_types
      content {
        media_type         = sub_type_settings.key
        enable_auto_answer = sub_type_settings.value
      }
    
    }
    }
    }


    ------------------------------
    Savino Ricci
    Technical Consultant
    ------------------------------



  • 3.  RE: Terraform modifies Queue on every run

    Posted 07-15-2025 14:37
    Edited by Aryan Shrestha 07-15-2025 15:56

    Thanks, Savino. Using dynamic keyword worked for me!  It worked for the first run but after that it still says that it modifies the queue.

    I also had another question. If I was using the export capabilities to bulk export queues. Is there an attribute in the export schema that automatically adds the dynamic keyboard to the resource?



    ------------------------------
    Aryan Shrestha
    ------------------------------



  • 4.  RE: Terraform modifies Queue on every run

    Posted 07-16-2025 02:35

    Hi Aryan,

    Strange it seemed to work for me on every run, I'll have another look. In the meantime, if no changes are expected for this attribute, you could use the ignore_changes lifecycle block to ignore the change.

    lifecycle {
      ignore_changes = [media_settings_message[0].sub_type_settings ]
    }

    In answer to your question, I do not believe that is possible.



    ------------------------------
    Savino Ricci
    Technical Consultant
    ------------------------------