Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mat1g3r/cloudflare-ddns
Use terraform to update your cloudflare DNS records
https://github.com/mat1g3r/cloudflare-ddns
cloudflare ddns dns dynamic-dns terraform
Last synced: 23 days ago
JSON representation
Use terraform to update your cloudflare DNS records
- Host: GitHub
- URL: https://github.com/mat1g3r/cloudflare-ddns
- Owner: MaT1g3R
- License: apache-2.0
- Created: 2019-07-22T03:43:35.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-22T22:39:25.000Z (over 5 years ago)
- Last Synced: 2024-11-22T18:23:36.834Z (3 months ago)
- Topics: cloudflare, ddns, dns, dynamic-dns, terraform
- Language: HCL
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare DDNS
Use terraform to manage your cloudflare DNS records.
## Setup
- Install terraform (Download the latest release and drop it in your $PATH): https://www.terraform.io/downloads.html
## Usage
### Initial Run
You will need to run this once by hand before you can use a cron job
```shell
git clone [email protected]:MaT1g3R/cloudflare-ddns.git
cd cloudflare-ddns
cp variables.example.json variables.json
vim variables.json # Edit the variables
terraform init
# You might run into an error in the apply step saying record already exist.
# You can delete all of your existing DNS records and let terraform to create them.
# You can also try to import the existing records into your tfstate if you are adventurous.
# https://www.terraform.io/docs/import/index.html
terraform apply -var external_ip=$(./scripts/get-external-ip) -var-file=variables.json
```### Cronjob
Example crontab entry (update ip every 30 minutes),
note the `-input=false` is required to skip interactive approval of plan before applying.
```cron
*/30 * * * * cd /home/me/terraform-cloudflare && /usr/local/bin/terraform apply -input=false -var external_ip=$(./scripts/get-external-ip) -var-file variables.json
```