Skip to content

Commit

Permalink
fix: fix cycle error (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocofaigh authored Sep 30, 2024
1 parent db5a58f commit 4870caa
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ provider "ibm" {
provider "logdna" {
alias = "at"
servicekey = ""
servicekey = module.observability_instances.activity_tracker_resource_key != null ? module.observability_instances.activity_tracker_resource_key : ""
url = local.at_endpoint
}
provider "logdna" {
alias = "ld"
servicekey = ""
servicekey = module.observability_instances.log_analysis_resource_key != null ? module.observability_instances.log_analysis_resource_key : ""
url = local.at_endpoint
}
Expand Down
5 changes: 3 additions & 2 deletions examples/advanced/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ module "observability_instances" {
}
}
cloud_logs_existing_en_instances = [{
en_instance_id = module.event_notification.guid
en_region = var.region
en_instance_id = module.event_notification.guid
en_region = var.region
en_integration_name = "${var.prefix}-en"
}]

# Activity Tracker targets
Expand Down
4 changes: 2 additions & 2 deletions examples/advanced/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ locals {

provider "logdna" {
alias = "at"
servicekey = ""
servicekey = module.observability_instances.activity_tracker_resource_key != null ? module.observability_instances.activity_tracker_resource_key : ""
url = local.at_endpoint
}

provider "logdna" {
alias = "ld"
servicekey = ""
servicekey = module.observability_instances.log_analysis_resource_key != null ? module.observability_instances.log_analysis_resource_key : ""
url = local.at_endpoint
}
4 changes: 2 additions & 2 deletions examples/basic/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ locals {

provider "logdna" {
alias = "at"
servicekey = ""
servicekey = module.observability_instances.activity_tracker_resource_key != null ? module.observability_instances.activity_tracker_resource_key : ""
url = local.at_endpoint
}

provider "logdna" {
alias = "ld"
servicekey = ""
servicekey = module.observability_instances.log_analysis_resource_key != null ? module.observability_instances.log_analysis_resource_key : ""
url = local.at_endpoint
}
14 changes: 7 additions & 7 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ output "region" {

# Log Analysis
output "log_analysis_crn" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].crn : null
value = var.log_analysis_provision ? module.log_analysis[0].crn : null
description = "DEPRECATED: The id of the provisioned Log Analysis instance."
}

output "log_analysis_guid" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].guid : null
value = var.log_analysis_provision ? module.log_analysis[0].guid : null
description = "DEPRECATED: The guid of the provisioned Log Analysis instance."
}

output "log_analysis_name" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].name : null
value = var.log_analysis_provision ? module.log_analysis[0].name : null
description = "DEPRECATED: The name of the provisioned Log Analysis instance."
}

output "log_analysis_resource_group_id" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].resource_group_id : null
value = var.log_analysis_provision ? module.log_analysis[0].resource_group_id : null
description = "DEPRECATED: The resource group where Log Analysis instance resides"
}

output "log_analysis_resource_key" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].resource_key : null
value = var.log_analysis_provision ? module.log_analysis[0].resource_key : null
description = "DEPRECATED: Log Analysis service key for agents to use"
sensitive = true
}

output "log_analysis_ingestion_key" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].ingestion_key : null
value = var.log_analysis_provision ? module.log_analysis[0].ingestion_key : null
description = "DEPRECATED: Log Analysis ingest key for agents to use"
sensitive = true
}

output "log_analysis_manager_key_name" {
value = length(module.log_analysis) > 0 ? module.log_analysis[0].manager_key_name : null
value = var.log_analysis_provision ? module.log_analysis[0].manager_key_name : null
description = "DEPRECATED: The Log Analysis manager key name"
}

Expand Down
1 change: 1 addition & 0 deletions tests/other_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
const basicExampleTerraformDir = "examples/basic"

func TestRunBasicExample(t *testing.T) {
t.Parallel()

options := setupOptions(t, "obs-basic", basicExampleTerraformDir)
output, err := options.RunTestConsistency()
Expand Down
1 change: 1 addition & 0 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func TestRunAdvanceExampleInSchematics(t *testing.T) {
}

func TestRunUpgradeExample(t *testing.T) {
t.Parallel()

options := setupOptions(t, "obs-upg", advanceExampleTerraformDir)
output, err := options.RunTestUpgrade()
Expand Down

0 comments on commit 4870caa

Please sign in to comment.