diff --git a/terraform/aws/modules/splunk-server/resources.tf b/terraform/aws/modules/splunk-server/resources.tf index 23181b79..decda128 100644 --- a/terraform/aws/modules/splunk-server/resources.tf +++ b/terraform/aws/modules/splunk-server/resources.tf @@ -28,7 +28,7 @@ data "aws_ami" "splunk_server" { } resource "aws_iam_role" "splunk_role" { - count = var.splunk_server.byo_splunk == "0" ? 1 : 0 + count = ((var.aws.cloudtrail == "1") || (var.general.carbon_black_cloud == "1")) && (var.splunk_server.byo_splunk == "0") ? 1 : 0 name = "splunk_role_${var.general.key_name}_${var.general.attack_range_name}" assume_role_policy = <