Terraform import - resource IDs missing - how to get these?

For Workers & Pages, what is the name of the domain?

com

What is the error message?

missing ID for importing resources

What is the issue or error you’re encountering

when trying to import all the configurations from UI I can’t get all of the IDs for all of the resources I’m working on.

What steps have you taken to resolve the issue?

  1. create ip_list in general configuraiton page
    try to import it for
    cloudflare_list
    cloudflare_list_item

list id is that long - a8f634b2333343778c3334478bac29d8 - can’t find it via UI
for item -
terraform import cloudflare_list_item.example <account_id>/<list_id>/<item_id>
the same story id for individual ITEM is not presented anywhere in UI

small update on this question

I found and tested this cool tool cf-terraforming
which supposed to answer all my question and solve the above however
it seems its not ready for terraform version 5

when I run it against terraform Cloudflare provider version 4 I get all the records for one example resource type

but when I upgrade the provider version to 5.3.0

cf-terraforming generate --resource-type Cloudflare_record … returns nothing
and
cf-terraforming import --resource type … (the rest the same) returns the following

FATA[0001] failed to fetch API endpoint: GET “https://api.cloudflare.com/client/v4/”: 400 Bad Request {“success”:false,“errors”:[{“code”:7000,“message”:“No route for that URI”}],“messages”:,“result”:null}

I assume this v4 is for provider v4.x but even this generic curl call to test token
curl “https://api.cloudflare.com/client/v4/user/tokens/verify” -working fine
but switching to v5 - doesn’t work

any suggestions here more than welcome

ok - my bad - I was using old resource-type

problem solved - I must say the tool is really cool but one thing is problematic to me

I can generate cloudflare_dns_records by providing zone id
I can generate generic cloudflare_list entries by providing -a (account id)

what is needed to generate cloudflare_list_item ???

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.