adding service plans and listener_service

This commit is contained in:
Andy Pack 2023-09-04 23:23:25 +01:00
parent a7601bf3af
commit 11f464a0a3
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7
7 changed files with 73 additions and 6 deletions

View File

@ -0,0 +1,20 @@
output "redis_connection_string" {
value = azurerm_redis_cache.selector.primary_connection_string
}
output "pgsql_server_fqdn" {
value = azurerm_postgresql_server.selector.fqdn
}
output "pgsql_database_name" {
value = azurerm_postgresql_database.selector.name
}
output "pgsql_username" {
value = azurerm_postgresql_server.selector.administrator_login
}
output "pgsql_password" {
value = azurerm_postgresql_server.selector.administrator_login_password
}

View File

@ -0,0 +1,18 @@
resource "azurerm_service_plan" "selector" {
name = var.service_name
resource_group_name = var.resource_group_name
location = var.resource_group_location
os_type = "Linux"
sku_name = var.service_plan_sku
}
resource "azurerm_linux_web_app" "selector" {
name = var.service_name
resource_group_name = var.resource_group_name
location = azurerm_service_plan.selector.location
service_plan_id = azurerm_service_plan.selector.id
site_config {
always_on = true
}
}

View File

View File

@ -0,0 +1,15 @@
variable "resource_group_name" {
type = string
}
variable "resource_group_location" {
type = string
}
variable "service_name" {
type = string
}
variable "service_plan_sku" {
type = string
}

View File

@ -3,10 +3,10 @@ resource "azurerm_service_plan" "selector" {
resource_group_name = var.resource_group_name resource_group_name = var.resource_group_name
location = var.resource_group_location location = var.resource_group_location
os_type = "Linux" os_type = "Linux"
sku_name = "F1" sku_name = var.service_plan_sku
} }
resource "azurerm_linux_web_app" "example" { resource "azurerm_linux_web_app" "selector" {
name = var.site_name name = var.site_name
resource_group_name = var.resource_group_name resource_group_name = var.resource_group_name
location = azurerm_service_plan.selector.location location = azurerm_service_plan.selector.location

View File

@ -8,4 +8,8 @@ variable "resource_group_location" {
variable "site_name" { variable "site_name" {
type = string type = string
}
variable "service_plan_sku" {
type = string
} }

View File

@ -22,10 +22,10 @@ locals {
env_name = "selector-prod" env_name = "selector-prod"
} }
resource "azurerm_resource_group" "selector" { # resource "azurerm_resource_group" "selector" {
name = local.env_name # name = local.env_name
location = "UK South" # location = "UK South"
} # }
# module "web_service" { # module "web_service" {
# source = "../modules/web_service" # source = "../modules/web_service"
@ -33,6 +33,7 @@ resource "azurerm_resource_group" "selector" {
# resource_group_name = azurerm_resource_group.selector.name # resource_group_name = azurerm_resource_group.selector.name
# resource_group_location = azurerm_resource_group.selector.location # resource_group_location = azurerm_resource_group.selector.location
# site_name = "${local.env_name}-web" # site_name = "${local.env_name}-web"
# service_plan_sku = "F1"
# } # }
# module "data" { # module "data" {
@ -42,3 +43,12 @@ resource "azurerm_resource_group" "selector" {
# resource_group_location = azurerm_resource_group.selector.location # resource_group_location = azurerm_resource_group.selector.location
# data_name = "${local.env_name}-data" # data_name = "${local.env_name}-data"
# } # }
# module "listener_service" {
# source = "../modules/listener_service"
# resource_group_name = azurerm_resource_group.selector.name
# resource_group_location = azurerm_resource_group.selector.location
# service_name = "${local.env_name}-listener"
# service_plan_sku = "B1"
# }