Last active
July 23, 2024 14:40
-
-
Save mdlavin/1b8fcc1b05932f6c105fb7c4ad34c204 to your computer and use it in GitHub Desktop.
Terraform configuration to enable X-Ray for a Lambda function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_lambda_function" "service" { | |
# Your usual aws_lambda_function configuration settings here | |
tracing_config { | |
mode = "Active" | |
} | |
} |
This is the newer version of the managed policy:
data "aws_iam_policy" "lambda_xray" {
name = "AWSXRayDaemonWriteAccess"
}
with the suggegsted code:
resource "aws_lambda_function" "service" {
tracing_config {
mode = "Active"
}
}
I got only the last Log containing the X-Ray-data but not all Logs, my wish is that all logs of the lambda contains the xray-trace-id did someone have a solution?
Hi, not sure if anyone's run into this situation where if you remove that
tracing_config
block, tracing is still turned on?
yes me also. I had to change it to "PassThrough" to turn it of. I'm not sure if this is the right workaround.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, not sure if anyone's run into this situation where if you remove that
tracing_config
block, tracing is still turned on?