Terraform-provider-cloudflare: Support use of API tokens (in public beta) in addition to API Keys

Created on 18 Jul 2019  路  3Comments  路  Source: cloudflare/terraform-provider-cloudflare

Cloudflare has very recently made API tokens available as a public beta. These are different than the previously available API keys, and allow more granular access to the Cloudflare API endpoints, e.g. to only certain websites controlled by an account, or to only certain functionality such as cache-purge.

API tokens follow the following format which is different than the one for API keys: Authorization: Bearer <token>

API documentation: https://api.cloudflare.com/#getting-started-requests

These are configurable at https://dash.cloudflare.com/profile/api-tokens :

Screenshot 2019-07-18 at 11 02 33 PM

Furthermore, adding support for API token will also mean that the previously misnamed token in the Terraform Cloudflare provider should be corrected to key instead:

Screenshot 2019-07-18 at 11 09 45 PM

Most helpful comment

Thanks for this one! The foundations for this have already been merged into cloudflare-go via cloudflare/cloudflare-go#326 and the discussion on the naming collision have been started at #417. We鈥檝e been running the closed beta for some time internally so once the naming is ironed out, I鈥檒l push up that change from our fork and we鈥檒l have support.

All 3 comments

Thanks for this one! The foundations for this have already been merged into cloudflare-go via cloudflare/cloudflare-go#326 and the discussion on the naming collision have been started at #417. We鈥檝e been running the closed beta for some time internally so once the naming is ironed out, I鈥檒l push up that change from our fork and we鈥檒l have support.

Any movement on this?

Added in #450, but we'll keep the old name for API Key for backwards compatibility. We'll do a proper cleanup in next major release.

Was this page helpful?
0 / 5 - 0 ratings