fix 101-web-app-linux-container example (#175)
This commit is contained in:
parent
20d8beea6d
commit
077374c7c6
@ -1,24 +1,23 @@
|
||||
|
||||
resource "azurerm_app_service_plan" "default" {
|
||||
name = "${var.name}-plan"
|
||||
location = "${azurerm_resource_group.default.location}"
|
||||
resource_group_name = "${azurerm_resource_group.default.name}"
|
||||
name = "${random_pet.prefix.id}-plan"
|
||||
location = azurerm_resource_group.default.location
|
||||
resource_group_name = azurerm_resource_group.default.name
|
||||
kind = "Linux"
|
||||
|
||||
# Reserved must be set to true for Linux App Service Plans
|
||||
reserved = true
|
||||
|
||||
sku {
|
||||
tier = "${var.plan_tier}"
|
||||
size = "${var.plan_sku}"
|
||||
tier = var.plan_tier
|
||||
size = var.plan_sku
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_app_service" "default" {
|
||||
name = "${var.dns_prefix}-${var.name}-${var.environment}-app"
|
||||
location = "${azurerm_resource_group.default.location}"
|
||||
resource_group_name = "${azurerm_resource_group.default.name}"
|
||||
app_service_plan_id = "${azurerm_app_service_plan.default.id}"
|
||||
resource "azurerm_app_service" "main" {
|
||||
name = "${var.dns_prefix}-${random_pet.prefix.id}-${var.environment}-app"
|
||||
location = azurerm_resource_group.default.location
|
||||
resource_group_name = azurerm_resource_group.default.name
|
||||
app_service_plan_id = azurerm_app_service_plan.default.id
|
||||
|
||||
site_config {
|
||||
always_on = true
|
||||
|
@ -1,8 +1,9 @@
|
||||
provider "azurerm" {
|
||||
version = "=1.36.0"
|
||||
resource "azurerm_resource_group" "default" {
|
||||
name = "${random_pet.prefix.id}-${var.environment}-rg"
|
||||
location = var.location
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "default" {
|
||||
name = "${var.name}-${var.environment}-rg"
|
||||
location = "${var.location}"
|
||||
}
|
||||
resource "random_pet" "prefix" {
|
||||
prefix = var.prefix
|
||||
length = 2
|
||||
}
|
18
quickstart/101-web-app-linux-container/providers.tf
Normal file
18
quickstart/101-web-app-linux-container/providers.tf
Normal file
@ -0,0 +1,18 @@
|
||||
terraform {
|
||||
required_version = ">= 1.0"
|
||||
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = ">= 3.0, < 4.0"
|
||||
}
|
||||
random = {
|
||||
source = "hashicorp/random"
|
||||
version = ">= 3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
@ -1,35 +1,35 @@
|
||||
variable "name" {
|
||||
type = "string"
|
||||
description = "Location of the azure resource group."
|
||||
default = "demo-tfquickstart"
|
||||
variable "prefix" {
|
||||
type = string
|
||||
default = "web-app-linux-container"
|
||||
description = "Prefix of the resource name"
|
||||
}
|
||||
|
||||
variable "environment" {
|
||||
type = "string"
|
||||
type = string
|
||||
description = "Name of the deployment environment"
|
||||
default = "dev"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
type = "string"
|
||||
type = string
|
||||
description = "Location to deploy the resource group"
|
||||
default = "West US 2"
|
||||
default = "eastus"
|
||||
}
|
||||
|
||||
variable "dns_prefix" {
|
||||
type = "string"
|
||||
type = string
|
||||
description = "A prefix for any dns based resources"
|
||||
default = "tfq"
|
||||
}
|
||||
|
||||
variable "plan_tier" {
|
||||
type = "string"
|
||||
type = string
|
||||
description = "The tier of app service plan to create"
|
||||
default = "Standard"
|
||||
}
|
||||
|
||||
variable "plan_sku" {
|
||||
type = "string"
|
||||
type = string
|
||||
description = "The sku of app service plan to create"
|
||||
default = "S1"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user