You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am logged in through Azure CLI and set the subscription, where I want to export the resources.
The Terraform version 3.77.0 has also the permission to execute: -rwxr-xr-x. 1 xxxx xxxx 252895232 Feb 9 13:52 terraform-provider-azurerm_v3.77.0_x5
To export the resource, I executed the following command:
[xxxxx@terraform-vm terraform-export]$ aztfexport query -n "resourceGroup =~ 'MY_RESOURCE_GROUP' and type contains 'Microsoft.DB'"
Error: Failed to import /subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/MY_RESOURCE_GROUP/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-db as azurerm_postgresql_flexible_server.res-0: exit status 1
Error: failed to read schema for azurerm_postgresql_flexible_server.res-0 in registry.terraform.io/hashicorp/azurerm: failed to instantiate provider "registry.terraform.io/hashicorp/azurerm" to obtain schema: fork/exec .terraform/providers/registry.terraform.io/hashicorp/azurerm/3.77.0/linux_amd64/terraform-provider-azurerm_v3.77.0_x5: permission denied
My user has the permission to read the resource group. I am able to get the whole list of 2637 items in that resource group through the following command: aztfexport resource-group MY_RESOURCE_GROUP
If I import a Azure resource through the command "terraform import", it works for me.
What could be the issue, that I can not export any Azure resource to Terraform?
The text was updated successfully, but these errors were encountered:
Ghostw4lk
changed the title
Failed to read schema for any resource
Failed to read schema for any Azure resource
Feb 9, 2024
Hey @Ghostw4lk are you able to export other resources, or is it not working for any resource? There's ways to configure what credentials you use in aztfexport, does the same error occur if you run with the flag --use-azure-cli-cred?
@Ghostw4lk The issue may cause by tmp is noexec on your OS. aztfexport under the hood will import the resources in parallel in the tmp dir. You can export TMPDIR to somewhere else to work around the issue. E.g. run export TMPDIR=~/tmp before running aztfexport to specify ~/tmp as the tmp dir.
Hi all,
I want to export a specific Azure resource (PostgreSQL Flexible Server) to Terraform.
The environment details are the following:
To export the resource, I executed the following command:
[xxxxx@terraform-vm terraform-export]$ aztfexport query -n "resourceGroup =~ 'MY_RESOURCE_GROUP' and type contains 'Microsoft.DB'"
Error: Failed to import /subscriptions/xxxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/MY_RESOURCE_GROUP/providers/Microsoft.DBforPostgreSQL/flexibleServers/test-db as azurerm_postgresql_flexible_server.res-0: exit status 1
Error: failed to read schema for azurerm_postgresql_flexible_server.res-0 in registry.terraform.io/hashicorp/azurerm: failed to instantiate provider "registry.terraform.io/hashicorp/azurerm" to obtain schema: fork/exec .terraform/providers/registry.terraform.io/hashicorp/azurerm/3.77.0/linux_amd64/terraform-provider-azurerm_v3.77.0_x5: permission denied
My user has the permission to read the resource group. I am able to get the whole list of 2637 items in that resource group through the following command: aztfexport resource-group MY_RESOURCE_GROUP
If I import a Azure resource through the command "terraform import", it works for me.
What could be the issue, that I can not export any Azure resource to Terraform?
The text was updated successfully, but these errors were encountered: