Can anyone explain why the genesyscloud_security_phonenumber_data_export resource returns a 403 Forbidden error specifically for PII-enabled columns during the initial deployment phase? The IAM role assigned to the Terraform service account has security:phonenumber:read and security:phonenumber:write permissions, yet the plan fails when attempting to define pii_type as PHONE_NUMBER.
Background
We are migrating our contact center infrastructure from on-prem to Genesys Cloud in the ap-southeast-1 region. The deployment pipeline uses Terraform v1.7.4 with the genesyscloud provider v1.22.0. The goal is to automate the creation of secure phone number data exports for compliance auditing. The environment is a standard BYOC setup with strict PII masking enabled at the org level.
Issue
When applying the following HCL block:
resource "genesyscloud_security_phonenumber_data_export" "compliance_export" {
name = "Compliance Phone Export"
description = "Automated PII export for audit"
columns {
name = "Caller_Number"
pii_type = "PHONE_NUMBER"
enabled = true
}
schedule {
frequency = "DAILY"
time = "02:00"
}
}
The apply step fails with:
Error: PUT https://api.au.genesys.cloud/api/v2/security/phonenumberdataexports/... returned 403 Forbidden. Message: Insufficient permissions for PII field configuration.
Troubleshooting
- Verified the service account token has not expired.
- Checked
genesyscloud_orgsettings; PII detection is active. - Manually created the export via the Admin UI with the same role, which succeeded. This suggests a discrepancy in how the API handles PII field validation during resource creation versus UI submission.
- Tested with
pii_typeset toNONE, and the resource created successfully. The issue is isolated to PII-enabled columns.
Is there a specific API endpoint or additional permission required for programmatic PII column assignment that is not documented in the provider schema? The CLI tool genesys-cloud also fails with the same 403 error when pushing the JSON config directly.