Skip to content

Instantly share code, notes, and snippets.

@mvasilenko
Created June 24, 2021 15:21
Show Gist options
  • Save mvasilenko/5448a9f7b86bbf7bfe4d784a4ff42544 to your computer and use it in GitHub Desktop.
Save mvasilenko/5448a9f7b86bbf7bfe4d784a4ff42544 to your computer and use it in GitHub Desktop.
# for importing cloudflare hosted dns zones into terraform
# list zones
curl -s -X GET "https://api.cloudflare.com/client/v4/zones/?per_page=100" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name)"'
# list records at the zone 1234567890
curl -X GET "https://api.cloudflare.com/client/v4/zones/1234567890/dns_records?per_page=100" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json"| jq -r '.result[] | "\(.id) \(.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment