When i am trying to inject the prompts using Terraform i have an issue concerning the uploading of the file.
Here is my code :
terraform {
required_providers {
genesyscloud = {
source = "mypurecloud/genesyscloud"
version = "~> 1.0"
}
}
}
provider "genesyscloud" {
oauthclient_id = var.oauthclient_id
oauthclient_secret = var.oauthclient_secret
aws_region = var.aws_region
token_pool_size = 1 # Limite à une seule connexion à la fois
}
locals {
prompt_config = jsondecode(file("${var.input_file_path}/${var.input_file_name}"))
}
resource "genesyscloud_architect_user_prompt" "prompts" {
for_each = {
for prompt in local.prompt_config : prompt.name => prompt
#if try(length(data.genesyscloud_architect_user_prompt.existing_prompts[prompt.name].id) == 0, true)
}
name = each.key
description = each.value.description
dynamic "resources" {
for_each = each.value.resources
content {
language = resources.value.language
filename = resources.value.filename
file_content_hash = filesha256("${var.input_prompt_path}/${resources.value.filename}")
text = resources.value.text
tts_string = resources.value.tts_string
}
}
# Gérer les divisions existantes sans provoquer d'erreur
lifecycle {
ignore_changes = [name]
}
}
When i plan to inject here is the return of Terraform :
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_ATS_INFO"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_ATS_INFO"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_ATS_INFO.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_ATS_INFO_HOLD"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_ATS_INFO_HOLD"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_ATS_INFO_HOLD.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_ATS_INFO_Old"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_ATS_INFO_Old"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_ATS_INFO_Old.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CARLISLE_AXM_GLASS"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CARLISLE_AXM_GLASS"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CARLISLE_AXM_GLASS.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CARLISLE_BREAKDOWN"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CARLISLE_BREAKDOWN"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CARLISLE_BREAKDOWN.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CARLISLE_EUORPECAR"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CARLISLE_EUORPECAR"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CARLISLE_EUORPECAR.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_1715_0900"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CLOSED_1715_0900"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CLOSED_1715_0900.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_1730_0830"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CLOSED_1730_0830"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CLOSED_1730_0830.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_FINANCE"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CLOSED_FINANCE"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CLOSED_FINANCE.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
# module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_HONDA_ACC"] will be created
+ resource "genesyscloud_architect_user_prompt" "prompts" {
+ id = (known after apply)
+ name = "XX_CLOSED_HONDA_ACC"
+ resources = [
+ {
+ file_content_hash = "9add50865a756688358388330540202a75b6edbeaf29eaf2030b4b305a43317b"
+ filename = "XX_CLOSED_HONDA_ACC.wav"
+ language = "en-us"
# (2 unchanged attributes hidden)
},
]
# (1 unchanged attribute hidden)
}
When i apply the plan, i have for each file the same error
│ Error: failed to upload user prompt resource 'XX_ATS_INFO_HOLD.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiMmFlMTQzOWItNzE2NS00MTVmLWFjNzktYWZiM2FkOTgwMGYyIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_ATS_INFO_HOLD"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_ATS_INFO_HOLD.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiMmFlMTQzOWItNzE2NS00MTVmLWFjNzktYWZiM2FkOTgwMGYyIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_ATS_INFO.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiY2M4OWRmNTItYjUzOC00ODk4LTlkNjEtMjc5NWNmMzY3MjAwIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_ATS_INFO"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_ATS_INFO.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiY2M4OWRmNTItYjUzOC00ODk4LTlkNjEtMjc5NWNmMzY3MjAwIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_ATS_INFO_Old.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiYTA0OWMzMjAtN2VhZC00YWU2LWFjNjktNzY5MGRiNDQyZTNiIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_ATS_INFO_Old"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_ATS_INFO_Old.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiYTA0OWMzMjAtN2VhZC00YWU2LWFjNjktNzY5MGRiNDQyZTNiIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CLOSED_1715_0900.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZjQ2MWFjZjktYWU0ZS00OGRmLWE1ZjItYWFiOTBjODIzZDEyIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_1715_0900"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CLOSED_1715_0900.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZjQ2MWFjZjktYWU0ZS00OGRmLWE1ZjItYWFiOTBjODIzZDEyIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CARLISLE_EUORPECAR.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZjQyZjNlMDAtYWIyNy00ZmFhLTk5ZjctMjQ0NDMxZjZmYzYyIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CARLISLE_EUORPECAR"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CARLISLE_EUORPECAR.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZjQyZjNlMDAtYWIyNy00ZmFhLTk5ZjctMjQ0NDMxZjZmYzYyIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CLOSED_1730_0830.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZTc4M2Q3NWUtZjJlNC00Y2M2LWI1ZTgtZDNlNzNiNzZkZjQ5IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_1730_0830"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CLOSED_1730_0830.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZTc4M2Q3NWUtZjJlNC00Y2M2LWI1ZTgtZDNlNzNiNzZkZjQ5IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CLOSED_FINANCE.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZjc4Njg0MjctYWJjZC00NzQ5LWE1MDMtYWFkMWYwZWY2ODMwIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_FINANCE"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CLOSED_FINANCE.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiZjc4Njg0MjctYWJjZC00NzQ5LWE1MDMtYWFkMWYwZWY2ODMwIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CARLISLE_BREAKDOWN.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiYjdjYTdlNmUtNzc2ZS00M2JhLWFhYTQtMGVhYTAwNTQ2ODY4IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CARLISLE_BREAKDOWN"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CARLISLE_BREAKDOWN.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiYjdjYTdlNmUtNzc2ZS00M2JhLWFhYTQtMGVhYTAwNTQ2ODY4IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CARLISLE_AXM_GLASS.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiMTZlZTNmZTEtY2NjMS00ZDNhLWFmZjUtNzk4MzU1N2VkMTE4IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CARLISLE_AXM_GLASS"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CARLISLE_AXM_GLASS.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiMTZlZTNmZTEtY2NjMS00ZDNhLWFmZjUtNzk4MzU1N2VkMTE4IiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
╵
╷
│ Error: failed to upload user prompt resource 'XX_CLOSED_HONDA_ACC.wav' to https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiNTI4NTQ5MjctMGI2My00N2FlLTlkMmItMTgwNmQ5NjkwZWZhIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9
│
│ with module.Create_Prompts.genesyscloud_architect_user_prompt.prompts["XX_CLOSED_HONDA_ACC"],
│ on ../Modules/Module_Create_Prompts/main.tf line 27, in resource "genesyscloud_architect_user_prompt" "prompts":
│ 27: resource "genesyscloud_architect_user_prompt" "prompts" {
│
│ {"resourceName":"genesyscloud_architect_user_prompt","errorMessage":"failed to upload user prompt resource 'XX_CLOSED_HONDA_ACC.wav' to
│ https://apps.mypurecloud.de/uploads/v2/ivr?additionalInfo=eyJvcmdhbml6YXRpb25JZCI6ImVmMjZiOWRmLTFlNTAtNDUyYy1iOTUwLTBmZTE4ZGVjN2YyNiIsInByb21wdElkIjoiNTI4NTQ5MjctMGI2My00N2FlLTlkMmItMTgwNmQ5NjkwZWZhIiwibGFuZ3VhZ2UiOiJlbi11cyIsImNhdGVnb3J5IjoidXNlciJ9"}
I already verify :
the rights on the files
to inject manually the file into my Genesys Cloud organisation
Hello,
When i am trying to inject the prompts using Terraform i have an issue concerning the uploading of the file.
Here is my code : terraform { required_providers { genesyscloud = { source = "mypurecloud/genesyscloud" version = "~> 1.0" } } }
When i plan to inject here is the return of Terraform :
When i apply the plan, i have for each file the same error
I already verify :
I must say i am a bit lost. Can you help me?
Thanks, Guillaume