Terraform Azure App Service Plan Error - The parameter SKU.Name has an invalid value

Module declaration

resource "azurerm_app_service_plan" "appserviceplan" {
  name                = var.name
  location            = var.location
  resource_group_name = var.resource_group_name
  kind                = var.kind
  reserved            = var.reserved
  is_xenon            = var.is_xenon

  sku {
    # name = var.sku_name
    tier = var.sku_tier
    size = var.sku_tier
  }
}

Calling the above module like so (in main.tf) ...

module "appserviceplan1" {
  source = "../modules/app_service_plan"

  name                = "${var.project_name}-${var.environment}-appserviceplan"
  location            = var.location
  resource_group_name = var.resource_group_name
  kind                = var.asp_kind
  reserved            = var.asp_reserved
  is_xenon            = var.asp_is_xenon
  # sku_name            = var.asp_sku_name
  sku_tier = var.asp_sku_tier
  sku_size = var.asp_sku_tier
}

Input variable assignment (in main.auto.tfvars):

# Variable assignment for App Service Plan
asp_kind = "xenon"
# Recommended value is false
# Ref: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_service_plan
asp_reserved = false
asp_is_xenon = true
# asp_sku_name = "P3"
asp_sku_tier = "PremiumV3"
asp_sku_size = "P3v3"

Getting the following error with terraform apply:

Error: Error creating/updating App Service Plan "xyz-sandbox-appserviceplan" (Resource Group "abc-sandbox-xyz-cc-rg"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="BadRequest" Message="The parameter SKU.Name has an invalid value." Details=[{"Message":"The parameter SKU.Name has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"The parameter SKU.Name has an invalid value.","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["SKU.Name"]}}]

I have been spinning on this for hours now. Any help would be greatly appreciated!



from Recent Questions - Stack Overflow https://ift.tt/3y2PIUd
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation