403 Authentication error when creating DNS records
When creating DNS records using Terraform, the API returns the following error:
Error: failed to create DNS record: HTTP status 403: Authentication error (10000)
This is caused by an error in your code syntax, when you are not using index [0] for the zones. Find an example below and a more detailed thread on GitHub ↗.
Instead of this:
zone_id = data.cloudflare_zones.example_com.idUse this:
zone_id = data.cloudflare_zones.example_com.zones[0].id`Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2026 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-