I am attempting to use a Vercel API token with the Vercel Terraform provider to provision a CNAME DNS record for a subdomain on a domain I own (pointing to a programmatically generated frontend project on DigitalOcean), but I am running into authentication errors. The token has the full scope of permissions for my account that manages the domain. I’ve provided the sample code below. It injects environment variables to be used in different fields, and these variables work properly in other Terraform code. Even when hardcoding those variables, the error persists. Does anyone know what the issue could be?
Current:
Error: Could not create DNS Record, unexpected error: forbidden - You don’t have permission to create the domain record.
Expected:
vercel_dns_record.cname: Creating…
vercel_dns_record.cname: Creation complete after 1s
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
resource "vercel_dns_record" "cname" {
domain = "endeavor.ai"
name = "${var.customer_name}-services"
type = "CNAME"
ttl = 60
value = "${replace(digitalocean_app.terraform-app-services.live_url, "https://", "")}." // Remove https://
}