Azure / aztfexport

A tool to bring existing Azure resources under Terraform's management
https://azure.github.io/aztfexport/
Mozilla Public License 2.0
1.58k stars 180 forks source link

Remote state #117

Closed pcg-abrown closed 2 years ago

pcg-abrown commented 2 years ago

If running terrafy with remote state, and you run multiple times on different resource groups, will terrafy overwrite the remote state file, or append?

magodo commented 2 years ago

@pcg-abrown It will append to the remote state you specified, which means if there is a conflict for the resource address, the import will fail.

pcg-abrown commented 2 years ago

thanks - do you know if the backend storage account needs to be in the same subscription as the resources being imported? If not, how do you get it there?

magodo commented 2 years ago

Not necessary. You can follow the README to see how to specify the backend configs. If you want to specify the remote backend that is in different subscription/tenant, you can specify the subscription_id and tenant_id as is mentioned in https://www.terraform.io/language/settings/backends/azurerm#subscription_id

magodo commented 2 years ago

Close this issue for now as remote state is already supported. Please feel free to reopen it if you still have questions.