Documentation for creating `import.tf` is outdated, missing `--generate-import-block`
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.
@magodo to confirm we no longer generate import blocks through -g or --generate-mapping-file?
@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.
Got it. Can we also add a short form, i.e. --i for --generate-import-block?
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.