Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-21 add variable for enable redirects #22

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ module "collector_lb" {
| <a name="input_time_limit_ms"></a> [time\_limit\_ms](#input\_time\_limit\_ms) | The amount of time to buffer events before pushing them to PubSub | `number` | `500` | no |
| <a name="input_ubuntu_20_04_source_image"></a> [ubuntu\_20\_04\_source\_image](#input\_ubuntu\_20\_04\_source\_image) | The source image to use which must be based of of Ubuntu 20.04; by default the latest community version is used | `string` | `""` | no |
| <a name="input_user_provided_id"></a> [user\_provided\_id](#input\_user\_provided\_id) | An optional unique identifier to identify the telemetry events emitted by this stack | `string` | `""` | no |
| <a name="input_enable_default_redirect"></a> [enable\_default\_redirect](#input\_enable\_default\_redirect) | Whether to allow {collector_host}/r/tp2 to respond with a redirect uri | `bool` | `false` | no |

## Outputs

Expand Down
13 changes: 7 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ locals {
record_limit = var.record_limit
time_limit_ms = var.time_limit_ms

disable = !tobool(var.telemetry_enabled)
telemetry_url = join("", module.telemetry.*.collector_uri)
user_provided_id = var.user_provided_id
auto_generated_id = join("", module.telemetry.*.auto_generated_id)
module_name = local.module_name
module_version = local.module_version
disable = !tobool(var.telemetry_enabled)
telemetry_url = join("", module.telemetry.*.collector_uri)
user_provided_id = var.user_provided_id
auto_generated_id = join("", module.telemetry.*.auto_generated_id)
module_name = local.module_name
module_version = local.module_version
enable_default_redirect = var.enable_default_redirect
})

startup_script = templatefile("${path.module}/templates/startup-script.sh.tmpl", {
Expand Down
2 changes: 1 addition & 1 deletion templates/config.hocon.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ collector {
fallbackNetworkUserId = "00000000-0000-4000-A000-000000000000"
forwardedProtocolHeader = "X-Forwarded-Proto"
}
enableDefaultRedirect = false
enableDefaultRedirect = ${enable_default_redirect}
redirectMacro {
enabled = false
placeholder = "[TOKEN]"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ variable "time_limit_ms" {
type = number
}

variable "enable_default_redirect" {
description = "Whether to allow {collector_host}/r/tp2 to respond with a redirect uri"
type = bool
default = false
}

# --- Telemetry

variable "telemetry_enabled" {
Expand Down