aztfexport icon indicating copy to clipboard operation
aztfexport copied to clipboard

Documentation for creating `import.tf` is outdated, missing `--generate-import-block`

Open hterik opened this issue 1 year ago • 4 comments

https://learn.microsoft.com/en-us/azure/developer/terraform/azure-export-for-terraform/select-custom-resources#using-terraform-import-blocks contains faulty instructions for generating import.tf The page instructs to use the --generate-mapping-file but it is not working.

A new --generate-import-block was added in https://github.com/Azure/aztfexport/pull/516 and it appears to work better instead.

hterik avatar Oct 29 '24 18:10 hterik

@magodo to confirm we no longer generate import blocks through -g or --generate-mapping-file?

stemaMSFT avatar Oct 29 '24 21:10 stemaMSFT

@stemaMSFT Two options exist:

  • --generate-mapping-file / -g: This indicates to only generate the mapping file (aztfexportResourceMapping.json), but not do the following import/export tasks.
  • --generate-import-block: This will generate the import.tf along with the aztfexportResourceMapping.json.

So the document here needs to update.

magodo avatar Oct 30 '24 01:10 magodo

Got it. Can we also add a short form, i.e. --i for --generate-import-block?

stemaMSFT avatar Nov 01 '24 22:11 stemaMSFT

I'd suggest not to do it as -i as it is typically used for "input" in short. Also, it is not so necessary as this option is enabled by default, people will only use it if they want to disable that.

magodo avatar Nov 06 '24 07:11 magodo