Home > Enterprise >  Terrafomr Azurem throwing An argument named "java_version" is not expected here
Terrafomr Azurem throwing An argument named "java_version" is not expected here

Time:07-01

I am currently using Azurem version 2.7.0, when adding java_version in site config getting following error

An argument named "java_version" is not expected here.

Saw that it was fixed here

My sample script. Am I missing something?

resource "azurerm_function_app" "func_app" {
  name                 = var.function_app_name
  location             = var.location
  resource_group_name  = var.resource_group_name
  app_service_plan_id  = azurerm_app_service_plan.plan.id
  storage_connection_string = data.azurerm_key_vault_secret.storage_account_connection_string.value
  https_only = var.https_only
  app_settings = local.app_settings
  site_config {
    always_on         = var.always_on
    min_tls_version   = var.min_tls_version
    ftps_state        = "FtpsOnly"
    http2_enabled     = true
    java_version      = "11"
  }
  lifecycle {
    ignore_changes = [
      app_settings["WEBSITE_RUN_FROM_PACKAGE"]
    ]
  }

  identity {
    type = var.identity_type
  }

  tags = var.env_tags

  version = var.app_version

}

CodePudding user response:

As you can view in the list of enhancements for the version 2.57.0 changelog, you will need to upgrade from 2.7.0 to >= 2.57.0 for the azurerm provider for support for that argument in the azurerm_function_app resource.

  • Related