Legacy Dev Forum Posts

 View Only

Sign Up

CX as Code: Update resource with Terraform

  • 1.  CX as Code: Update resource with Terraform

    Posted 06-05-2025 19:34

    v.pinheiro | 2023-11-01 11:50:34 UTC | #1

    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.architectdatabaserow.genesyscloudarchitectdatatablerow.DTVIVRANUNCIADORA_530007, │ on genesyscloud\architectdatatablerow\genesyscloud.tf line 809, in resource "genesyscloudarchitectdatatablerow" "DTVIVRANUNCIADORA_530007": │ 809: resource "genesyscloudarchitectdatatablerow" "DTVIVRANUNCIADORA_530007" {

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

    Exporting: resource "genesyscloudtfexport" "exportresources" { directory = "../publish/genesyscloud/${var.resourcetype}" includefilterresources = ["genesyscloud${var.resourcetype}${var.resourcefilter}"] includestatefile = true exportas_hcl = true }

    Publish: module "architectdatabaserow"{ source = "./genesyscloud/architectdatatablerow"

    //dependson = [module.architectdatabase] }

    On hcl file, abstracting id: resource "genesyscloudarchitectdatatablerow" "DTVIVRANUNCIADORA530007" { datatableid = data.genesyscloudarchitectdatatable.DTVIVRANUNCIADORA.id keyvalue = "530007" propertiesjson = jsonencode({ "ANUAtendimento" = "Corporate", "ANUMsgEmergencial" = "", "ANUMsgFHA" = "ANUCorporateFHA ", "ANUMsgInicial" = "ANUCorporateIni ", "ANUMsgSaudação" = "ANUPadraoSaudacao", "ANUMsgTransferência" = "ANUCorporate_ATH ", "Código de Transferência" = "pan0001", "Destino" = "510001", "Pesquisa Ativa" = false, ............


    system | 2023-12-01 11:51:09 UTC | #2

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


    This post was migrated from the old Developer Forum.

    ref: 22865