diff --git a/modules/enterprise-organization/telemetry.tf b/modules/enterprise-organization/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/enterprise-organization/telemetry.tf +++ b/modules/enterprise-organization/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/org-organization/telemetry.tf b/modules/org-organization/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/org-organization/telemetry.tf +++ b/modules/org-organization/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/org-ruleset/telemetry.tf b/modules/org-ruleset/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/org-ruleset/telemetry.tf +++ b/modules/org-ruleset/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/org-team/telemetry.tf b/modules/org-team/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/org-team/telemetry.tf +++ b/modules/org-team/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/project/telemetry.tf b/modules/project/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/project/telemetry.tf +++ b/modules/project/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/repository-custom-property/telemetry.tf b/modules/repository-custom-property/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/repository-custom-property/telemetry.tf +++ b/modules/repository-custom-property/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/repository-environment/telemetry.tf b/modules/repository-environment/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/repository-environment/telemetry.tf +++ b/modules/repository-environment/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/repository/telemetry.tf b/modules/repository/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/repository/telemetry.tf +++ b/modules/repository/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." } diff --git a/modules/webhook/telemetry.tf b/modules/webhook/telemetry.tf index 52ddbd1..99565cf 100644 --- a/modules/webhook/telemetry.tf +++ b/modules/webhook/telemetry.tf @@ -27,11 +27,13 @@ variable "telemetry" { check "telemetry" { assert { - condition = var.telemetry.enabled ? provider::telemetry::capture_posthog( - { + # A null connection disables the call. Wrapping the call in a conditional + # expression would not, because Terraform evaluates both of its results. + condition = provider::telemetry::capture_posthog( + var.telemetry.enabled ? { host = "https://us.i.posthog.com" project_token = "phc_xwn7HLdbaLxDAq7gbiKTbbJt5oMtXHkRRmaN8aeWeUnk" - }, + } : null, { machine = var.telemetry.capture_machine network = var.telemetry.capture_network @@ -55,7 +57,7 @@ check "telemetry" { } } } - ) : true + ) error_message = "Telemetry invocation failed." }