Skip to content

Commit 1d52b35

Browse files
committed
fix(e2e): order the workspace module ahead of the DCR and connector
The workspace id output resolves once the workspace exists, not once its custom tables and Sentinel onboarding finish, so the DCR (whose Custom-<table> output stream targets the custom table) and the connector definition (which needs the workspace onboarded) could race ahead. Add depends_on = [module.law] to both example stacks so the table exists and onboarding completes first; the connector module retry regex still backstops residual onboarding propagation.
1 parent 3a8ac3e commit 1d52b35

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

examples/complete/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ module "data_collection" {
6161
source = "libre-devops/data-collection/azurerm"
6262
version = "~> 4.0"
6363

64+
# The DCR output stream (Custom-<table>) targets the destination custom table, so the table must
65+
# exist first. The workspace id output resolves once the workspace exists, not once its custom
66+
# tables finish, so order the whole workspace module ahead of the DCR explicitly.
67+
depends_on = [module.law]
68+
6469
resource_group_id = module.rg.ids[local.rg_name]
6570
location = local.location
6671
tags = module.tags.tags
@@ -102,6 +107,12 @@ module "data_collection" {
102107
module "codeless_connector" {
103108
source = "../../"
104109

110+
# The connector definition is created under the Sentinel-onboarded workspace. Onboarding is a
111+
# separate resource inside the workspace module that the workspace id output does not wait for, so
112+
# order the whole module ahead of the connector; the module's retry regex covers residual
113+
# onboarding propagation lag after that.
114+
depends_on = [module.law]
115+
105116
workspace_id = module.law.workspace_ids[local.law_name]
106117
definition_name = "ldo-example-multi-connector"
107118

examples/minimal/main.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ module "data_collection" {
6666
source = "libre-devops/data-collection/azurerm"
6767
version = "~> 4.0"
6868

69+
# The DCR output stream (Custom-<table>) targets the destination custom table, so the table must
70+
# exist first. The workspace id output resolves once the workspace exists, not once its custom
71+
# tables finish, so order the whole workspace module ahead of the DCR explicitly.
72+
depends_on = [module.law]
73+
6974
resource_group_id = module.rg.ids[local.rg_name]
7075
location = local.location
7176
tags = module.tags.tags
@@ -108,6 +113,12 @@ module "data_collection" {
108113
module "codeless_connector" {
109114
source = "../../"
110115

116+
# The connector definition is created under the Sentinel-onboarded workspace. Onboarding is a
117+
# separate resource inside the workspace module that the workspace id output does not wait for, so
118+
# order the whole module ahead of the connector; the module's retry regex covers residual
119+
# onboarding propagation lag after that.
120+
depends_on = [module.law]
121+
111122
workspace_id = module.law.workspace_ids[local.law_name]
112123
definition_name = "ldo-github-advisories"
113124

0 commit comments

Comments
 (0)