Azure / aztfexport

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

Exporting Azure API Management service exports bare minimum #494

Open Radamonas opened 5 months ago

Radamonas commented 5 months ago

I tried to export one resource only or whole resource group, however I was not able to get a lot from already existing APIM setup we have in the cloud:

resource "azurerm_api_management" "res-0" {
  location            = "westeurope"
  name                = "name"
  publisher_email     = "email@email.com"
  publisher_name      = "ACME"
  resource_group_name = "rg-acme"
  sku_name            = "Developer_1"

  identity {
    type = "SystemAssigned"
  }
}

I was interested to get hostname_configuration at least, but this information was not extracted even when I was running whole resource group extract.

magodo commented 5 months ago

Hi @Radamonas, by default the tool will ignore "zero" values or O(ptional)+C(omputed) properties, since the goal of aztfexport is to generate valid configuration and pass terraform plan, otherwise, they might introduce other issues. If you really wants all the non-readonly properties to be exported, you can specify --full-properties flag.