From ce1cce3391d7d7bbdc7faf458d343c504f402d85 Mon Sep 17 00:00:00 2001 From: Noah Kraemer Date: Wed, 30 Aug 2023 08:38:32 -0700 Subject: [PATCH] feat(cloud-bench) Ensure CloudAccount is created after Lighthouse --- modules/services/cloud-bench/trust_relationship/main.tf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/services/cloud-bench/trust_relationship/main.tf b/modules/services/cloud-bench/trust_relationship/main.tf index 7eaa950..f66abba 100644 --- a/modules/services/cloud-bench/trust_relationship/main.tf +++ b/modules/services/cloud-bench/trust_relationship/main.tf @@ -19,6 +19,13 @@ resource "sysdig_secure_cloud_account" "cloud_account" { alias = data.azurerm_subscription.subscription.display_name cloud_provider = "azure" role_enabled = "true" + + # Creating the Cloud Account object in Sysdig causes scans to begin. If lighthouse is not in place, these scans will + # fail. This block ensures that lighthouse is in place before any scans are triggered. + depends_on = [ + azurerm_lighthouse_definition.lighthouse_definition, + azurerm_lighthouse_assignment.lighthouse_assignment + ] } resource "azurerm_lighthouse_definition" "lighthouse_definition" {