HuaweiCloud → Terraform Importer

Bulk generate HCL import blocks from RMS API responses

How to use

  1. Go to HuaweiCloud API Explorer
  2. Authenticate and call the ListAllResources API.
  3. Copy the full JSON response body.
  4. Paste it into the textarea below or upload the saved .json file.
  5. Click "Parse Resources" to see the list.
  6. Select the resources you want to import.
  7. Click "Generate Import Blocks".
  8. Copy the generated code into a .tf file and run:
    terraform plan -generate-config-out="generated.tf"

HCL IMPORT BLOCK TEMPLATE:

import {
  to = <resource_type>.<your_resource_name>
  id = "<resource_id>"
}

HCL IMPORT BLOCK EXAMPLE:

# Import the existing ECS instance

import {
  to = huaweicloud_compute_instance.ecs_69ef_8511
  id = "7e2fa39b-e06e-43bc-ac9f-037af822e5bc"
}

Resource Explorer

0 resources selected
Providers:
Regions:
Name Type Provider Region Resource ID
Import_Blocks.tf
$ terraform plan -generate-config-out="generated.tf"