Cloudflare + Steampipe
Query your Cloudflare infrastructure including zones, DNS records, accounts and more.
Installation
Download and install the latest Cloudflare plugin:
steampipe plugin install cloudflare
Configuration
Connection configurations are defined using HCL in one or more Steampipe config files. Steampipe will load ALL configuration files from ~/.steampipe/config
that have a .spc
extension. A config file may contain multiple connections.
Installing the latest cloudflare plugin will create a connection file (~/.steampipe/config/cloudflare.spc
) with a single connection named cloudflare
. You must modify this connection to include your personal credentials.
An API Token is the recommended way to set credentials. Read scope is required (write is not):
connection "cloudflare" { plugin = "cloudflare" token = "psth3GX0qHavRYE-hd5y7_iL7piII6C8jR3FOuW3"}
It's also valid to use an email and API key:
connection "cloudflare" { plugin = "cloudflare" email = "pam@dundermifflin.com" api_key = "2980b99351d629a537f1440e12b5b97a135b7"}
Credentials are resolved in this order:
token
in Steampipe config.email
andapi_key
in Steampipe config.CLOUDFLARE_API_TOKEN
environment variable (like Terraform).CLOUDFLARE_EMAIL
andCLOUDFLARE_API_KEY
environment variables (like Terraform).CF_API_TOKEN
environment variable (like flarectl).CF_API_EMAIL
andCF_API_KEY
environment variables (like flarectl).
For example:
connection "cloudflare" { plugin = "cloudflare" token = "9wZVRX3j9Z1CiE38HcmThwkb2hThisIsAFakeToken"}
Scope
A Cloudflare connection is scoped to a single Cloudflare account, with a single set of credentials.
Get involved
- Open source: https://github.com/turbot/steampipe-plugin-cloudflare
- Community: Slack Channel