Score:0

Cloudflare API token permission to edit terraform cloudflare_list resource

in flag

Recently I had an API Token that allowed me to access Terraform cloudflare_access_rule and cloudflare_list resources. That token expired, and to my surprise, it vanished from the UI, so I cannot see the configuration that was working before.

I managed to figure out that I need Account Firewall Access Rules:Edit for cloudflare_access_rule. But I still don't know what is needed for cloudflare_list. After trying many different permissions, I keep getting an error like this on terraform plan:

Error: error reading List with ID "vwn...": Authentication error (10000)

Could anyone tell me what permissions I need to add to the API Token to edit cloudflare_list resources with Terraform? And is there a better approach to find out what permissions are needed without trial and error?

One workaround was to use the Read all resources template with a new token, and that's fine for a terraform plan. But to actually make changes, I will need to know which permission to toggle from Read to Edit. I could of course, change all to Edit, or try the global API keys, but I prefer a more granular approach.

Score:2
vc flag

For cloudflare_list, it depends on:

  • single: Zone > Dynamic Redirect > Edit
  • bulk: Account > Account Rulesets > Edit and Account > Account Filter Lists > Edit
Nagev avatar
in flag
Thanks, tried both, still get the same error. Looking at the links provided, these don't seem to be the correct permissions, as I am not trying to do redirects.
Nagev avatar
in flag
Through a process of elimination I ended up with only: `All accounts - Account Filter Lists:Read, Account Firewall Access Rules:Edit`. Don't know why yours didn't work when I had tried, but seems like it should, so voting and accepting. Thanks.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.