Terraform 403 Forbidden on Genesys Cloud Data Connector Resource

Could use a hand troubleshooting this deployment failure in our CI/CD pipeline.

Context:
Running Terraform v1.7.4 with Genesys Cloud Provider v1.92.0. Environment is Prod (US East). The goal is to automate the creation of a Data Connector for AWS S3 to ingest call recordings for compliance archiving. The GitHub Actions workflow uses a service account with admin:admin and analytics:report:export scopes.

The deployment succeeds for the initial configuration but fails when applying the specific S3 bucket permissions via the genesyscloud_data_connector resource. The state file shows the resource was created, but the subsequent apply step throws a 403 error.

Error snippet:

Error: Error updating Data Connector "compliance-s3-connector": PUT https://api.mypurecloud.com/api/v2/analytics/dataconnectors/abc-123: 403 Forbidden
Response body: {"message":"Insufficient permissions to modify connector configuration"}

I have verified the OAuth token validity using genesyscloud auth login and the token is active. The service account has integration:integration:admin role. Interestingly, creating the same connector manually via the UI works without issue. The Terraform plan shows no changes to the type or destination fields, only a drift in the config JSON structure related to the S3 IAM role ARN.

HCL snippet:

resource "genesyscloud_data_connector" "s3_compliance" {
 enabled = true
 name = "compliance-s3-connector"
 type = "S3"
 
 config = jsonencode({
 bucketName = "my-bpo-archives"
 region = "us-east-1"
 roleArn = "arn:aws:iam::123456789:role/gc-integration-role"
 })
}

Question:
Is there a known limitation with the genesyscloud_data_connector resource regarding IAM role validation during the apply phase? Or does the provider require an additional scope like data:connector:write that is not documented? The 403 seems to originate from the backend API rather than the CLI itself.

You need to verify that the service account used in Terraform has the specific integrations:connector:write permission, as generic admin scopes often do not grant the necessary write access for creating external data connectors in Genesys Cloud. The 403 error typically indicates that the API token lacks the precise scope required for the resource type, even if the account has broad administrative privileges.

# Ensure the service account has the correct role assignment
resource "genesyscloud_auth_role_assignment" "connector_admin" {
 user_id = genesyscloud_user.service_account.id
 role_id = "76d91802-d58e-4864-9e8b-1735460870d8" # Example: Integration Admin Role ID
}

# Verify the provider configuration uses the correct service account credentials
provider "genesyscloud" {
 username = var.service_account_username
 password = var.service_account_password
 base_url = "https://api.us-east-1.genesys.cloud"
}

# The connector resource itself
resource "genesyscloud_integration_connector_s3" "call_recordings" {
 name = "Compliance Archive S3"
 description = "S3 Connector for Legal Hold Recordings"
 
 configuration {
 bucket_name = var.s3_bucket_name
 region = "us-east-1"
 }
}

Check the role assignments in the Genesys Cloud UI to confirm the service account is explicitly linked to a role that includes integration management permissions.