Created
February 28, 2022 20:37
-
-
Save youssef-chtourou/9d3a4f1cfc7efcc2ed4006ac40d7048e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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