Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save youssef-chtourou/9d3a4f1cfc7efcc2ed4006ac40d7048e to your computer and use it in GitHub Desktop.
Save youssef-chtourou/9d3a4f1cfc7efcc2ed4006ac40d7048e to your computer and use it in GitHub Desktop.
# Create the resource group
data "azurerm_resource_group" "rg" {
name = var.rgname
}
# Create the Linux App Service Plan
resource "azurerm_app_service_plan" "appserviceplan" {
lifecycle {
create_before_destroy = true
}
name = var.plan_name
location = data.azurerm_resource_group.rg.location
resource_group_name = data.azurerm_resource_group.rg.name
sku {
tier = "Standard"
size = "S1"
}
kind = var.kind_type
reserved = var.reserved
}
# Create the web app, pass in the App Service Plan ID, and deploy code from a public GitHub repo
resource "azurerm_app_service" "webapp" {
name = var.website_name
location = data.azurerm_resource_group.rg.location
resource_group_name = data.azurerm_resource_group.rg.name
app_service_plan_id = azurerm_app_service_plan.appserviceplan.id
tags = var.tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment