Skip to content

Commit 292b4b4

Browse files
authored
feat: Enable X-Ray tracing on Step Function if set to true in service_integrations (#22)
1 parent a8806ac commit 292b4b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.tf

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ locals {
44

55
enable_logging = try(var.logging_configuration["level"], "OFF") != "OFF"
66

7+
enable_xray_tracing = try(var.service_integrations["xray"]["xray"], false) == true
8+
79
# Normalize ARN by trimming ":*" because data-source has it, but resource does not have it
810
log_group_arn = trimsuffix(element(concat(data.aws_cloudwatch_log_group.sfn.*.arn, aws_cloudwatch_log_group.sfn.*.arn, [""]), 0), ":*")
911

@@ -28,6 +30,13 @@ resource "aws_sfn_state_machine" "this" {
2830
}
2931
}
3032

33+
dynamic "tracing_configuration" {
34+
for_each = local.enable_xray_tracing ? [true] : []
35+
content {
36+
enabled = true
37+
}
38+
}
39+
3140
type = upper(var.type)
3241

3342
tags = merge({ Name = var.name }, var.tags)

0 commit comments

Comments
 (0)