Listing token permission groups via Terraform

Is it possible to use cloudflare_api_token_permission_groups_list data source in Terraform with an account API token? The account API token in question has API Tokens:Edit but still getting GET "https://api.cloudflare.com/client/v4/user/tokens/permission_groups": 403 Forbidden {"success":false,"errors":[{"code":9109,"message":"Valid user-level authentication not found"}],"messages":[],"result":null} Given the /user/ in the URL, does this mean it only works with the old user API tokens? if so, does that mean I have to hardcode permission IDs?
1 Reply
SuperHelpflare
Support AI
According to the documentation, the error message you're encountering is related to the type of API token being used. The URL /user/ in the error message suggests that the API endpoint is expecting a user-level authentication, which is not compatible with account API tokens. As stated in the API token permissions documentation, the cloudflare_api_token_permission_groups_list data source is likely designed to work with user API tokens, not account API tokens. Unfortunately, this means that you may need to use user API tokens or hardcode permission IDs if you're using account API tokens. However, I recommend verifying this information with the Terraform Cloudflare provider documentation for the most up-to-date information on using API tokens with Terraform. Source: https://developers.cloudflare.com/fundamentals/api/troubleshooting/
Feedback
Feedback has been submitted! Thank you :)
This is an AI generated response, it may not be 100% accurate. Please validate the output. You can ask followups by replying to this message or mentioning me.

Did you find this page helpful?