Skip to content

Commit

Permalink
feat: output the current region and domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
josephpage committed Apr 21, 2023
1 parent 3706bee commit d02b0d8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
10 changes: 10 additions & 0 deletions output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
7 changes: 7 additions & 0 deletions region.tf
Original file line number Diff line number Diff line change
@@ -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)
}
7 changes: 6 additions & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ terraform {

required_providers {
scalingo = {
source = "Scalingo/scalingo"
source = "scalingo/scalingo"
version = "~> 2.0"
}

environment = {
source = "eppo/environment"
version = "~> 1.3"
}
}
}

0 comments on commit d02b0d8

Please sign in to comment.