This commit is contained in:
2025-10-29 09:30:43 -07:00
parent b1849bc111
commit f0c1edfaea
5 changed files with 60 additions and 29 deletions

View File

@@ -1,16 +1,7 @@
variable "hosting_option" {
description = "Hosting option for the Flask app"
type = string
default = "cloud_run"
validation {
condition = contains(["cloud_run", "app_engine"], var.hosting_option)
error_message = "The hosting_option must be one of: cloud_run, app_engine."
}
}
# Select hosting option based on variable
module "hosting" {
source = "./modules/${var.hosting_option}"
source = "./modules/cloud_run"
# Common variables
app_name = "rothbard-portal"
@@ -29,8 +20,7 @@ module "hosting" {
filevine_user_id = var.filevine_user_id
# Module-specific variables
container_image = var.hosting_option == "cloud_run" ? var.container_image : null
app_source_zip_path = var.hosting_option == "app_engine" ? var.app_source_zip_path : null
container_image = var.container_image
}
# Additional variables for hosting options
@@ -93,7 +83,5 @@ variable "filevine_user_id" {
# Output hosting-specific URLs
output "application_url" {
description = "URL of the deployed application"
value = var.hosting_option == "cloud_run" ? module.hosting.service_url :
var.hosting_option == "app_engine" ? module.hosting.app_url :
null
}
value = module.hosting.service_url
}