我正在尝试在我的帐户中创建 A 记录。我正在使用下面提到的代码(更改了敏感数据):
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "4.20.0"
}
}
}
provider "cloudflare" {
# Cloudflare API credentials configuration
api_token = "YE9d0KcX97OspLySwYLC475Sx42DPlfBEU_3FjqU"
}
data "cloudflare_record" "www"{
zone_id = "1fa42c8d2132a9ddaf714f9e7c920711"
hostname = "sidharthvijayakumar.fun"
type = "A"
}
当我在此 main.tf 文件上运行 terraform apply 时,出现错误:
Error: error listing DNS records: Authentication error (10000) with data.cloudflare_record.www, │ on main.tf line 15, in data "cloudflare_record" "www": │ 15: data "cloudflare_record" "www"{
我已经提到了这个问题stackover流程参考,但我无法弄清楚我的api_token需要的确切权限是什么Cloudflare文档。有人可以帮助我吗?
我尝试创建一个具有 DNS 读取权限的 api_token: