This tool is used to migrate resources between terraform azapi
provider and azurerm
provider.
PS C:\Users\henglu\go\src\github.com\Azure\aztfmigrate> aztfmigrate.exe
Usage: aztfmigrate [--version] [--help] <command> [<args>]
Available commands are:
migrate Migrate azapi resources to azurerm resources in current working directory
plan Show terraform resources which can be migrated to azurerm or azapi resources in current working directory
version Displays the version of the migration tool
aztfmigrate plan -to=azurerm
under your terraform working directory,azapi
provider to azurerm
provider.aztfmigrate.ignore
will be ignored during migration.2022/01/25 14:34:46 [INFO] searching azapi_resource & azapi_update_resource...
2022/01/25 14:34:55 [INFO]
The tool will perform the following actions:
The following resources will be migrated:
azapi_resource.test2 will be replaced with azurerm_automation_account
azapi_update_resource.test will be replaced with azurerm_automation_account
The following resources can't be migrated:
azapi_resource.test: input properties not supported: [], output properties not supported: [identity.principalId, identity.type, identity.tenantId]
The following resources will be ignored in migration:
aztfmigrate migrate -to=azurerm
under your terraform working directory,azapi
provider to azurerm
provider,aztfmigrate.ignore
will be ignored during migration.There're some examples to show the migration results.
Precompiled binaries and Window MSI are available at Releases.
For Mac OS users, you need to run the following command to remove the quarantine flag.
xattr -d com.apple.quarantine aztfmigrate
Supported versions:
Import the Microsoft repository key:
rpm --import https://packages.microsoft.com/keys/microsoft.asc
Add packages-microsoft-com-prod
repository:
ver=8 # or 9
dnf install -y https://packages.microsoft.com/config/rhel/${ver}/packages-microsoft-prod.rpm
Install:
dnf install aztfmigrate
Supported versions:
Import the Microsoft repository key:
curl -sSL https://packages.microsoft.com/keys/microsoft.asc > /etc/apt/trusted.gpg.d/microsoft.asc
Add packages-microsoft-com-prod
repository:
ver=20.04 # or 22.04
apt-add-repository https://packages.microsoft.com/ubuntu/${ver}/prod
Install:
apt-get install aztfmigrate
yay -S aztfmigrate
azapi_resource
migrationazapi_update_resource
migrationfor_each
count
depends_on
, lifecycle
and provisioner
azurerm
resource match for the resource idazurerm
provider's property coverageaztfmigrate.ignore
azapi_resource
migration.dynamic
can't be migrated.AZTF_MIGRATE_SKIP_COVERAGE_CHECK = true
We wish to thank HashiCorp for the use of some MPLv2-licensed code from their open source project terraform-plugin-sdk.