CLI for manage cloudflare records by jsonnet

How to?

  • Install the CLI
go install
  • Configuration by those environment

    • CLOUDFLARE_API_TOKEN: token, get from cloudflare
    • ZONES_DIR: folder of zones, contains jsonnet files of records definition, default is ./zones
    • CAFE_CONFIRM: yes/no, apply to cf (default no, which just dry run)
  • RUN, example:

♺ duythinht[at]factory ♺ ~/workspace/ ♺  ❯
❯❯❯ CAFE_CONFIRM=yes go run cmd/cafe/main.go
Those records will be deleted:
ZONE        TYPE    TTL   NAME                    CONTENT   A       1   TXT     1      hello-world!

Those records will be created:
ZONE        TYPE    TTL   NAME                    CONTENT   A       1   TXT     1      ok-hello-world!
deleting   A       1
deleting   TXT     1      hello-world!...
creating   A       1 true
creating   TXT     1      ok-hello-world!... true

Why not terraform

Cause tf is too slow, it’s terrible.


View Github