Azure / aztfexport

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

PowerShell72 not supported for 'runbook_type' during terraform plan #504

Closed msetogecko closed 1 month ago

msetogecko commented 7 months ago

resource "azurerm_automation_runbook" "res-10164" { automation_account_name = "my_aa_account_name" content = "my_runbook_content" description = "my_runbook_description." location = "eastus2" log_activity_trace_level = 9 log_progress = false log_verbose = false name = "my_runbook_name" resource_group_name = "my_aa_rg_name" runbook_type = "PowerShell72" depends_on = [ azurerm_automation_account.res-13, ] }

Error:

Error: expected runbook_type to be one of ["Graph" "GraphPowerShell" "GraphPowerShellWorkflow" "PowerShell" "Python2" "Python3" "PowerShellWorkflow" "Script"], got PowerShell72

stemaMSFT commented 7 months ago

Hey @msetogecko, what version of the azurerm provider are you using? aztfexport defaults to exporting the latest version of azurerm which supports the PowerShell72 option, but if you're running on an older version of azurerm the PowerShell72 value is invalid for runbook_type.

magodo commented 7 months ago

@stemaMSFT The latest release of aztfexport pins to v3.77.0 of the provider (see https://github.com/Azure/aztfexport/releases/tag/v0.14.0). Whilst the PowerShell72 is supported in v3.86.0 (see https://github.com/hashicorp/terraform-provider-azurerm/pull/23980).

@msetogecko Before we create a new release to pin a newer provider version, you can use --provider-version option to select the provider version explicitly, e.g. use --provider-version v3.92.0 to pick the latest version (at this moment).

magodo commented 1 month ago

This should have been fixed in the latest release v0.14.2.