| @@ -0,0 +1,24 @@ | |||
| 1 | + | # terraform | |
| 2 | + | ||
| 3 | + | ## importing cloudflare records | |
| 4 | + | ||
| 5 | + | * get record ID from Cloudflare API: | |
| 6 | + | ||
| 7 | + | ``` | |
| 8 | + | curl https://api.cloudflare.com/client/v4/zones/<zone_id>/dns_records?per_page=50&page=1 \ | |
| 9 | + | -H "X-Auth-Key:<api_key>" \ | |
| 10 | + | -H "X-Auth-Email:<account_email>" \ | |
| 11 | + | -H "Content-Type:application/json" \ | |
| 12 | + | | jq . | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | * create the resource declaration in the terraform manifest. | |
| 16 | + | * import the resource: | |
| 17 | + | ||
| 18 | + | `terraform import cloudflare_record.<resource_name> <zone_id>/<record_id>` | |
| 19 | + | ||
| 20 | + | * import resources created with `for_each`: | |
| 21 | + | ||
| 22 | + | ``` | |
| 23 | + | terraform import github_issue_label.issue_label[\"skip-verify-changelog\"] terraform-module-proxmox-container:skip-verify-changelog | |
| 24 | + | ``` | |
simon revised this gist 1 month ago · 5841b63
1 file changed, 24 insertions