Init repo
This commit is contained in:
Generated
+22
@@ -0,0 +1,22 @@
|
||||
# This file is maintained automatically by "terraform init".
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hashicorp/azurerm" {
|
||||
version = "4.81.0"
|
||||
constraints = "~> 4.0"
|
||||
hashes = [
|
||||
"h1:XhToZua4gtih1Kv8RdStcfND83G4Tmb6GZFT4jEUhDU=",
|
||||
"zh:0732e7b74264ddfa2b90ba69d01c283d3cbae9f72ed3e506c6ac92529fed7fd3",
|
||||
"zh:12afb524e232fe4e3d6161927724af5dfa4831d71edd9c174917ca9b7377bfae",
|
||||
"zh:169d619ae202c4145e02fb706fb7c3679445ab3e3ff722edbf89597517a8c92e",
|
||||
"zh:6beb95a3ef2f2d9c76abaa48e5450e90686a3fb6a47f1cb0ff7c5e94b6960151",
|
||||
"zh:705e075fb5ffc4bf66fd7cbabf1a65007a41621e80030a2c158a4c83b6046216",
|
||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||
"zh:79a8d17fefe647040fcb9ee8821a4f09f395427c4fd49493489b9a93a9a1038e",
|
||||
"zh:8cc3f900b3774c0ae37ae42365c4579a199cf9e5edf88e476fdf5ab1048f84ea",
|
||||
"zh:dec373b9390fa95e257291acd018ed65a7d512b428645d35e22cdbe8b245a08b",
|
||||
"zh:e60f1e9fb45df6defade2855ed6e68547409ea75d30655c556adb0c08579749b",
|
||||
"zh:f901d12ec82f3f8b5880a27b5cbcd7bd0d97e60c9367a2d7ed82fdd1157b39ff",
|
||||
"zh:facf68ea5bf0f2b8ba720e7fba5f86492e1d4c591100460bb91c3f79f391f4b6",
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
terraform {
|
||||
required_version = ">= 1.5"
|
||||
|
||||
required_providers {
|
||||
azurerm = {
|
||||
source = "hashicorp/azurerm"
|
||||
version = "~> 4.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "azurerm" {
|
||||
features {}
|
||||
}
|
||||
|
||||
resource "azurerm_resource_group" "mission_control" {
|
||||
name = "rg-mission-control-${var.environment}"
|
||||
location = var.location
|
||||
}
|
||||
|
||||
resource "azurerm_service_plan" "mission_control" {
|
||||
name = "asp-mission-control-${var.environment}"
|
||||
resource_group_name = azurerm_resource_group.mission_control.name
|
||||
location = azurerm_resource_group.mission_control.location
|
||||
os_type = "Linux"
|
||||
sku_name = "B1"
|
||||
}
|
||||
|
||||
resource "azurerm_linux_web_app" "mission_control" {
|
||||
name = "app-mission-control-${var.environment}"
|
||||
resource_group_name = azurerm_resource_group.mission_control.name
|
||||
location = azurerm_resource_group.mission_control.location
|
||||
service_plan_id = azurerm_service_plan.mission_control.id
|
||||
|
||||
site_config {
|
||||
application_stack {
|
||||
dotnet_version = "10.0"
|
||||
}
|
||||
}
|
||||
|
||||
connection_string {
|
||||
name = "MissionControl"
|
||||
type = "SQLAzure"
|
||||
value = "Server=tcp:${azurerm_mssql_server.mission_control.fully_qualified_domain_name},1433;Database=${azurerm_mssql_database.mission_control.name};User ID=${var.sql_admin_login};Password=${var.sql_admin_password};Encrypt=True;"
|
||||
}
|
||||
}
|
||||
|
||||
resource "azurerm_mssql_server" "mission_control" {
|
||||
name = "sql-mission-control-${var.environment}"
|
||||
resource_group_name = azurerm_resource_group.mission_control.name
|
||||
location = azurerm_resource_group.mission_control.location
|
||||
version = "12.0"
|
||||
administrator_login = var.sql_admin_login
|
||||
administrator_login_password = var.sql_admin_password
|
||||
}
|
||||
|
||||
resource "azurerm_mssql_database" "mission_control" {
|
||||
name = "sqldb-mission-control"
|
||||
server_id = azurerm_mssql_server.mission_control.id
|
||||
sku_name = "Basic"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
output "web_app_url" {
|
||||
description = "Public URL of the Mission Control web app."
|
||||
value = "https://${azurerm_linux_web_app.mission_control.default_hostname}"
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
variable "environment" {
|
||||
description = "Deployment environment name, used in resource names."
|
||||
type = string
|
||||
default = "dev"
|
||||
}
|
||||
|
||||
variable "location" {
|
||||
description = "Azure region to deploy into."
|
||||
type = string
|
||||
default = "uksouth"
|
||||
}
|
||||
|
||||
variable "sql_admin_login" {
|
||||
description = "Administrator login for the SQL server."
|
||||
type = string
|
||||
default = "missioncontrol"
|
||||
}
|
||||
|
||||
variable "sql_admin_password" {
|
||||
description = "Administrator password for the SQL server."
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
Reference in New Issue
Block a user