зеркало из https://github.com/microsoft/cobalt.git
Added service plan terraform templates to Azure
This commit is contained in:
Родитель
8ee4eaabe1
Коммит
c0ffe0f8f8
|
@ -0,0 +1,38 @@
|
|||
# Module Azure App Service Plan
|
||||
|
||||
In App Service, an app runs in an App Service plan. An App Service plan defines a set of compute resources for a web app to run. These compute resources are analogous to the server farm in conventional web hosting. One or more apps can be configured to run on the same computing resources.
|
||||
|
||||
This is a terraform module in Cobalt to provide an App Service Plan with the following characteristics:
|
||||
|
||||
- Ability to specify resource group name in which the App Service Plan is deployed.
|
||||
- Ability to specify resource group location in which the App Service Plan is deployed.
|
||||
- Specify App Service Plan name, tier, size and kind of API manager to deploy
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
variable "resource_group_name" {
|
||||
default = "cblt-svcplan-rg"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
default = "eastus"
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "svcplan" {
|
||||
name = "${var.resource_group_name}"
|
||||
location = "${var.resource_group_location}"
|
||||
}
|
||||
|
||||
resource "azurerm_app_service_plan" "svcplan" {
|
||||
name = "${var.svcplan_name}"
|
||||
location = "${azurerm_resource_group.svcplan.location}"
|
||||
resource_group_name = "${azurerm_resource_group.svcplan.name}"
|
||||
kind = "${var.svcplan_kind}"
|
||||
|
||||
sku {
|
||||
tier = "${var.svcplan_tier}"
|
||||
size = "${var.svcplan_size}"
|
||||
}
|
||||
}
|
||||
```
|
|
@ -0,0 +1,16 @@
|
|||
resource "azurerm_resource_group" "svcplan" {
|
||||
name = "${var.resource_group_name}"
|
||||
location = "${var.resource_group_location}"
|
||||
}
|
||||
|
||||
resource "azurerm_app_service_plan" "svcplan" {
|
||||
name = "${var.svcplan_name}"
|
||||
location = "${azurerm_resource_group.svcplan.location}"
|
||||
resource_group_name = "${azurerm_resource_group.svcplan.name}"
|
||||
kind = "${var.svcplan_kind}"
|
||||
|
||||
sku {
|
||||
tier = "${var.svcplan_tier}"
|
||||
size = "${var.svcplan_size}"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
output "svc_plan_name" {
|
||||
description = "The name of the service plan created"
|
||||
value = "${azurerm_app_service_plan.svcplan.name}"
|
||||
}
|
||||
|
||||
output "svc_plan_kind" {
|
||||
description = "The kind of service plan created"
|
||||
value = "${azurerm_app_service_plan.svcplan.kind}"
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
variable "resource_group_name" {
|
||||
description = "Resource group name that the service plan will be created in."
|
||||
default = "cblt-svcplan-rg"
|
||||
}
|
||||
|
||||
variable "resource_group_location" {
|
||||
description = "Default resource group location that the resource group will be created in. The full list of Azure regions can be found at https://azure.microsoft.com/regions"
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "svcplan_name" {
|
||||
description = "The name of the servie plan to be created"
|
||||
default = "cblt-svcplan"
|
||||
}
|
||||
variable "svcplan_tier" {
|
||||
description = "The tier under which the service plan is created. Details can be found at https://docs.microsoft.com/en-us/azure/app-service/overview-hosting-plans"
|
||||
default = "Standard"
|
||||
}
|
||||
variable "svcplan_size" {
|
||||
description = "The compute and storage needed for the service plan to be deployed. Details can be found at https://azure.microsoft.com/en-us/pricing/details/app-service/windows/"
|
||||
default = "S1"
|
||||
}
|
||||
|
||||
variable "svcplan_kind" {
|
||||
description = "The kind of Service Plan to be created. Possible values are Windows/Linux/FunctionApp/App"
|
||||
default = "Linux"
|
||||
}
|
Загрузка…
Ссылка в новой задаче