From f31cfe101af11f451814fdfa73c76337443d70c5 Mon Sep 17 00:00:00 2001 From: imjoseangel Date: Mon, 28 Mar 2022 11:47:12 +0200 Subject: [PATCH] fix plan --- main.tf | 10 +++------- outputs.tf | 11 +++-------- variables.tf | 14 ++++---------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/main.tf b/main.tf index 7116d0e..6d34da9 100644 --- a/main.tf +++ b/main.tf @@ -28,17 +28,13 @@ resource "azurerm_resource_group" "rg" { # App Service Plan Creation or selection #--------------------------------------------------------- -resource "azurerm_app_service_plan" "main" { +resource "azurerm_service_plan" "main" { name = format("%s-%s", var.prefix, lower(replace(var.name, "/[[:^alnum:]]/", ""))) location = local.location resource_group_name = local.resource_group_name - kind = var.kind - reserved = var.kind == "Windows" ? false : (var.kind == "Linux" ? true : var.reserved) + os_type = var.os_type + sku_name = var.sku_name - sku { - tier = var.tier - size = var.size - } tags = merge({ "ResourceName" = format("%s-%s", var.prefix, lower(replace(var.name, "/[[:^alnum:]]/", ""))) }, var.tags, ) diff --git a/outputs.tf b/outputs.tf index 93fec3f..708cb29 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,19 +1,14 @@ output "id" { description = "Id of the created App Service Plan" - value = azurerm_app_service_plan.main.id + value = azurerm_service_plan.main.id } output "name" { description = "Name of the created App Service Plan" - value = azurerm_app_service_plan.main.name + value = azurerm_service_plan.main.name } output "location" { description = "Azure location of the created App Service Plan" - value = azurerm_app_service_plan.main.location -} - -output "max_workers" { - description = "Maximum number of workers for the created App Service Plan" - value = azurerm_app_service_plan.main.maximum_number_of_workers + value = azurerm_service_plan.main.location } diff --git a/variables.tf b/variables.tf index f104f67..8004f77 100644 --- a/variables.tf +++ b/variables.tf @@ -23,7 +23,7 @@ variable "prefix" { default = "default" } -variable "kind" { +variable "os_type" { description = "The kind of the App Service Plan to create. See documentation https://www.terraform.io/docs/providers/azurerm/r/app_service_plan.html#kind" type = string default = "Windows" @@ -35,16 +35,10 @@ variable "reserved" { default = "false" } -variable "tier" { - description = "(Required) Specifies the plan's pricing tier." +variable "sku_name" { + description = "(Required) The SKU for the Plan." type = string - default = "Basic" -} - -variable "size" { - description = "(Required) Specifies the plan's instance size." - type = string - default = "B1" + default = "P1V3" } variable "tags" {