- Terraform Version: 1.7.4
- Provider:
genesyscloudv1.15.0 - Environment: Genesys Cloud (US1)
- Tracing: OpenTelemetry Python SDK 1.21.0
What is the correct way to import existing Genesys Cloud resources into Terraform state when integrating with an OpenTelemetry-traced deployment pipeline?
I am attempting to import an existing routing.queue resource into my Terraform state file to begin managing it via Infrastructure as Code. The goal is to ensure that the import operation itself is captured within our distributed tracing context. Currently, I am using the terraform import command, but I need to correlate this action with the surrounding CI/CD pipeline spans.
When I run the following command:
terraform import routing.queue.my_support_queue 12345678-abcd-1234-efgh-567890123456
The import succeeds, but the subsequent terraform plan shows unexpected diffs in the outbound_call and skill_requirements blocks. I suspect this is due to the provider fetching the resource state via the /api/v2/routing/queues/{id} endpoint without preserving the original configuration nuances present in the Terraform file.
Here is the relevant resource block:
resource "genesyscloud_routing_queue" "my_support_queue" {
name = "Support Queue"
description = "Imported for IaC management"
skill_requirements {
skill_id = "skill-123"
level = 5
}
}
I have tried adding custom headers to the provider configuration to pass trace context, but the genesyscloud provider does not seem to support arbitrary header injection for the import operation. Is there a way to programmatically trigger the import via the Terraform CLI or SDK while ensuring the trace ID from our OpenTelemetry context is propagated? I want to avoid manual state edits and ensure full observability of the state synchronization process. Any insights on handling the state diff issues post-import would also be appreciated.