CX as Code: Update resource with Terraform

I can't update resources through Terraform with CX as Code. I exported resources from DEV and create on UAT without problems, but when i change this on dev and export again for publish again to UAT this cause errors:

Error: Failed to create Datatable Row c58aa026-ce7e-47c5-b97e-6bc0fd521959/530007: API Error: 409 - key name is not unique (4f3db3f9-413e-48dc-b279-c05d8b9e07f1)

│ with module.architect_database_row.genesyscloud_architect_datatable_row.DT_V_IVR_ANUNCIADORA_530007,
│ on genesyscloud\architect_datatable_row\genesyscloud.tf line 809, in resource "genesyscloud_architect_datatable_row" "DT_V_IVR_ANUNCIADORA_530007":
│ 809: resource "genesyscloud_architect_datatable_row" "DT_V_IVR_ANUNCIADORA_530007" {

PLease, how to make updates with cx as code and terraform after resources createds?

Exporting:
resource "genesyscloud_tf_export" "export_resources" {
directory = "../publish/genesyscloud/${var.resource_type}"
include_filter_resources = ["genesyscloud_${var.resource_type}${var.resource_filter}"]
include_state_file = true
export_as_hcl = true
}

Publish:
module "architect_database_row"{
source = "./genesyscloud/architect_datatable_row"

//depends_on = [module.architect_database]
}

On hcl file, abstracting id:
resource "genesyscloud_architect_datatable_row" "DT_V_IVR_ANUNCIADORA_530007" {
datatable_id = data.genesyscloud_architect_datatable.DT_V_IVR_ANUNCIADORA.id
key_value = "530007"
properties_json = jsonencode({
"ANU_Atendimento" = "Corporate",
"ANU_MsgEmergencial" = "",
"ANU_MsgFHA" = "ANU_Corporate_FHA ",
"ANU_MsgInicial" = "ANU_Corporate_Ini ",
"ANU_MsgSaudação" = "ANU_Padrao_Saudacao",
"ANU_MsgTransferência" = "ANU_Corporate_ATH ",
"Código de Transferência" = "pan0001",
"Destino" = "510001",
"Pesquisa Ativa" = false, ............

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.