Azure / aztfexport

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

Error: flattening 'secret': expected a Customer Certificate Parameter #483

Closed OnurErgin closed 11 months ago

OnurErgin commented 11 months ago

Hi! I'm trying to export two Frontdoor resources and in both I receive the following error exporting a secret. I see that the error is about the certificates, but I can't make sense of this output. The certificates must have been automatically generated by Frontdoor, we do not use our own certificates. How should I proceed from here?

  Microsoft Azure Export for Terraform 

  /subscriptions/6fffffff-3333-9999-bbbb-555555555555/resourceGroups/Network-administration-gwc/providers/Microsoft.Cdn/profiles/fd-fffffffff-global/secrets/01c2bbcb-51ba-4317-a28d-7829d3b35e2f-fffffff

  exit status 1                                                        

  Error: flattening 'secret': expected a Customer Certificate Parameter

show recommendation does not respond either.

magodo commented 11 months ago

@OnurErgin The error is raised from the provider: https://github.com/hashicorp/terraform-provider-azurerm/blob/32908392587ee65642e34c24c4cb6f253979c921/internal/services/cdn/cdn_frontdoor_secret_resource.go#L236-L239. As you have mentioned, this is not a customer certificate, which indicates its built-in certificate, and is managed by the cdn profile. You shall just skip these resources from being exported.