Skip to content
Open
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
14 changes: 14 additions & 0 deletions modules/integrations/cloud-logs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,17 @@ resource "sysdig_secure_cloud_auth_account_component" "aws_cloud_logs" {
aws_cloudformation_stack_set_instance.cloudlogs_s3_access_topic
]
}

locals {
wait_duration = format("%ds", var.wait_after_basic_seconds)
}

resource "time_sleep" "wait_after_ciem_basic" {
count = var.wait_after_basic_seconds > 0 ? 1 : 0
create_duration = local.wait_duration
}

output "wait_after_basic" {
value = var.wait_after_basic_seconds > 0 ? time_sleep.wait_after_ciem_basic : null
description = "Wait handle to delay downstream operations after basic by the configured seconds."
}
6 changes: 6 additions & 0 deletions modules/integrations/cloud-logs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ variable "kms_key_arn" {
type = string
default = null
}

variable "wait_after_basic_seconds" {
type = number
description = "Number of seconds to wait after CIEM basic before proceeding (set to 0 to disable)."
default = 30
}
4 changes: 4 additions & 0 deletions modules/integrations/cloud-logs/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ terraform {
source = "hashicorp/random"
version = ">= 3.1"
}
time = {
source = "hashicorp/time"
version = ">= 0.9"
}
}
}
14 changes: 14 additions & 0 deletions modules/integrations/event-bridge/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,17 @@ resource "sysdig_secure_cloud_auth_account_component" "aws_event_bridge" {
}
})
}

locals {
wait_duration = format("%ds", var.wait_after_basic_seconds)
}

resource "time_sleep" "wait_after_ciem_basic" {
count = var.wait_after_basic_seconds > 0 ? 1 : 0
create_duration = local.wait_duration
}

output "wait_after_basic" {
value = var.wait_after_basic_seconds > 0 ? time_sleep.wait_after_ciem_basic : null
description = "Wait handle to delay downstream operations after basic (e.g., CIEM) by the configured seconds."
}
6 changes: 6 additions & 0 deletions modules/integrations/event-bridge/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ variable "api_dest_rate_limit" {
default = 300
description = "Rate limit for API Destinations"
}

variable "wait_after_basic_seconds" {
type = number
description = "Number of seconds to wait after CIEM basic before proceeding (set to 0 to disable)."
default = 30
}
4 changes: 4 additions & 0 deletions modules/integrations/event-bridge/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ terraform {
source = "hashicorp/random"
version = ">= 3.1"
}
time = {
source = "hashicorp/time"
version = ">= 0.9"
}
}
}
5 changes: 4 additions & 1 deletion test/examples/single_account/cloud_logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement_advanc
sysdig_secure_cloud_auth_account_feature.identity_entitlement_basic.components,
[module.cloud-logs.cloud_logs_component_id]
)
depends_on = [module.cloud-logs]
depends_on = [
module.cloud-logs,
module.cloud-logs.wait_after_basic
]
flags = {
"CIEM_FEATURE_MODE" = "advanced"
}
Expand Down
7 changes: 5 additions & 2 deletions test/examples/single_account/cloud_logs_gov.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement_advanc
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT"
enabled = true
components = concat(sysdig_secure_cloud_auth_account_feature.identity_entitlement_basic.components, [module.cloud-logs.cloud_logs_component_id])
depends_on = [module.cloud-logs]
flags = { "CIEM_FEATURE_MODE" : "advanced" }
depends_on = [
module.cloud-logs,
module.cloud-logs.wait_after_basic
]
flags = { "CIEM_FEATURE_MODE" : "advanced" }

lifecycle {
ignore_changes = [flags, components]
Expand Down
7 changes: 5 additions & 2 deletions test/examples/single_account/event_bridge.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement_advanc
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT"
enabled = true
components = concat(sysdig_secure_cloud_auth_account_feature.identity_entitlement_basic.components, [module.event-bridge.event_bridge_component_id])
depends_on = [module.event-bridge]
flags = { "CIEM_FEATURE_MODE" : "advanced" }
depends_on = [
module.event-bridge,
module.event-bridge.wait_after_basic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: since this is user facing, should we change the resource name to be more generic?

]
flags = { "CIEM_FEATURE_MODE" : "advanced" }

lifecycle {
ignore_changes = [flags, components]
Expand Down
7 changes: 5 additions & 2 deletions test/examples/single_account/event_bridge_gov.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ resource "sysdig_secure_cloud_auth_account_feature" "identity_entitlement_advanc
type = "FEATURE_SECURE_IDENTITY_ENTITLEMENT"
enabled = true
components = concat(sysdig_secure_cloud_auth_account_feature.identity_entitlement_basic.components, [module.event-bridge.event_bridge_component_id])
depends_on = [module.event-bridge]
flags = { "CIEM_FEATURE_MODE" : "advanced" }
depends_on = [
module.event-bridge,
module.event-bridge.wait_after_basic
]
flags = { "CIEM_FEATURE_MODE" : "advanced" }

lifecycle {
ignore_changes = [flags, components]
Expand Down