Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected parameter type when processing output from Azure Managed Application #13427

Closed
oWretch opened this issue Sep 20, 2021 · 2 comments · Fixed by #21541
Closed

Unexpected parameter type when processing output from Azure Managed Application #13427

oWretch opened this issue Sep 20, 2021 · 2 comments · Fixed by #21541

Comments

@oWretch
Copy link
Contributor

oWretch commented Sep 20, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v1.0.7
on darwin_arm64

  • provider registry.terraform.io/hashicorp/azuread v2.3.0
  • provider registry.terraform.io/hashicorp/azurerm v2.77.0

Affected Resource(s)

  • azurerm_managed_application

Terraform Configuration Files

resource "azurerm_managed_application" "vmx" {
  name                = "meraki-vmx"
  location            = azurerm_resource_group.vmx.location
  resource_group_name = azurerm_resource_group.vmx.name
  kind                = "MarketPlace"
  managed_resource_group_name = "meraki-vmx-managed"

  plan {
    name      = "cisco-meraki-vmx"
    product   = "cisco-meraki-vmx"
    publisher = "cisco"
    version   = "15.37.0"
  }

  parameters = {
    location                    = azurerm_resource_group.vmx.location
    vmName                      = "meraki-vmx"
    virtualMachineSize          = "Standard_F4s_v2"
    merakiAuthToken             = "authtoken"
    zone                        = 0
    virtualNetworkNewOrExisting = "existing"
    virtualNetworkName          = data.azurerm_virtual_network.vnet.name
    virtualNetworkResourceGroup = data.azurerm_virtual_network.vnet.resource_group_name
    virtualNetworkAddressPrefix = data.azurerm_virtual_network.vnet.address_space[0]
    subnetName                  = data.azurerm_subnet.subnet.name
    subnetAddressPrefix         = data.azurerm_subnet.subnet.address_prefix
  }

  depends_on = [azurerm_marketplace_agreement.vmx]
}

resource "azurerm_marketplace_agreement" "vmx" {
  publisher = "cisco"
  offer     = "cisco-meraki-vmx"
  plan      = "cisco-meraki-vmx"
}

resource "azurerm_resource_group" "vmx" {
  name     = "meraki-vmx"
  location = "Australia Southeast"
}

Debug Output

Debug log from running terraform import on the resource.
https://gist.github.com/oWretch/2aacd66e306083a8cb02e5f8e50a3a22

Expected Behaviour

The resource creation should have completed and filled in the state information correctly. Subsequent terraform runs should read the state information from the resource and compare with the state file successfully.

Actual Behaviour

Terraform errors with Error: unexpected parameter type map[string]interface {} when reading the state of the application. Full error message:

│ Error: unexpected parameter type map[string]interface {}
│
│   with azurerm_managed_application.vmx,
│   on vmx.tf line 2, in resource "azurerm_managed_application" "vmx":
│    2: resource "azurerm_managed_application" "vmx" {

This error occurs in multiple regions.

Steps to Reproduce

This issue occurs on creation of resource (via terraform apply), on plan or application of a subsequent run after the provisioning is complete, or when importing the resource into the state file.

@jakubpech
Copy link
Contributor

We have the same issue when deploying the VMware SD-WAN in vWAN Network Virtual Appliance.

Behavior:

  1. Terraform apply does the API call to create a resource
  2. It starts to poll the operationStatus of the created resource
  3. Once {"status":"Succeeded"} is returned provider does the API call
    GET /subscriptions/<subscription_id>/resourceGroups/<rg_name>/providers/Microsoft.Solutions/applications/<app_name>?api-version=2019-07-01
  4. API returns the JSON (azure_vwan_nva_debug.txt) and provider crashes with message
    Error: unexpected parameter type map[string]interface {}

Copy link

github-actions bot commented May 8, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.