Skip to content

Commit

Permalink
fix plan
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoseangel committed Mar 28, 2022
1 parent e99184d commit f31cfe1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 25 deletions.
10 changes: 3 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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, )

Expand Down
11 changes: 3 additions & 8 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
14 changes: 4 additions & 10 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" {
Expand Down

0 comments on commit f31cfe1

Please sign in to comment.