Skip to content

Commit

Permalink
feat: new outputs : origin_domain and log_drain_url
Browse files Browse the repository at this point in the history
  • Loading branch information
josephpage committed Apr 24, 2023
1 parent e85ad24 commit 0309f7d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ An opinionated Terraform module to provision an application and database very ea

| Name | Description |
|------|-------------|
| <a name="output_domain"></a> [domain](#output\_domain) | Hostname to use to access the application (without https://) |
| <a name="output_git_url"></a> [git\_url](#output\_git\_url) | Hostname to use to deploy code with Git + SSH |
| <a name="output_region"></a> [region](#output\_region) | Region where the application is deployed |
| <a name="output_url"></a> [url](#output\_url) | Base URL (https://*) to access the application |
| <a name="output_domain"></a> [domain](#output\_domain) | Hostname to use to access the application. Same as the `url` output but without the `https://`. |
| <a name="output_git_url"></a> [git\_url](#output\_git\_url) | Hostname to use to deploy code with Git + SSH. |
| <a name="output_log_drain_url"></a> [log\_drain\_url](#output\_log\_drain\_url) | URL of the drain to use by Scalingo to send logs to your log management system. (Note: the username and password are included in the URL, be careful with the security of this URL.). It's already marked as sensitive to avoid leaking it in the Terraform state. |
| <a name="output_origin_domain"></a> [origin\_domain](#output\_origin\_domain) | The FQDN of the Scalingo application (`<your_app_name>.<region>.scalingo.io`). Same as the url output if you have not set a canonical domain. |
| <a name="output_region"></a> [region](#output\_region) | Region where the application is deployed. |
| <a name="output_url"></a> [url](#output\_url) | Base URL to access the application (`https://*`). If you have set a canonical domain, this will be the URL with the canonical domain, otherwise it will be the default URL of the Scalingo application. |
<!-- END_TF_DOCS -->

## Generate documentation
Expand Down
20 changes: 15 additions & 5 deletions output.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
output "url" {
description = "Base URL (https://*) to access the application"
value = scalingo_app.app.url
description = "Base URL to access the application (`https://*`). If you have set a canonical domain, this will be the URL with the canonical domain, otherwise it will be the default URL of the Scalingo application."
value = (var.canonical_domain == "" ? scalingo_app.app.url : "https://${var.canonical_domain}")
}

output "domain" {
description = "Hostname to use to access the application (without https://)"
description = "Hostname to use to access the application. Same as the `url` output but without the `https://`."
value = trim(scalingo_app.app.url, "https://")
}

output "origin_domain" {
description = "The FQDN of the Scalingo application (`<your_app_name>.<region>.scalingo.io`). Same as the url output if you have not set a canonical domain."
value = "${scalingo_app.app.name}.${local.current_region}.scalingo.io"
}

output "git_url" {
description = "Hostname to use to deploy code with Git + SSH"
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"
description = "Region where the application is deployed."
value = local.current_region
}

output "log_drain_url" {
description = "URL of the drain to use by Scalingo to send logs to your log management system. (Note: the username and password are included in the URL, be careful with the security of this URL.). It's already marked as sensitive to avoid leaking it in the Terraform state."
value = sensitive(scalingo_app.log_drain.drain_url)
}

0 comments on commit 0309f7d

Please sign in to comment.