Skip to content

Instantly share code, notes, and snippets.

@dilani14
Created June 11, 2020 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dilani14/379a989ce5f0c756e96597cbc8e28c7a to your computer and use it in GitHub Desktop.
Save dilani14/379a989ce5f0c756e96597cbc8e28c7a to your computer and use it in GitHub Desktop.
add new db
variable "location" {
type = string
default = "eastus"
}
provider "azurerm" {
version = 1.38
}
resource "azurerm_resource_group" "rg" {
name = "dilani-tf-rg"
location = var.location
}
resource "azurerm_sql_server" "sqlserver" {
name = "diltfsqlserver"
resource_group_name = azurerm_resource_group.rg.name
location = var.location
version = "12.0"
administrator_login = "diladmin"
administrator_login_password = "1qaz2wsx@"
}
resource "azurerm_sql_database" "sqldb" {
name = "diltfdb"
resource_group_name = azurerm_resource_group.rg.name
location = var.location
server_name = azurerm_sql_server.sqlserver.name
}
resource "azurerm_sql_database" "sqldb1" {
name = "diltfdb1"
resource_group_name = azurerm_resource_group.rg.name
location = var.location
server_name = azurerm_sql_server.sqlserver.name
}
resource "azurerm_app_service_plan" "serviceplan" {
name = "diltf-appserviceplan"
location = var.location
resource_group_name = azurerm_resource_group.rg.name
sku {
tier = "Standard"
size = "S1"
}
}
resource "azurerm_app_service" "appservice" {
name = "diltf-app-service"
location = var.location
resource_group_name = azurerm_resource_group.rg.name
app_service_plan_id = azurerm_app_service_plan.serviceplan.id
app_settings = {
"ASPNETCORE_ENVIRONMENT" = "QA"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment