diff --git a/output.tf b/output.tf index 767f416..5435a0d 100644 --- a/output.tf +++ b/output.tf @@ -3,7 +3,17 @@ output "url" { value = scalingo_app.app.url } +output "domain" { + description = "Hostname to use to access the application (without https://)" + value = trim(scalingo_app.app.url, "https://") +} + output "git_url" { description = "Hostname to use to deploy code with Git + SSH" value = scalingo_app.app.git_url } + +output "region" { + description = "Region where the application is deployed" + value = local.current_region +} diff --git a/region.tf b/region.tf new file mode 100644 index 0000000..cb31dba --- /dev/null +++ b/region.tf @@ -0,0 +1,7 @@ +data "environment_variables" "scalingo_region_env" { + filter = "^SCALINGO_REGION" +} + +locals { + current_region = lookup(data.environment_variables.scalingo_region_env.items, "SCALINGO_REGION", null) +} diff --git a/versions.tf b/versions.tf index ed0f5b5..ba9c578 100644 --- a/versions.tf +++ b/versions.tf @@ -3,8 +3,13 @@ terraform { required_providers { scalingo = { - source = "Scalingo/scalingo" + source = "scalingo/scalingo" version = "~> 2.0" } + + environment = { + source = "eppo/environment" + version = "~> 1.3" + } } }